@dcrackel/hematournamentui 1.0.39 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{.eslintrc.js → .eslintrc.ts} +3 -4
- package/dist/HemaTouranmentUI-lib.es.js +6852 -6544
- package/dist/HemaTouranmentUI-lib.umd.js +27 -27
- package/dist/style.css +1 -1
- package/package.json +63 -58
- package/src/index.js +6 -6
- package/src/mocks/locationMock.js +44 -0
- package/src/mocks/personsMock.js +46 -0
- package/src/mocks/tournamentMock.js +98 -24
- package/src/stories/Atoms/Icon/BaseIcon.stories.js +26 -1
- package/src/stories/Atoms/Icon/BaseIcon.vue +9 -1
- package/src/stories/Atoms/Input/BaseInput.vue +1 -1
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.stories.js +7 -1
- package/src/stories/Molecules/Cards/Detail/TournamentCardDetail.vue +26 -8
- package/src/stories/Molecules/Cards/Header/TournamentCardHeader.vue +4 -0
- package/src/stories/Molecules/CombinationInputs/TitledInput/TitledInput.stories.js +75 -0
- package/src/stories/Molecules/CombinationInputs/TitledInput/TitledInput.test.js +81 -0
- package/src/stories/Molecules/CombinationInputs/TitledInput/TitledInput.vue +42 -0
- package/src/stories/Molecules/Filters/FilterAndSortBar/FilterAndSortBar.vue +1 -1
- package/src/stories/Molecules/Filters/FilterUpcomingPast/FilterUpcomingPast.vue +1 -1
- package/src/stories/Molecules/Menus/EditTournamentMenu/EditTournamentMenu.stories.js +13 -1
- package/src/stories/Molecules/Menus/EditTournamentMenu/EditTournamentMenu.vue +6 -4
- package/src/stories/Molecules/Modals/BaseModal/BaseModal.stories.js +39 -18
- package/src/stories/Molecules/Modals/BaseModal/BaseModal.vue +22 -9
- package/src/stories/Organisms/Cards/TournamentCard/TournamentCard.vue +20 -8
- package/src/stories/Organisms/ComplexInputs/AddressAutocomplete/AddressAutocomplete.stories.js +13 -0
- package/src/stories/Organisms/{Inputs → ComplexInputs}/AddressAutocomplete/AddressAutocomplete.vue +9 -11
- package/src/stories/Organisms/{Inputs → ComplexInputs}/DatePicker/DatePicker.stories.js +1 -1
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.stories.js +20 -0
- package/src/stories/Organisms/ComplexInputs/FindLocation/FindLocation.stories.js +30 -0
- package/src/stories/Organisms/ComplexInputs/FindLocation/FindLocation.vue +129 -0
- package/src/stories/Organisms/ComplexInputs/FindPerson/FindPerson.stories.js +30 -0
- package/src/stories/Organisms/ComplexInputs/FindPerson/FindPerson.vue +113 -0
- package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +20 -0
- package/src/stories/Organisms/{Inputs → ComplexInputs}/ImageCropper/ImageCropper.vue +4 -6
- package/src/stories/Organisms/ComplexInputs/TextBoxEditor/TextBoxEditor.stories.js +17 -0
- package/src/stories/Organisms/Containers/Container.stories.js +13 -0
- package/src/stories/Organisms/Containers/Container.vue +6 -0
- package/src/stories/Organisms/Forms/EditTournamentForm1.stories.js +26 -0
- package/src/stories/Organisms/Forms/EditTournamentForm1.vue +66 -0
- package/src/stories/Organisms/Grids/GridContainer.stories.js +28 -1
- package/src/stories/Organisms/Grids/GridContainer.vue +3 -3
- package/src/stories/Templates/TournamentManagement/AddTournament/PageOne/AddTournamentPageOne.stories.js +17 -13
- package/src/stories/Templates/TournamentManagement/AddTournament/PageOne/AddTournamentPageOne.vue +27 -21
- package/tailwind.config.js +2 -1
- package/src/stories/Organisms/Inputs/AddressAutocomplete/AddressAutocomplete.stories.js +0 -25
- package/src/stories/Organisms/Inputs/DropDown/DropDownMenu.stories.js +0 -34
- package/src/stories/Organisms/Inputs/ImageCropper/ImageCropper.stories.js +0 -28
- package/src/stories/Organisms/Inputs/TextBoxEditor/TextBoxEditor.stories.js +0 -28
- /package/src/stories/Organisms/{Inputs → ComplexInputs}/DatePicker/DatePicker.vue +0 -0
- /package/src/stories/Organisms/{Inputs → ComplexInputs}/DropDown/DropDownMenu.vue +0 -0
- /package/src/stories/Organisms/{Inputs → ComplexInputs}/TextBoxEditor/TextBoxEditor.vue +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(_e,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(_e=typeof globalThis<"u"?globalThis:_e||self,l(_e.HemaTournamentUI={},_e.Vue))})(this,function(_e,l){"use strict";const Le=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},em={name:"BaseIcon",props:{iconName:{type:String,default:"fa-face-smile",required:!0},style:{type:String,default:"fa-solid",validator:function(n){return["fa-solid","fa-regular","fa-solid","fa-light","fa-thing"].indexOf(n)!==-1}},size:{type:String,validator:function(n){return["xs","sm","md","lg","xl","2xl","3xl","4xl","5xl"].indexOf(n)!==-1},default:"sm"},color:{type:String,default:"primary"}},computed:{computedIconClass(){return[this.style,this.iconName,`text-${this.size}`,this.colorClass]},colorClass(){return`text-${this.color}`}}};function tm(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("i",{class:l.normalizeClass(o.computedIconClass)},null,2)}const Ci=Le(em,[["render",tm]]),nm={name:"BaseInput",components:{BaseIcon:Ci},props:{placeholder:{type:String,default:""},value:{type:String,default:""},invalid:{type:Boolean,default:!1},addBorder:{type:Boolean,default:!1},iconName:{type:String,default:""},iconStyle:{type:String,default:"fa-solid",validator:n=>["fa-solid","fa-regular","fa-light","fa-thing"].includes(n)},size:{type:String,default:"sm",validator:n=>["xs","sm","md","lg","xl","2xl","3xl","4xl"].includes(n)},iconColor:{type:String,default:"primary",validator:n=>["neutral","primary","secondary","tertiary","quaternary","bright","white","alarm"].includes(n)},emits:["click"]},setup(n,{emit:e}){const t=l.ref(n.value),r=l.ref(null);l.watch(()=>n.value,a=>{t.value=a});const i=l.computed(()=>{let a="appearance-none focus:outline-none w-full text-sm rounded-lg";return n.addBorder&&(a+=n.invalid?" border border-alarm p-2":" border border-dropdownSelect p-2"),a});return{internalValue:t,baseClasses:i,onInput:()=>{clearTimeout(r.value),r.value=setTimeout(()=>{e("update:value",t.value)},300)}}}},rm=["placeholder"];function im(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass((t.iconName,""))},[l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>r.internalValue=a),class:l.normalizeClass(r.baseClasses),placeholder:t.placeholder,onInput:e[1]||(e[1]=(...a)=>r.onInput&&r.onInput(...a))},null,42,rm),[[l.vModelText,r.internalValue]])],2)}const Mi=Le(nm,[["render",im]]),om={name:"BaseRadioGroup",props:{invalid:{type:Boolean,default:!1},items:{type:Array,required:!0}},data(){return{selectedIndex:null}},methods:{selectItem(n){this.selectedIndex=n,this.$emit("update:value",this.items[n].value)}}},am={class:"text-xl",role:"radiogroup"},sm=["onClick","aria-checked","onKeydown"],lm={class:"flex flex-col"};function cm(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",am,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,(a,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex flex-row p-4 text-quaternary rounded-lg mb-2 shadow border hover:bg-tertiary",[i.selectedIndex===s?" bg-tertiary":" bg-white",t.invalid?" border-alarm":" border-dropdownSelect"]]),key:s,onClick:c=>o.selectItem(s),role:"radio","aria-checked":i.selectedIndex===s?"true":"false",tabindex:"0",onKeydown:l.withKeys(l.withModifiers(c=>o.selectItem(s),["prevent"]),["enter"])},[l.createElementVNode("i",{class:l.normalizeClass([[i.selectedIndex===s?"fa-circle-dot text-quaternary ":"fa-circle "],"fa-regular pr-4 pt-2"])},null,2),l.createElementVNode("div",lm,[l.createElementVNode("p",{class:l.normalizeClass([[i.selectedIndex===s?"text-quaternary ":""],"font-bold text-sm"])},l.toDisplayString(a.label),3),l.createElementVNode("p",{class:l.normalizeClass([[i.selectedIndex===s?"text-quaternary ":""],"text-sm"])},l.toDisplayString(a.description),3)])],42,sm))),128))])}const vc=Le(om,[["render",cm]]),dm={name:"base-tag",props:{label:{type:String,required:!0},backgroundColor:{type:String,validator:function(n){return["primary","secondary","tertiary","neutral","bright"].indexOf(n)!==-1}}},setup(n){return n=l.reactive(n),{classes:l.computed(()=>{let e="cursor-pointer inline-block py-1 px-3 my-2 ml-3 text-xs font-normal rounded-full text-neutral";switch(n.backgroundColor){case"primary":e+=" bg-primary";break;case"secondary":e+=" bg-secondary";break;case"tertiary":e+=" bg-tertiary";break;case"neutral":e+=" bg-neutral";break;case"bright":e+=" bg-bright";break;default:e+=" bg-primary";break}return e})}}};function um(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(r.classes)},l.toDisplayString(t.label),3)}const bc=Le(dm,[["render",um]]),fm={name:"BaseText",props:{text:{type:String,required:!0,default:""},weight:{type:String,default:"normal",validator:function(n){return["light","normal","medium","semi-bold","bold","extra-bold"].indexOf(n)!==-1}},size:{type:String,default:"sm",validator:function(n){return["xs","sm","md","lg","xl","2xl","3xl"].indexOf(n)!==-1}},color:{type:String,default:"primary",validator:function(n){return["neutral","quaternary","tertiary","secondary","primary","bright","primaryHighlight","alarm"].indexOf(n)!==-1}},invalid:{type:Boolean,default:!1},hoverColor:{type:String,default:"none",validator:function(n){return["primary","secondary","tertiary","quaternary","neutral","bright","none"].indexOf(n)!==-1}}},setup(n){return{classes:l.computed(()=>{let e="";switch(n.color){case"neutral":e+=" text-neutral";break;case"tertiary":e+=" text-tertiary";break;case"secondary":e+=" text-secondary";break;case"quaternary":e+=" text-quaternary";break;case"primary":e+=" text-primary";break;case"primaryHighlight":e+=" text-primaryHighlight";break;case"bright":e+=" text-bright";break;case"alarm":e+=" text-alarmText";break}switch(n.invalid&&(e=" text-alarm"),n.hoverColor){case"neutral":e+=" hover:text-neutral";break;case"tertiary":e+=" hover:text-tertiary";break;case"secondary":e+=" hover:text-secondary";break;case"quaternary":e+=" hover:text-quaternary";break;case"primary":e+=" hover:text-primary";break;case"bright":e+=" hover:text-bright";break;case"none":e+="";break}switch(n.weight){case"light":e+=" font-light";break;case"normal":e+=" font-normal";break;case"medium":e+=" font-medium";break;case"semi-bold":e+=" font-semibold";break;case"bold":e+=" font-bold";break;case"extra-bold":e+=" font-extrabold";break}switch(n.size){case"xs":e+=" text-xs";break;case"sm":e+=" text-sm";break;case"md":e+=" text-md";break;case"lg":e+=" text-lg";break;case"xl":e+=" text-xl";break;case"2xl":e+=" text-2xl";break;case"3xl":e+=" text-3xl";break}return e})}}};function pm(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(r.classes)},l.toDisplayString(t.text),3)}const sn=Le(fm,[["render",pm]]),hm={name:"Breadcrumb",components:{BaseText:sn},props:{items:{type:Array,required:!0,default:()=>[]},onLinkClick:{type:Function,default:()=>{}}}},mm={class:"flex flex-row w-full"};function gm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("router-link");return l.openBlock(),l.createElementBlock("nav",mm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,(c,d)=>(l.openBlock(),l.createElementBlock("div",{key:d,class:"flex flex-row"},[d>0?(l.openBlock(),l.createBlock(a,{key:0,text:" > ",size:"lg",color:"quaternary",class:"mr-2"})):l.createCommentVNode("",!0),c.link?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(a,{key:1,class:"mr-2",text:c.text,size:"lg",color:"quaternary"},null,8,["text"])),c.link?(l.openBlock(),l.createBlock(s,{key:2,to:c.link,onClick:t.onLinkClick,class:"mr-2"},{default:l.withCtx(()=>[l.createVNode(a,{text:c.text,size:"lg",color:"quaternary","hover-color":"bright",class:"underline"},null,8,["text"])]),_:2},1032,["to","onClick"])):l.createCommentVNode("",!0)]))),128))])}const ym=Le(hm,[["render",gm]]),vm={name:"base-button",components:{BaseText:sn,BaseIcon:Ci},props:{label:{type:String,required:!0},iconName:{type:String,default:""},iconStyle:{type:String,default:"fa-solid",validator:n=>["fa-solid","fa-regular","fa-light","fa-thing"].includes(n)},size:{type:String,default:"sm",validator:n=>["xs","sm","md","lg","xl","2xl","3xl","4xl"].includes(n)},type:{type:String,default:"primary",validator:n=>["primary","secondary","tertiary","bright","admin","adminSecondary","iconOnly","editor","square"].includes(n)},selected:{type:Boolean,default:!1}},emits:["click"],setup(n,{emit:e}){const t={primary:"mx-1 p-2 items-center gap-2.5 text-center rounded-md shadow border border-dropdownSelect justify-center hover:bg-tertiary "+(n.selected?"bg-dropdownSelect":"bg-neutral"),secondary:"px-2.5 items-center gap-2.5 text-center my-1 p-3 border-b border-secondary hover:border-b hover:border-neutral w-full rounded-lg flex flex-row justify-center "+(n.selected?"bg-secondary":"bg-primary"),tertiary:"px-2.5 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-primary "+(n.selected?"bg-primary":"bg-tertiary"),bright:"px-2.5 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral "+(n.selected?"bg-primary":"bg-bright"),admin:"px-2.5 py-2 items-center rounded-md gap-2.5 text-center my-1 text-neutral hover:bg-primaryHighlight "+(n.selected,"bg-primary"),adminSecondary:"px-2.5 py-0.5 items-center gap-2.5 text-center my-1 pb-0.5 border-b border-secondary hover:border-b hover:border-neutral w-11/12 text-neutral "+(n.selected,"bg-primary"),iconOnly:"px-0.5 items-center rounded-full text-center text-tertiary shadow border border-dropdownSelect justify-center bg-primaryHighlight",editor:"px-1 items-center rounded-md text-center justify-center hover:bg-tertiary",square:"p-8 my-3 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary "+(n.selected?"bg-dropdownSelect":"bg-neutral")},r={xs:"text-xs",sm:"text-sm",md:"text-md",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl"};return{textColor:l.computed(()=>({primary:"primary",secondary:"neutral",tertiary:"tertiary",bright:"bright",admin:"neutral",adminSecondary:"neutral",iconOnly:"neutral",editor:n.selected?"bright":"quaternary",square:"primary"})[n.type]),classes:l.computed(()=>{let i="inline-flex",o=t[n.type],a=r[n.size];return`${i} ${o} ${a}`}),onClick(){e("click")}}}};function bm(n,e,t,r,i,o){const a=l.resolveComponent("BaseIcon"),s=l.resolveComponent("BaseText");return l.openBlock(),l.createElementBlock("button",{class:l.normalizeClass(r.classes),"data-testid":"base-button",type:"button",onClick:e[0]||(e[0]=(...c)=>r.onClick&&r.onClick(...c))},[t.iconName?(l.openBlock(),l.createBlock(a,{key:0,color:r.textColor,"icon-name":t.iconName,size:t.size,style:l.normalizeStyle(t.iconStyle),"data-testid":"base-icon"},null,8,["color","icon-name","size","style"])):l.createCommentVNode("",!0),l.createVNode(s,{color:r.textColor,size:t.size,text:t.label,"data-testid":"base-text",weight:"normal"},null,8,["color","size","text"])],2)}const Rn=Le(vm,[["render",bm]]),wm={name:"tournament-card-details",components:{BaseButton:Rn,BaseText:sn},props:{detail:{type:Object,required:!0,default:()=>({name:"",date:"",closes:"",location:""})}}},km={class:"flex flex-col w-full pt-4 pb-3 px-3"},xm={class:"mt-4 flex flex-col"},Cm={class:"flex flex-row w-full justify-end"};function Mm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",km,[l.createVNode(a,{text:t.detail.name,color:"primary",size:"xl",weight:"semi-bold"},null,8,["text"]),l.createVNode(a,{text:t.detail.location,color:"primary",size:"sm",weight:"normal"},null,8,["text"]),l.createElementVNode("div",xm,[l.createVNode(a,{text:`${t.detail.date}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"]),l.createVNode(a,{text:`${t.detail.closes}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"])]),l.createElementVNode("div",Cm,[l.createVNode(s,{label:"Edit",class:"mt-2",primary:""})])])}const wc=Le(wm,[["render",Mm]]),kc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAAAAXNSR0IArs4c6QAABdlJREFUeF7t1AEJACAQBEGNaiOzWkDBFgvzCY655+ba5w5HgACBgMA0WIGWRCRA4AsYLI9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBB4p/0F3nyMcxwAAAABJRU5ErkJggg==",Sm={name:"tournament-card-header",components:{BaseTag:bc},props:{artwork:{type:String,required:!0,default:kc},tags:{type:Array,default:()=>[]}},computed:{backgroundStyle(){return`background-image: url('${this.artwork||kc}');`}}},Tm={class:"rounded-t-xl w-full"},Dm={class:"flex flex-row"};function Am(n,e,t,r,i,o){const a=l.resolveComponent("BaseTag");return l.openBlock(),l.createElementBlock("div",Tm,[l.createElementVNode("div",{style:l.normalizeStyle(o.backgroundStyle),class:"h-36 w-full flex flex-col justify-end rounded-t-xl bg-cover bg-no-repeat bg-center"},[l.createElementVNode("div",Dm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.tags,s=>(l.openBlock(),l.createBlock(a,{key:s,label:s},null,8,["label"]))),128))])],4)])}const xc=Le(Sm,[["render",Am]]),Om={name:"DropDownMenu",components:{BaseText:sn},props:{label:{type:String},items:{type:Array,validator:n=>n.every(e=>typeof e.text=="string")},selectedItem:{type:Object,default:()=>({text:""}),validator:n=>typeof n.text=="string"}},data:()=>({isDropDownOpen:!1}),methods:{handleClick(n){this.isDropDownOpen=!1,this.$emit("update:selectedItem",n)},handleDropDown(){this.isDropDownOpen=!this.isDropDownOpen}}},Em={class:"flex flex-row"},Nm=l.createElementVNode("i",{class:"fa-solid fa-chevron-down text-xs"},null,-1),_m={key:0,class:"flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral"},Bm=["onClick"];function Pm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText");return l.openBlock(),l.createElementBlock("div",Em,[l.createElementVNode("span",null,[l.createElementVNode("div",{class:"z-10 rounded-lg shadow px-2 py-2 w-40 flex flex-row justify-between",onClick:e[0]||(e[0]=s=>o.handleDropDown())},[l.createVNode(a,{text:t.label,color:"quaternary",size:"sm",weight:"normal"},null,8,["text"]),l.createVNode(a,{text:t.selectedItem.text,color:"secondary",size:"sm",weight:"normal"},null,8,["text"]),Nm]),n.isDropDownOpen?(l.openBlock(),l.createElementBlock("div",_m,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,s=>(l.openBlock(),l.createElementBlock("a",{key:s.id,onClick:c=>o.handleClick(s),class:"hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0"},[l.createVNode(a,{text:s.text,color:"primary",size:"xs",weight:"normal"},null,8,["text"])],8,Bm))),128))])):l.createCommentVNode("",!0)])])}const _a=Le(Om,[["render",Pm]]),Im={name:"FilterAndSortBar",components:{DropDownMenu:_a,BaseInput:Mi},props:{label:{type:String},items:{type:Array,default:()=>[]},selectedItem:null},data(){return{filterText:"",localSelectedItem:this.selectedItem}},methods:{handleFilter(n){this.$emit("filterbar",n)},handleSelectedItem(n){this.$emit("sort",n),this.localSelectedItem=n}}},Rm={class:"flex flex-row w-full justify-between"},Vm={class:"rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4"},$m=l.createElementVNode("i",{class:"fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1"},null,-1);function Lm(n,e,t,r,i,o){const a=l.resolveComponent("BaseInput"),s=l.resolveComponent("DropDownMenu");return l.openBlock(),l.createElementBlock("section",Rm,[l.createElementVNode("div",Vm,[$m,l.createVNode(a,{placeholder:"Search on Name, Location, or Date",class:"text-quaternary w-full",addBorder:!1,value:i.filterText,"onUpdate:value":o.handleFilter},null,8,["value","onUpdate:value"])]),l.createElementVNode("div",null,[l.createVNode(s,{label:t.label,items:t.items,selectedItem:i.localSelectedItem,"onUpdate:selectedItem":o.handleSelectedItem},null,8,["label","items","selectedItem","onUpdate:selectedItem"])])])}const Cc=Le(Im,[["render",Lm]]),Fm={name:"FilterUpcomingPast",components:{BaseText:sn,BaseButton:Rn,DropDownMenu:_a,BaseInput:Mi},props:{selected:{type:String,default:"All"}},data(){return{localSelected:this.selected}},methods:{handleTimeFrame(n){this.$emit("timeFrame",n),this.localSelected=n}}},zm={class:"flex flex-row w-full justify-between"},Hm={class:"rounded-lg w-3/4"},Ym={class:"flex flex-row h-8 w-1/4 justify-end"};function jm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("section",zm,[l.createElementVNode("div",Hm,[l.createVNode(a,{text:"Tournament",color:"primary",size:"2xl",weight:"normal"})]),l.createElementVNode("div",Ym,[l.createVNode(s,{label:"All",color:"primary",size:"sm",selected:i.localSelected==="All",onClick:e[0]||(e[0]=c=>o.handleTimeFrame("ALL"))},null,8,["selected"]),l.createVNode(s,{label:"Upcoming",color:"primary",size:"sm",selected:i.localSelected==="Upcoming",onClick:e[1]||(e[1]=c=>o.handleTimeFrame("Upcoming"))},null,8,["selected"]),l.createVNode(s,{label:"Past",color:"primary",size:"sm",selected:i.localSelected==="Past",onClick:e[2]||(e[2]=c=>o.handleTimeFrame("Past"))},null,8,["selected"])])])}const Mc=Le(Fm,[["render",jm]]),Um={name:"BaseModal",components:{BaseButton:Rn,BaseIcon:Ci,BaseText:sn},props:{show:{type:Boolean,default:!1},iconName:{type:String,default:"fa-check-circle"},iconColor:{type:String,default:"accepted"},iconBackgroundColor:{type:String,default:"acceptedHighlight"},iconBorderColor:{type:String,default:"acceptedBorder"},headerText:{type:String,default:"Default Header"},bodyText:{type:String,default:"Default Body Text"},buttonText:{type:String,default:"Button Text"}},emits:["update:show"],methods:{close(){this.$emit("update:show",!1)}}},Wm={class:"relative top-20 mx-auto p-5 border w-96 shadow-lg rounded-md bg-neutral"},qm={class:"mt-3 text-center w-full"},Km={class:"w-full flex flex-row justify-center"},Gm={class:"mt-4"};function Qm(n,e,t,r,i,o){const a=l.resolveComponent("BaseIcon"),s=l.resolveComponent("BaseText"),c=l.resolveComponent("BaseButton");return t.show?(l.openBlock(),l.createElementBlock("div",{key:0,class:"fixed inset-0 bg-secondary bg-opacity-50 overflow-y-auto h-full w-full",onClick:e[0]||(e[0]=(...d)=>o.close&&o.close(...d))},[l.createElementVNode("div",Wm,[l.createElementVNode("div",qm,[l.createElementVNode("div",Km,[l.createElementVNode("p",{class:l.normalizeClass(["bg-"+t.iconBackgroundColor,"flex flex-row justify-center h-20 w-20 rounded-full","border border-"+t.iconBorderColor])},[l.createVNode(a,{"icon-name":t.iconName,iconStyle:"fa-solid",size:"4xl",color:t.iconColor,class:"mb-3 mt-5","data-testid":"base-icon"},null,8,["icon-name","color"])],2)]),l.createVNode(s,{text:t.headerText,size:"2xl",weight:"bold",color:"secondary",class:"m-3","data-testid":"text-title"},null,8,["text"]),l.createVNode(s,{text:t.bodyText,size:"sm",weight:"normal",color:"primaryHighlight",class:"mb-3","data-testid":"text-title"},null,8,["text"]),l.createElementVNode("div",Gm,[l.createVNode(c,{label:t.buttonText,size:"sm",type:"secondary",selected:!0,onClick:o.close,color:"neutral",class:"w-full","data-testid":"base-button"},null,8,["label","onClick"])])])])])):l.createCommentVNode("",!0)}const Jm=Le(Um,[["render",Qm]]),Sc={subpremise:"short_name",street_number:"short_name",route:"long_name",locality:"long_name",administrative_area_level_1:"short_name",administrative_area_level_2:"long_name",country:"long_name",postal_code:"short_name"},Xm=["locality","administrative_area_level_3"],Zm=["locality","sublocality","postal_code","country","administrative_area_level_1","administrative_area_level_2"],eg=["address_components","adr_address","alt_id","formatted_address","geometry","icon","id","name","business_status","photo","place_id","scope","type","url","utc_offset_minutes","vicinity"],tg={name:"VueGoogleAutocomplete",props:{id:{type:String,required:!0},classname:String,placeholder:{type:String,default:"Start typing"},disabled:{type:Boolean,default:!1},types:{type:String,default:"address"},fields:{type:Array,default:function(){return eg}},country:{type:[String,Array],default:null},enableGeolocation:{type:Boolean,default:!1},geolocationOptions:{type:Object,default:null}},data(){return{autocomplete:null,autocompleteText:"",geolocation:{geocoder:null,loc:null,position:null}}},watch:{autocompleteText:function(n,e){this.$emit("inputChange",{newVal:n,oldVal:e},this.id)},country:function(n,e){this.autocomplete.setComponentRestrictions({country:this.country===null?[]:this.country})}},mounted:function(){const n={};this.types&&(n.types=[this.types]),this.country&&(n.componentRestrictions={country:this.country}),this.autocomplete=new google.maps.places.Autocomplete(document.getElementById(this.id),n),this.autocomplete.setFields(this.fields),this.autocomplete.addListener("place_changed",this.onPlaceChanged)},methods:{onPlaceChanged(){let n=this.autocomplete.getPlace();if(!n.geometry){this.$emit("no-results-found",n,this.id);return}n.address_components!==void 0&&(this.$emit("placechanged",this.formatResult(n),n,this.id),this.autocompleteText=document.getElementById(this.id).value,this.onChange())},onFocus(){this.biasAutocompleteLocation(),this.$emit("focus")},onBlur(){this.$emit("blur")},onChange(){this.$emit("change",this.autocompleteText)},onKeyPress(n){this.$emit("keypress",n)},onKeyUp(n){this.$emit("keyup",n)},clear(){this.autocompleteText=""},focus(){this.$refs.autocomplete.focus()},blur(){this.$refs.autocomplete.blur()},update(n){this.autocompleteText=n},updateCoordinates(n){!n&&!(n.lat||n.lng)||(this.geolocation.geocoder||(this.geolocation.geocoder=new google.maps.Geocoder),this.geolocation.geocoder.geocode({location:n},(e,t)=>{t==="OK"?(e=this.filterGeocodeResultTypes(e),e[0]?(this.$emit("placechanged",this.formatResult(e[0]),e[0],this.id),this.update(e[0].formatted_address)):this.$emit("error","no result for provided coordinates")):this.$emit("error","error getting address from coords")}))},geolocate(){this.updateGeolocation((n,e)=>{this.updateCoordinates(n)})},updateGeolocation(n=null){if(navigator.geolocation){let e={};this.geolocationOptions&&Object.assign(e,this.geolocationOptions),navigator.geolocation.getCurrentPosition(t=>{let r={lat:t.coords.latitude,lng:t.coords.longitude};this.geolocation.loc=r,this.geolocation.position=t,n&&n(r,t)},t=>{this.$emit("error","Cannot get Coordinates from navigator",t)},e)}},biasAutocompleteLocation(){this.enableGeolocation&&this.updateGeolocation((n,e)=>{let t=new google.maps.Circle({center:n,radius:e.coords.accuracy});this.autocomplete.setBounds(t.getBounds())})},formatResult(n){let e={};for(let t=0;t<n.address_components.length;t++){let r=n.address_components[t].types[0];if(Sc[r]){let i=n.address_components[t][Sc[r]];e[r]=i}}return e.latitude=n.geometry.location.lat(),e.longitude=n.geometry.location.lng(),e},filterGeocodeResultTypes(n){if(!n||!this.types)return n;let e=[],t=[this.types];t.includes("(cities)")&&(t=t.concat(Xm)),t.includes("(regions)")&&(t=t.concat(Zm));for(let r of n)for(let i of r.types)if(t.includes(i)){e.push(r);break}return e}}},ng=["id","placeholder","disabled"];function rg(n,e,t,r,i,o){return l.withDirectives((l.openBlock(),l.createElementBlock("input",{ref:"autocomplete",type:"text",class:l.normalizeClass(t.classname),id:t.id,placeholder:t.placeholder,disabled:t.disabled,"onUpdate:modelValue":e[0]||(e[0]=a=>i.autocompleteText=a),onFocus:e[1]||(e[1]=a=>o.onFocus()),onBlur:e[2]||(e[2]=a=>o.onBlur()),onChange:e[3]||(e[3]=(...a)=>o.onChange&&o.onChange(...a)),onKeypress:e[4]||(e[4]=(...a)=>o.onKeyPress&&o.onKeyPress(...a)),onKeyup:e[5]||(e[5]=(...a)=>o.onKeyUp&&o.onKeyUp(...a))},null,42,ng)),[[l.vModelText,i.autocompleteText]])}const ig={components:{VueGoogleAutocomplete:Le(tg,[["render",rg]])},props:{invalid:{type:Boolean,default:!1}},data(){return{address:"",coordinates:""}},methods:{getAddressData(n){const e=`${n.street_number} ${n.route}`,t=n.locality,r=n.administrative_area_level_1;this.address=`${e}, ${t}, ${r}`,this.coordinates=`${n.latitude},${n.longitude}`;const i={address:this.address,coordinates:this.coordinates};this.$emit("update:address",i)}}};function og(n,e,t,r,i,o){const a=l.resolveComponent("vue-google-autocomplete");return l.openBlock(),l.createBlock(a,{class:l.normalizeClass(["border rounded-lg text-secondary text-xs p-2 w-full appearance-none focus:outline-none",t.invalid?"border-alarm":"border-dropdownSelect"]),id:"map",ref:"address",modelValue:i.address,"onUpdate:modelValue":e[0]||(e[0]=s=>i.address=s),placeholder:"Venue Address",onPlacechanged:o.getAddressData},null,8,["class","modelValue","onPlacechanged"])}const Tc=Le(ig,[["render",og]]);function It(n){"@babel/helpers - typeof";return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(n)}function pe(n){if(n===null||n===!0||n===!1)return NaN;var e=Number(n);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function se(n,e){if(e.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+e.length+" present")}function de(n){se(1,arguments);var e=Object.prototype.toString.call(n);return n instanceof Date||It(n)==="object"&&e==="[object Date]"?new Date(n.getTime()):typeof n=="number"||e==="[object Number]"?new Date(n):((typeof n=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Tn(n,e){se(2,arguments);var t=de(n),r=pe(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function Wt(n,e){se(2,arguments);var t=de(n),r=pe(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var i=t.getDate(),o=new Date(t.getTime());o.setMonth(t.getMonth()+r+1,0);var a=o.getDate();return i>=a?o:(t.setFullYear(o.getFullYear(),o.getMonth(),i),t)}function Dc(n,e){if(se(2,arguments),!e||It(e)!=="object")return new Date(NaN);var t=e.years?pe(e.years):0,r=e.months?pe(e.months):0,i=e.weeks?pe(e.weeks):0,o=e.days?pe(e.days):0,a=e.hours?pe(e.hours):0,s=e.minutes?pe(e.minutes):0,c=e.seconds?pe(e.seconds):0,d=de(n),u=r||t?Wt(d,r+t*12):d,f=o||i?Tn(u,o+i*7):u,p=s+a*60,h=c+p*60,m=h*1e3,v=new Date(f.getTime()+m);return v}function ag(n,e){se(2,arguments);var t=de(n).getTime(),r=pe(e);return new Date(t+r)}var sg={};function ln(){return sg}function ur(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=ln(),f=pe((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=de(n),h=p.getDay(),m=(h<f?7:0)+h-f;return p.setDate(p.getDate()-m),p.setHours(0,0,0,0),p}function ko(n){return se(1,arguments),ur(n,{weekStartsOn:1})}function lg(n){se(1,arguments);var e=de(n),t=e.getFullYear(),r=new Date(0);r.setFullYear(t+1,0,4),r.setHours(0,0,0,0);var i=ko(r),o=new Date(0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);var a=ko(o);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}function cg(n){se(1,arguments);var e=lg(n),t=new Date(0);t.setFullYear(e,0,4),t.setHours(0,0,0,0);var r=ko(t);return r}function xo(n){var e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),n.getTime()-e.getTime()}function Ac(n){se(1,arguments);var e=de(n);return e.setHours(0,0,0,0),e}var dg=864e5;function ug(n,e){se(2,arguments);var t=Ac(n),r=Ac(e),i=t.getTime()-xo(t),o=r.getTime()-xo(r);return Math.round((i-o)/dg)}function fg(n,e){se(2,arguments);var t=pe(e),r=t*3;return Wt(n,r)}function Ba(n,e){se(2,arguments);var t=pe(e);return Wt(n,t*12)}var Pa=6e4,Ia=36e5,pg=1e3;function Oc(n){return se(1,arguments),n instanceof Date||It(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Si(n){if(se(1,arguments),!Oc(n)&&typeof n!="number")return!1;var e=de(n);return!isNaN(Number(e))}function Ec(n){se(1,arguments);var e=de(n),t=Math.floor(e.getMonth()/3)+1;return t}function Nc(n,e){var t;se(1,arguments);var r=n||{},i=de(r.start),o=de(r.end),a=o.getTime();if(!(i.getTime()<=a))throw new RangeError("Invalid interval");var s=[],c=i;c.setHours(0,0,0,0);var d=Number((t=e==null?void 0:e.step)!==null&&t!==void 0?t:1);if(d<1||isNaN(d))throw new RangeError("`options.step` must be a number greater than 1");for(;c.getTime()<=a;)s.push(de(c)),c.setDate(c.getDate()+d),c.setHours(0,0,0,0);return s}function Ti(n){se(1,arguments);var e=de(n),t=e.getMonth(),r=t-t%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function hg(n){se(1,arguments);var e=n||{},t=de(e.start),r=de(e.end),i=r.getTime();if(!(t.getTime()<=i))throw new RangeError("Invalid interval");var o=Ti(t),a=Ti(r);i=a.getTime();for(var s=[],c=o;c.getTime()<=i;)s.push(de(c)),c=fg(c,1);return s}function mg(n){se(1,arguments);var e=de(n),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function gg(n){se(1,arguments);var e=de(n),t=new Date(0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function yg(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=ln(),f=pe((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=de(n),h=p.getDay(),m=(h<f?-7:0)+6-(h-f);return p.setDate(p.getDate()+m),p.setHours(23,59,59,999),p}function _c(n){se(1,arguments);var e=de(n),t=e.getMonth(),r=t-t%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function Bc(n,e){se(2,arguments);var t=pe(e);return ag(n,-t)}var vg=864e5;function bg(n){se(1,arguments);var e=de(n),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=t-r;return Math.floor(i/vg)+1}function $r(n){se(1,arguments);var e=1,t=de(n),r=t.getUTCDay(),i=(r<e?7:0)+r-e;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}function Pc(n){se(1,arguments);var e=de(n),t=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(t+1,0,4),r.setUTCHours(0,0,0,0);var i=$r(r),o=new Date(0);o.setUTCFullYear(t,0,4),o.setUTCHours(0,0,0,0);var a=$r(o);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}function wg(n){se(1,arguments);var e=Pc(n),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var r=$r(t);return r}var kg=6048e5;function Ic(n){se(1,arguments);var e=de(n),t=$r(e).getTime()-wg(e).getTime();return Math.round(t/kg)+1}function fr(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=ln(),f=pe((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=de(n),h=p.getUTCDay(),m=(h<f?7:0)+h-f;return p.setUTCDate(p.getUTCDate()-m),p.setUTCHours(0,0,0,0),p}function Ra(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=de(n),f=u.getUTCFullYear(),p=ln(),h=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&r!==void 0?r:(c=p.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(f+1,0,h),m.setUTCHours(0,0,0,0);var v=fr(m,e),w=new Date(0);w.setUTCFullYear(f,0,h),w.setUTCHours(0,0,0,0);var x=fr(w,e);return u.getTime()>=v.getTime()?f+1:u.getTime()>=x.getTime()?f:f-1}function xg(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=ln(),f=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),p=Ra(n,e),h=new Date(0);h.setUTCFullYear(p,0,f),h.setUTCHours(0,0,0,0);var m=fr(h,e);return m}var Cg=6048e5;function Rc(n,e){se(1,arguments);var t=de(n),r=fr(t,e).getTime()-xg(t,e).getTime();return Math.round(r/Cg)+1}function Ne(n,e){for(var t=n<0?"-":"",r=Math.abs(n).toString();r.length<e;)r="0"+r;return t+r}var Mg={y:function(e,t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return Ne(t==="yy"?i%100:i,t.length)},M:function(e,t){var r=e.getUTCMonth();return t==="M"?String(r+1):Ne(r+1,2)},d:function(e,t){return Ne(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,t){return Ne(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Ne(e.getUTCHours(),t.length)},m:function(e,t){return Ne(e.getUTCMinutes(),t.length)},s:function(e,t){return Ne(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,i=e.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return Ne(o,t.length)}};const Vn=Mg;var Lr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sg={G:function(e,t,r){var i=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){var i=e.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return Vn.y(e,t)},Y:function(e,t,r,i){var o=Ra(e,i),a=o>0?o:1-o;if(t==="YY"){var s=a%100;return Ne(s,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):Ne(a,t.length)},R:function(e,t){var r=Pc(e);return Ne(r,t.length)},u:function(e,t){var r=e.getUTCFullYear();return Ne(r,t.length)},Q:function(e,t,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ne(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ne(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,r){var i=e.getUTCMonth();switch(t){case"M":case"MM":return Vn.M(e,t);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,r){var i=e.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return Ne(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,r,i){var o=Rc(e,i);return t==="wo"?r.ordinalNumber(o,{unit:"week"}):Ne(o,t.length)},I:function(e,t,r){var i=Ic(e);return t==="Io"?r.ordinalNumber(i,{unit:"week"}):Ne(i,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):Vn.d(e,t)},D:function(e,t,r){var i=bg(e);return t==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Ne(i,t.length)},E:function(e,t,r){var i=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Ne(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Ne(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){var i=e.getUTCDay(),o=i===0?7:i;switch(t){case"i":return String(o);case"ii":return Ne(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,r){var i=e.getUTCHours(),o=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,r){var i=e.getUTCHours(),o;switch(i===12?o=Lr.noon:i===0?o=Lr.midnight:o=i/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){var i=e.getUTCHours(),o;switch(i>=17?o=Lr.evening:i>=12?o=Lr.afternoon:i>=4?o=Lr.morning:o=Lr.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return Vn.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Vn.H(e,t)},K:function(e,t,r){var i=e.getUTCHours()%12;return t==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Ne(i,t.length)},k:function(e,t,r){var i=e.getUTCHours();return i===0&&(i=24),t==="ko"?r.ordinalNumber(i,{unit:"hour"}):Ne(i,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Vn.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Vn.s(e,t)},S:function(e,t){return Vn.S(e,t)},X:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return $c(a);case"XXXX":case"XX":return pr(a);case"XXXXX":case"XXX":default:return pr(a,":")}},x:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"x":return $c(a);case"xxxx":case"xx":return pr(a);case"xxxxx":case"xxx":default:return pr(a,":")}},O:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vc(a,":");case"OOOO":default:return"GMT"+pr(a,":")}},z:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vc(a,":");case"zzzz":default:return"GMT"+pr(a,":")}},t:function(e,t,r,i){var o=i._originalDate||e,a=Math.floor(o.getTime()/1e3);return Ne(a,t.length)},T:function(e,t,r,i){var o=i._originalDate||e,a=o.getTime();return Ne(a,t.length)}};function Vc(n,e){var t=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),o=r%60;if(o===0)return t+String(i);var a=e||"";return t+String(i)+a+Ne(o,2)}function $c(n,e){if(n%60===0){var t=n>0?"-":"+";return t+Ne(Math.abs(n)/60,2)}return pr(n,e)}function pr(n,e){var t=e||"",r=n>0?"-":"+",i=Math.abs(n),o=Ne(Math.floor(i/60),2),a=Ne(i%60,2);return r+o+t+a}const Tg=Sg;var Lc=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Fc=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Dg=function(e,t){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return Lc(e,t);var a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",Lc(i,t)).replace("{{time}}",Fc(o,t))},Ag={p:Fc,P:Dg};const Va=Ag;var Og=["D","DD"],Eg=["YY","YYYY"];function zc(n){return Og.indexOf(n)!==-1}function Hc(n){return Eg.indexOf(n)!==-1}function Co(n,e,t){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Ng={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},_g=function(e,t,r){var i,o=Ng[e];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const Bg=_g;function $a(n){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):n.defaultWidth,r=n.formats[t]||n.formats[n.defaultWidth];return r}}var Pg={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ig={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Rg={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Vg={date:$a({formats:Pg,defaultWidth:"full"}),time:$a({formats:Ig,defaultWidth:"full"}),dateTime:$a({formats:Rg,defaultWidth:"full"})};const $g=Vg;var Lg={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Fg=function(e,t,r,i){return Lg[e]};const zg=Fg;function Di(n){return function(e,t){var r=t!=null&&t.context?String(t.context):"standalone",i;if(r==="formatting"&&n.formattingValues){var o=n.defaultFormattingWidth||n.defaultWidth,a=t!=null&&t.width?String(t.width):o;i=n.formattingValues[a]||n.formattingValues[o]}else{var s=n.defaultWidth,c=t!=null&&t.width?String(t.width):n.defaultWidth;i=n.values[c]||n.values[s]}var d=n.argumentCallback?n.argumentCallback(e):e;return i[d]}}var Hg={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Yg={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},jg={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ug={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Wg={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},qg={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Kg=function(e,t){var r=Number(e),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Gg={ordinalNumber:Kg,era:Di({values:Hg,defaultWidth:"wide"}),quarter:Di({values:Yg,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Di({values:jg,defaultWidth:"wide"}),day:Di({values:Ug,defaultWidth:"wide"}),dayPeriod:Di({values:Wg,defaultWidth:"wide",formattingValues:qg,defaultFormattingWidth:"wide"})};const Qg=Gg;function Ai(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,i=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],o=e.match(i);if(!o)return null;var a=o[0],s=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(s)?Xg(s,function(f){return f.test(a)}):Jg(s,function(f){return f.test(a)}),d;d=n.valueCallback?n.valueCallback(c):c,d=t.valueCallback?t.valueCallback(d):d;var u=e.slice(a.length);return{value:d,rest:u}}}function Jg(n,e){for(var t in n)if(n.hasOwnProperty(t)&&e(n[t]))return t}function Xg(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return t}function Zg(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(n.matchPattern);if(!r)return null;var i=r[0],o=e.match(n.parsePattern);if(!o)return null;var a=n.valueCallback?n.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;var s=e.slice(i.length);return{value:a,rest:s}}}var ey=/^(\d+)(th|st|nd|rd)?/i,ty=/\d+/i,ny={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ry={any:[/^b/i,/^(a|c)/i]},iy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},oy={any:[/1/i,/2/i,/3/i,/4/i]},ay={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},sy={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ly={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cy={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},dy={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},uy={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fy={ordinalNumber:Zg({matchPattern:ey,parsePattern:ty,valueCallback:function(e){return parseInt(e,10)}}),era:Ai({matchPatterns:ny,defaultMatchWidth:"wide",parsePatterns:ry,defaultParseWidth:"any"}),quarter:Ai({matchPatterns:iy,defaultMatchWidth:"wide",parsePatterns:oy,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Ai({matchPatterns:ay,defaultMatchWidth:"wide",parsePatterns:sy,defaultParseWidth:"any"}),day:Ai({matchPatterns:ly,defaultMatchWidth:"wide",parsePatterns:cy,defaultParseWidth:"any"}),dayPeriod:Ai({matchPatterns:dy,defaultMatchWidth:"any",parsePatterns:uy,defaultParseWidth:"any"})},py={code:"en-US",formatDistance:Bg,formatLong:$g,formatRelative:zg,localize:Qg,match:fy,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Yc=py;var hy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,my=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gy=/^'([^]*?)'?$/,yy=/''/g,vy=/[a-zA-Z]/;function $n(n,e,t){var r,i,o,a,s,c,d,u,f,p,h,m,v,w,x,C,N,y;se(2,arguments);var _=String(e),k=ln(),E=(r=(i=t==null?void 0:t.locale)!==null&&i!==void 0?i:k.locale)!==null&&r!==void 0?r:Yc,j=pe((o=(a=(s=(c=t==null?void 0:t.firstWeekContainsDate)!==null&&c!==void 0?c:t==null||(d=t.locale)===null||d===void 0||(u=d.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&s!==void 0?s:k.firstWeekContainsDate)!==null&&a!==void 0?a:(f=k.locale)===null||f===void 0||(p=f.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(j>=1&&j<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var I=pe((h=(m=(v=(w=t==null?void 0:t.weekStartsOn)!==null&&w!==void 0?w:t==null||(x=t.locale)===null||x===void 0||(C=x.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&v!==void 0?v:k.weekStartsOn)!==null&&m!==void 0?m:(N=k.locale)===null||N===void 0||(y=N.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&h!==void 0?h:0);if(!(I>=0&&I<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var M=de(n);if(!Si(M))throw new RangeError("Invalid time value");var B=xo(M),H=Bc(M,B),W={firstWeekContainsDate:j,weekStartsOn:I,locale:E,_originalDate:M},L=_.match(my).map(function(T){var R=T[0];if(R==="p"||R==="P"){var $=Va[R];return $(T,E.formatLong)}return T}).join("").match(hy).map(function(T){if(T==="''")return"'";var R=T[0];if(R==="'")return by(T);var $=Tg[R];if($)return!(t!=null&&t.useAdditionalWeekYearTokens)&&Hc(T)&&Co(T,e,String(n)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&zc(T)&&Co(T,e,String(n)),$(H,T,E.localize,W);if(R.match(vy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+R+"`");return T}).join("");return L}function by(n){var e=n.match(gy);return e?e[1].replace(yy,"'"):n}function wy(n,e){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}function ky(n){se(1,arguments);var e=de(n),t=e.getDay();return t}function xy(n){se(1,arguments);var e=de(n),t=e.getFullYear(),r=e.getMonth(),i=new Date(0);return i.setFullYear(t,r+1,0),i.setHours(0,0,0,0),i.getDate()}function qt(n){se(1,arguments);var e=de(n),t=e.getHours();return t}var Cy=6048e5;function My(n){se(1,arguments);var e=de(n),t=ko(e).getTime()-cg(e).getTime();return Math.round(t/Cy)+1}function cn(n){se(1,arguments);var e=de(n),t=e.getMinutes();return t}function Se(n){se(1,arguments);var e=de(n),t=e.getMonth();return t}function Fr(n){se(1,arguments);var e=de(n),t=e.getSeconds();return t}function Sy(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=de(n),f=u.getFullYear(),p=ln(),h=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:p.firstWeekContainsDate)!==null&&r!==void 0?r:(c=p.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setFullYear(f+1,0,h),m.setHours(0,0,0,0);var v=ur(m,e),w=new Date(0);w.setFullYear(f,0,h),w.setHours(0,0,0,0);var x=ur(w,e);return u.getTime()>=v.getTime()?f+1:u.getTime()>=x.getTime()?f:f-1}function Ty(n,e){var t,r,i,o,a,s,c,d;se(1,arguments);var u=ln(),f=pe((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),p=Sy(n,e),h=new Date(0);h.setFullYear(p,0,f),h.setHours(0,0,0,0);var m=ur(h,e);return m}var Dy=6048e5;function Ay(n,e){se(1,arguments);var t=de(n),r=ur(t,e).getTime()-Ty(t,e).getTime();return Math.round(r/Dy)+1}function be(n){return se(1,arguments),de(n).getFullYear()}function Oi(n,e){se(2,arguments);var t=de(n),r=de(e);return t.getTime()>r.getTime()}function Ei(n,e){se(2,arguments);var t=de(n),r=de(e);return t.getTime()<r.getTime()}function zr(n,e){se(2,arguments);var t=de(n),r=de(e);return t.getTime()===r.getTime()}function jc(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function Uc(n,e){if(n){if(typeof n=="string")return jc(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jc(n,e)}}function Wc(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Uc(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(d){throw d},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){t=t.call(n)},n:function(){var d=t.next();return o=d.done,d},e:function(d){a=!0,s=d},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(a)throw s}}}}function ae(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function La(n,e){return La=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},La(n,e)}function Te(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&La(n,e)}function Mo(n){return Mo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Mo(n)}function Oy(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ey(n,e){if(e&&(It(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ae(n)}function De(n){var e=Oy();return function(){var r=Mo(n),i;if(e){var o=Mo(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return Ey(this,i)}}function Ce(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Ny(n,e){if(It(n)!=="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(It(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function qc(n){var e=Ny(n,"string");return It(e)==="symbol"?e:String(e)}function Kc(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,qc(r.key),r)}}function Me(n,e,t){return e&&Kc(n.prototype,e),t&&Kc(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function re(n,e,t){return e=qc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var _y=10,Gc=function(){function n(){Ce(this,n),re(this,"priority",void 0),re(this,"subPriority",0)}return Me(n,[{key:"validate",value:function(t,r){return!0}}]),n}(),By=function(n){Te(t,n);var e=De(t);function t(r,i,o,a,s){var c;return Ce(this,t),c=e.call(this),c.value=r,c.validateValue=i,c.setValue=o,c.priority=a,s&&(c.subPriority=s),c}return Me(t,[{key:"validate",value:function(i,o){return this.validateValue(i,this.value,o)}},{key:"set",value:function(i,o,a){return this.setValue(i,o,this.value,a)}}]),t}(Gc),Py=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",_y),re(ae(r),"subPriority",-1),r}return Me(t,[{key:"set",value:function(i,o){if(o.timestampIsSet)return i;var a=new Date(0);return a.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),a.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),a}}]),t}(Gc),Oe=function(){function n(){Ce(this,n),re(this,"incompatibleTokens",void 0),re(this,"priority",void 0),re(this,"subPriority",void 0)}return Me(n,[{key:"run",value:function(t,r,i,o){var a=this.parse(t,r,i,o);return a?{setter:new By(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}},{key:"validate",value:function(t,r,i){return!0}}]),n}(),Iy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",140),re(ae(r),"incompatibleTokens",["R","u","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"G":case"GG":case"GGG":return a.era(i,{width:"abbreviated"})||a.era(i,{width:"narrow"});case"GGGGG":return a.era(i,{width:"narrow"});case"GGGG":default:return a.era(i,{width:"wide"})||a.era(i,{width:"abbreviated"})||a.era(i,{width:"narrow"})}}},{key:"set",value:function(i,o,a){return o.era=a,i.setUTCFullYear(a,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(Oe),Ye={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},dn={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function je(n,e){return n&&{value:e(n.value),rest:n.rest}}function Fe(n,e){var t=e.match(n);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function un(n,e){var t=e.match(n);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};var r=t[1]==="+"?1:-1,i=t[2]?parseInt(t[2],10):0,o=t[3]?parseInt(t[3],10):0,a=t[5]?parseInt(t[5],10):0;return{value:r*(i*Ia+o*Pa+a*pg),rest:e.slice(t[0].length)}}function Qc(n){return Fe(Ye.anyDigitsSigned,n)}function ze(n,e){switch(n){case 1:return Fe(Ye.singleDigit,e);case 2:return Fe(Ye.twoDigits,e);case 3:return Fe(Ye.threeDigits,e);case 4:return Fe(Ye.fourDigits,e);default:return Fe(new RegExp("^\\d{1,"+n+"}"),e)}}function So(n,e){switch(n){case 1:return Fe(Ye.singleDigitSigned,e);case 2:return Fe(Ye.twoDigitsSigned,e);case 3:return Fe(Ye.threeDigitsSigned,e);case 4:return Fe(Ye.fourDigitsSigned,e);default:return Fe(new RegExp("^-?\\d{1,"+n+"}"),e)}}function Fa(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Jc(n,e){var t=e>0,r=t?e:1-e,i;if(r<=50)i=n||100;else{var o=r+50,a=Math.floor(o/100)*100,s=n>=o%100;i=n+a-(s?100:0)}return t?i:1-i}function Xc(n){return n%400===0||n%4===0&&n%100!==0}var Ry=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",130),re(ae(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){var s=function(d){return{year:d,isTwoDigitYear:o==="yy"}};switch(o){case"y":return je(ze(4,i),s);case"yo":return je(a.ordinalNumber(i,{unit:"year"}),s);default:return je(ze(o.length,i),s)}}},{key:"validate",value:function(i,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(i,o,a){var s=i.getUTCFullYear();if(a.isTwoDigitYear){var c=Jc(a.year,s);return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}var d=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(d,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(Oe),Vy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",130),re(ae(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){var s=function(d){return{year:d,isTwoDigitYear:o==="YY"}};switch(o){case"Y":return je(ze(4,i),s);case"Yo":return je(a.ordinalNumber(i,{unit:"year"}),s);default:return je(ze(o.length,i),s)}}},{key:"validate",value:function(i,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(i,o,a,s){var c=Ra(i,s);if(a.isTwoDigitYear){var d=Jc(a.year,c);return i.setUTCFullYear(d,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),fr(i,s)}var u=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(u,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),fr(i,s)}}]),t}(Oe),$y=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",130),re(ae(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o){return So(o==="R"?4:o.length,i)}},{key:"set",value:function(i,o,a){var s=new Date(0);return s.setUTCFullYear(a,0,4),s.setUTCHours(0,0,0,0),$r(s)}}]),t}(Oe),Ly=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",130),re(ae(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o){return So(o==="u"?4:o.length,i)}},{key:"set",value:function(i,o,a){return i.setUTCFullYear(a,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(Oe),Fy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",120),re(ae(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"Q":case"QQ":return ze(o.length,i);case"Qo":return a.ordinalNumber(i,{unit:"quarter"});case"QQQ":return a.quarter(i,{width:"abbreviated",context:"formatting"})||a.quarter(i,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(i,{width:"wide",context:"formatting"})||a.quarter(i,{width:"abbreviated",context:"formatting"})||a.quarter(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),t}(Oe),zy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",120),re(ae(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"q":case"qq":return ze(o.length,i);case"qo":return a.ordinalNumber(i,{unit:"quarter"});case"qqq":return a.quarter(i,{width:"abbreviated",context:"standalone"})||a.quarter(i,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(i,{width:"wide",context:"standalone"})||a.quarter(i,{width:"abbreviated",context:"standalone"})||a.quarter(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),t}(Oe),Hy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),re(ae(r),"priority",110),r}return Me(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d-1};switch(o){case"M":return je(Fe(Ye.month,i),s);case"MM":return je(ze(2,i),s);case"Mo":return je(a.ordinalNumber(i,{unit:"month"}),s);case"MMM":return a.month(i,{width:"abbreviated",context:"formatting"})||a.month(i,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(i,{width:"wide",context:"formatting"})||a.month(i,{width:"abbreviated",context:"formatting"})||a.month(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),t}(Oe),Yy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",110),re(ae(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d-1};switch(o){case"L":return je(Fe(Ye.month,i),s);case"LL":return je(ze(2,i),s);case"Lo":return je(a.ordinalNumber(i,{unit:"month"}),s);case"LLL":return a.month(i,{width:"abbreviated",context:"standalone"})||a.month(i,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(i,{width:"wide",context:"standalone"})||a.month(i,{width:"abbreviated",context:"standalone"})||a.month(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),t}(Oe);function jy(n,e,t){se(2,arguments);var r=de(n),i=pe(e),o=Rc(r,t)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var Uy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",100),re(ae(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"w":return Fe(Ye.week,i);case"wo":return a.ordinalNumber(i,{unit:"week"});default:return ze(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=53}},{key:"set",value:function(i,o,a,s){return fr(jy(i,a,s),s)}}]),t}(Oe);function Wy(n,e){se(2,arguments);var t=de(n),r=pe(e),i=Ic(t)-r;return t.setUTCDate(t.getUTCDate()-i*7),t}var qy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",100),re(ae(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"I":return Fe(Ye.week,i);case"Io":return a.ordinalNumber(i,{unit:"week"});default:return ze(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=53}},{key:"set",value:function(i,o,a){return $r(Wy(i,a))}}]),t}(Oe),Ky=[31,28,31,30,31,30,31,31,30,31,30,31],Gy=[31,29,31,30,31,30,31,31,30,31,30,31],Qy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",90),re(ae(r),"subPriority",1),re(ae(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"d":return Fe(Ye.date,i);case"do":return a.ordinalNumber(i,{unit:"date"});default:return ze(o.length,i)}}},{key:"validate",value:function(i,o){var a=i.getUTCFullYear(),s=Xc(a),c=i.getUTCMonth();return s?o>=1&&o<=Gy[c]:o>=1&&o<=Ky[c]}},{key:"set",value:function(i,o,a){return i.setUTCDate(a),i.setUTCHours(0,0,0,0),i}}]),t}(Oe),Jy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",90),re(ae(r),"subpriority",1),re(ae(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"D":case"DD":return Fe(Ye.dayOfYear,i);case"Do":return a.ordinalNumber(i,{unit:"date"});default:return ze(o.length,i)}}},{key:"validate",value:function(i,o){var a=i.getUTCFullYear(),s=Xc(a);return s?o>=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,a){return i.setUTCMonth(0,a),i.setUTCHours(0,0,0,0),i}}]),t}(Oe);function za(n,e,t){var r,i,o,a,s,c,d,u;se(2,arguments);var f=ln(),p=pe((r=(i=(o=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(c=s.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&o!==void 0?o:f.weekStartsOn)!==null&&i!==void 0?i:(d=f.locale)===null||d===void 0||(u=d.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=de(n),m=pe(e),v=h.getUTCDay(),w=m%7,x=(w+7)%7,C=(x<p?7:0)+m-v;return h.setUTCDate(h.getUTCDate()+C),h}var Xy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",90),re(ae(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"E":case"EE":case"EEE":return a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=za(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(Oe),Zy=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",90),re(ae(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a,s){var c=function(u){var f=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+f};switch(o){case"e":case"ee":return je(ze(o.length,i),c);case"eo":return je(a.ordinalNumber(i,{unit:"day"}),c);case"eee":return a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=za(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(Oe),e0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",90),re(ae(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a,s){var c=function(u){var f=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+f};switch(o){case"c":case"cc":return je(ze(o.length,i),c);case"co":return je(a.ordinalNumber(i,{unit:"day"}),c);case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"})||a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})||a.day(i,{width:"abbreviated",context:"standalone"})||a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=za(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(Oe);function t0(n,e){se(2,arguments);var t=pe(e);t%7===0&&(t=t-7);var r=1,i=de(n),o=i.getUTCDay(),a=t%7,s=(a+7)%7,c=(s<r?7:0)+t-o;return i.setUTCDate(i.getUTCDate()+c),i}var n0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",90),re(ae(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d===0?7:d};switch(o){case"i":case"ii":return ze(o.length,i);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return je(a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s);case"iiiii":return je(a.day(i,{width:"narrow",context:"formatting"}),s);case"iiiiii":return je(a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s);case"iiii":default:return je(a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s)}}},{key:"validate",value:function(i,o){return o>=1&&o<=7}},{key:"set",value:function(i,o,a){return i=t0(i,a),i.setUTCHours(0,0,0,0),i}}]),t}(Oe),r0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",80),re(ae(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"a":case"aa":case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Fa(a),0,0,0),i}}]),t}(Oe),i0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",80),re(ae(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"b":case"bb":case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Fa(a),0,0,0),i}}]),t}(Oe),o0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",80),re(ae(r),"incompatibleTokens",["a","b","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Fa(a),0,0,0),i}}]),t}(Oe),a0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",70),re(ae(r),"incompatibleTokens",["H","K","k","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"h":return Fe(Ye.hour12h,i);case"ho":return a.ordinalNumber(i,{unit:"hour"});default:return ze(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=12}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):!s&&a===12?i.setUTCHours(0,0,0,0):i.setUTCHours(a,0,0,0),i}}]),t}(Oe),s0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",70),re(ae(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"H":return Fe(Ye.hour23h,i);case"Ho":return a.ordinalNumber(i,{unit:"hour"});default:return ze(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=23}},{key:"set",value:function(i,o,a){return i.setUTCHours(a,0,0,0),i}}]),t}(Oe),l0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",70),re(ae(r),"incompatibleTokens",["h","H","k","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"K":return Fe(Ye.hour11h,i);case"Ko":return a.ordinalNumber(i,{unit:"hour"});default:return ze(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):i.setUTCHours(a,0,0,0),i}}]),t}(Oe),c0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",70),re(ae(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"k":return Fe(Ye.hour24h,i);case"ko":return a.ordinalNumber(i,{unit:"hour"});default:return ze(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=24}},{key:"set",value:function(i,o,a){var s=a<=24?a%24:a;return i.setUTCHours(s,0,0,0),i}}]),t}(Oe),d0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",60),re(ae(r),"incompatibleTokens",["t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"m":return Fe(Ye.minute,i);case"mo":return a.ordinalNumber(i,{unit:"minute"});default:return ze(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCMinutes(a,0,0),i}}]),t}(Oe),u0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",50),re(ae(r),"incompatibleTokens",["t","T"]),r}return Me(t,[{key:"parse",value:function(i,o,a){switch(o){case"s":return Fe(Ye.second,i);case"so":return a.ordinalNumber(i,{unit:"second"});default:return ze(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCSeconds(a,0),i}}]),t}(Oe),f0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",30),re(ae(r),"incompatibleTokens",["t","T"]),r}return Me(t,[{key:"parse",value:function(i,o){var a=function(c){return Math.floor(c*Math.pow(10,-o.length+3))};return je(ze(o.length,i),a)}},{key:"set",value:function(i,o,a){return i.setUTCMilliseconds(a),i}}]),t}(Oe),p0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",10),re(ae(r),"incompatibleTokens",["t","T","x"]),r}return Me(t,[{key:"parse",value:function(i,o){switch(o){case"X":return un(dn.basicOptionalMinutes,i);case"XX":return un(dn.basic,i);case"XXXX":return un(dn.basicOptionalSeconds,i);case"XXXXX":return un(dn.extendedOptionalSeconds,i);case"XXX":default:return un(dn.extended,i)}}},{key:"set",value:function(i,o,a){return o.timestampIsSet?i:new Date(i.getTime()-a)}}]),t}(Oe),h0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",10),re(ae(r),"incompatibleTokens",["t","T","X"]),r}return Me(t,[{key:"parse",value:function(i,o){switch(o){case"x":return un(dn.basicOptionalMinutes,i);case"xx":return un(dn.basic,i);case"xxxx":return un(dn.basicOptionalSeconds,i);case"xxxxx":return un(dn.extendedOptionalSeconds,i);case"xxx":default:return un(dn.extended,i)}}},{key:"set",value:function(i,o,a){return o.timestampIsSet?i:new Date(i.getTime()-a)}}]),t}(Oe),m0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",40),re(ae(r),"incompatibleTokens","*"),r}return Me(t,[{key:"parse",value:function(i){return Qc(i)}},{key:"set",value:function(i,o,a){return[new Date(a*1e3),{timestampIsSet:!0}]}}]),t}(Oe),g0=function(n){Te(t,n);var e=De(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),re(ae(r),"priority",20),re(ae(r),"incompatibleTokens","*"),r}return Me(t,[{key:"parse",value:function(i){return Qc(i)}},{key:"set",value:function(i,o,a){return[new Date(a),{timestampIsSet:!0}]}}]),t}(Oe),y0={G:new Iy,y:new Ry,Y:new Vy,R:new $y,u:new Ly,Q:new Fy,q:new zy,M:new Hy,L:new Yy,w:new Uy,I:new qy,d:new Qy,D:new Jy,E:new Xy,e:new Zy,c:new e0,i:new n0,a:new r0,b:new i0,B:new o0,h:new a0,H:new s0,K:new l0,k:new c0,m:new d0,s:new u0,S:new f0,X:new p0,x:new h0,t:new m0,T:new g0},v0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,b0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,w0=/^'([^]*?)'?$/,k0=/''/g,x0=/\S/,C0=/[a-zA-Z]/;function Ha(n,e,t,r){var i,o,a,s,c,d,u,f,p,h,m,v,w,x,C,N,y,_;se(3,arguments);var k=String(n),E=String(e),j=ln(),I=(i=(o=r==null?void 0:r.locale)!==null&&o!==void 0?o:j.locale)!==null&&i!==void 0?i:Yc;if(!I.match)throw new RangeError("locale must contain match property");var M=pe((a=(s=(c=(d=r==null?void 0:r.firstWeekContainsDate)!==null&&d!==void 0?d:r==null||(u=r.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&c!==void 0?c:j.firstWeekContainsDate)!==null&&s!==void 0?s:(p=j.locale)===null||p===void 0||(h=p.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(M>=1&&M<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var B=pe((m=(v=(w=(x=r==null?void 0:r.weekStartsOn)!==null&&x!==void 0?x:r==null||(C=r.locale)===null||C===void 0||(N=C.options)===null||N===void 0?void 0:N.weekStartsOn)!==null&&w!==void 0?w:j.weekStartsOn)!==null&&v!==void 0?v:(y=j.locale)===null||y===void 0||(_=y.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&m!==void 0?m:0);if(!(B>=0&&B<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(E==="")return k===""?de(t):new Date(NaN);var H={firstWeekContainsDate:M,weekStartsOn:B,locale:I},W=[new Py],L=E.match(b0).map(function(ne){var q=ne[0];if(q in Va){var le=Va[q];return le(ne,I.formatLong)}return ne}).join("").match(v0),T=[],R=Wc(L),$;try{var Y=function(){var q=$.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Hc(q)&&Co(q,E,n),!(r!=null&&r.useAdditionalDayOfYearTokens)&&zc(q)&&Co(q,E,n);var le=q[0],oe=y0[le];if(oe){var U=oe.incompatibleTokens;if(Array.isArray(U)){var Z=T.find(function(te){return U.includes(te.token)||te.token===le});if(Z)throw new RangeError("The format string mustn't contain `".concat(Z.fullToken,"` and `").concat(q,"` at the same time"))}else if(oe.incompatibleTokens==="*"&&T.length>0)throw new RangeError("The format string mustn't contain `".concat(q,"` and any other token at the same time"));T.push({token:le,fullToken:q});var he=oe.run(k,q,I.match,H);if(!he)return{v:new Date(NaN)};W.push(he.setter),k=he.rest}else{if(le.match(C0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+le+"`");if(q==="''"?q="'":le==="'"&&(q=M0(q)),k.indexOf(q)===0)k=k.slice(q.length);else return{v:new Date(NaN)}}};for(R.s();!($=R.n()).done;){var b=Y();if(It(b)==="object")return b.v}}catch(ne){R.e(ne)}finally{R.f()}if(k.length>0&&x0.test(k))return new Date(NaN);var g=W.map(function(ne){return ne.priority}).sort(function(ne,q){return q-ne}).filter(function(ne,q,le){return le.indexOf(ne)===q}).map(function(ne){return W.filter(function(q){return q.priority===ne}).sort(function(q,le){return le.subPriority-q.subPriority})}).map(function(ne){return ne[0]}),S=de(t);if(isNaN(S.getTime()))return new Date(NaN);var O=Bc(S,xo(S)),F={},z=Wc(g),P;try{for(z.s();!(P=z.n()).done;){var D=P.value;if(!D.validate(O,H))return new Date(NaN);var ee=D.set(O,F,H);Array.isArray(ee)?(O=ee[0],wy(F,ee[1])):O=ee}}catch(ne){z.e(ne)}finally{z.f()}return O}function M0(n){return n.match(w0)[1].replace(k0,"'")}function Zc(n,e){se(2,arguments);var t=Ti(n),r=Ti(e);return t.getTime()===r.getTime()}function S0(n,e){se(2,arguments);var t=pe(e);return Tn(n,-t)}function T0(n,e){var t;se(1,arguments);var r=pe((t=e==null?void 0:e.additionalDigits)!==null&&t!==void 0?t:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=E0(n),o;if(i.date){var a=N0(i.date,r);o=_0(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),c=0,d;if(i.time&&(c=B0(i.time),isNaN(c)))return new Date(NaN);if(i.timezone){if(d=P0(i.timezone),isNaN(d))return new Date(NaN)}else{var u=new Date(s+c),f=new Date(0);return f.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),f.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),f}return new Date(s+c+d)}var To={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},D0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,A0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,O0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function E0(n){var e={},t=n.split(To.dateTimeDelimiter),r;if(t.length>2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],To.timeZoneDelimiter.test(e.date)&&(e.date=n.split(To.timeZoneDelimiter)[0],r=n.substr(e.date.length,n.length))),r){var i=To.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function N0(n,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=n.match(t);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:n.slice((r[1]||r[2]).length)}}function _0(n,e){if(e===null)return new Date(NaN);var t=n.match(D0);if(!t)return new Date(NaN);var r=!!t[4],i=Ni(t[1]),o=Ni(t[2])-1,a=Ni(t[3]),s=Ni(t[4]),c=Ni(t[5])-1;if(r)return L0(e,s,c)?I0(e,s,c):new Date(NaN);var d=new Date(0);return!V0(e,o,a)||!$0(e,i)?new Date(NaN):(d.setUTCFullYear(e,o,Math.max(i,a)),d)}function Ni(n){return n?parseInt(n):1}function B0(n){var e=n.match(A0);if(!e)return NaN;var t=Ya(e[1]),r=Ya(e[2]),i=Ya(e[3]);return F0(t,r,i)?t*Ia+r*Pa+i*1e3:NaN}function Ya(n){return n&&parseFloat(n.replace(",","."))||0}function P0(n){if(n==="Z")return 0;var e=n.match(O0);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return z0(r,i)?t*(r*Ia+i*Pa):NaN}function I0(n,e,t){var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,o=(e-1)*7+t+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var R0=[31,null,31,30,31,30,31,31,30,31,30,31];function ed(n){return n%400===0||n%4===0&&n%100!==0}function V0(n,e,t){return e>=0&&e<=11&&t>=1&&t<=(R0[e]||(ed(n)?29:28))}function $0(n,e){return e>=1&&e<=(ed(n)?366:365)}function L0(n,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function F0(n,e,t){return n===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&n>=0&&n<25}function z0(n,e){return e>=0&&e<=59}function td(n,e){se(2,arguments);var t=de(n),r=pe(e),i=t.getFullYear(),o=t.getDate(),a=new Date(0);a.setFullYear(i,r,15),a.setHours(0,0,0,0);var s=xy(a);return t.setMonth(r,Math.min(o,s)),t}function Pe(n,e){if(se(2,arguments),It(e)!=="object"||e===null)throw new RangeError("values parameter must be an object");var t=de(n);return isNaN(t.getTime())?new Date(NaN):(e.year!=null&&t.setFullYear(e.year),e.month!=null&&(t=td(t,e.month)),e.date!=null&&t.setDate(pe(e.date)),e.hours!=null&&t.setHours(pe(e.hours)),e.minutes!=null&&t.setMinutes(pe(e.minutes)),e.seconds!=null&&t.setSeconds(pe(e.seconds)),e.milliseconds!=null&&t.setMilliseconds(pe(e.milliseconds)),t)}function nd(n,e){se(2,arguments);var t=de(n),r=pe(e);return t.setHours(r),t}function ja(n,e){se(2,arguments);var t=de(n),r=pe(e);return t.setMilliseconds(r),t}function rd(n,e){se(2,arguments);var t=de(n),r=pe(e);return t.setMinutes(r),t}function Ua(n,e){se(2,arguments);var t=de(n),r=pe(e);return t.setSeconds(r),t}function fn(n,e){se(2,arguments);var t=de(n),r=pe(e);return isNaN(t.getTime())?new Date(NaN):(t.setFullYear(r),t)}function Hr(n,e){se(2,arguments);var t=pe(e);return Wt(n,-t)}function H0(n,e){if(se(2,arguments),!e||It(e)!=="object")return new Date(NaN);var t=e.years?pe(e.years):0,r=e.months?pe(e.months):0,i=e.weeks?pe(e.weeks):0,o=e.days?pe(e.days):0,a=e.hours?pe(e.hours):0,s=e.minutes?pe(e.minutes):0,c=e.seconds?pe(e.seconds):0,d=Hr(n,r+t*12),u=S0(d,o+i*7),f=s+a*60,p=c+f*60,h=p*1e3,m=new Date(u.getTime()-h);return m}function id(n,e){se(2,arguments);var t=pe(e);return Ba(n,-t)}function _i(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),l.createElementVNode("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),l.createElementVNode("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),l.createElementVNode("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}_i.compatConfig={MODE:3};function od(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),l.createElementVNode("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}od.compatConfig={MODE:3};function Wa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}Wa.compatConfig={MODE:3};function qa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}qa.compatConfig={MODE:3};function Ka(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),l.createElementVNode("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}Ka.compatConfig={MODE:3};function Ga(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}Ga.compatConfig={MODE:3};function Qa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}Qa.compatConfig={MODE:3};function Ja(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ad={exports:{}};(function(n){function e(t){return t&&t.__esModule?t:{default:t}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(ad);var Y0=ad.exports,Xa={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r){if(r===null||r===!0||r===!1)return NaN;var i=Number(r);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}n.exports=e.default})(Xa,Xa.exports);var j0=Xa.exports;const U0=Ja(j0);var Za={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r){var i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return i.setUTCFullYear(r.getFullYear()),r.getTime()-i.getTime()}n.exports=e.default})(Za,Za.exports);var W0=Za.exports;const sd=Ja(W0);function q0(n,e){var t=J0(e);return t.formatToParts?G0(t,n):Q0(t,n)}var K0={year:0,month:1,day:2,hour:3,minute:4,second:5};function G0(n,e){try{for(var t=n.formatToParts(e),r=[],i=0;i<t.length;i++){var o=K0[t[i].type];o>=0&&(r[o]=parseInt(t[i].value,10))}return r}catch(a){if(a instanceof RangeError)return[NaN];throw a}}function Q0(n,e){var t=n.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(t);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var es={};function J0(n){if(!es[n]){var e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),t=e==="06/25/2014, 00:00:00"||e==="06/25/2014 00:00:00";es[n]=t?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return es[n]}function ts(n,e,t,r,i,o,a){var s=new Date(0);return s.setUTCFullYear(n,e,t),s.setUTCHours(r,i,o,a),s}var ld=36e5,X0=6e4,ns={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function rs(n,e,t){var r,i;if(n===""||(r=ns.timezoneZ.exec(n),r))return 0;var o;if(r=ns.timezoneHH.exec(n),r)return o=parseInt(r[1],10),cd(o)?-(o*ld):NaN;if(r=ns.timezoneHHMM.exec(n),r){o=parseInt(r[1],10);var a=parseInt(r[2],10);return cd(o,a)?(i=Math.abs(o)*ld+a*X0,o>0?-i:i):NaN}if(tv(n)){e=new Date(e||Date.now());var s=t?e:Z0(e),c=is(s,n),d=t?c:ev(e,c,n);return-d}return NaN}function Z0(n){return ts(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function is(n,e){var t=q0(n,e),r=ts(t[0],t[1]-1,t[2],t[3]%24,t[4],t[5],0).getTime(),i=n.getTime(),o=i%1e3;return i-=o>=0?o:1e3+o,r-i}function ev(n,e,t){var r=n.getTime(),i=r-e,o=is(new Date(i),t);if(e===o)return e;i-=o-e;var a=is(new Date(i),t);return o===a?o:Math.max(o,a)}function cd(n,e){return-23<=n&&n<=23&&(e==null||0<=e&&e<=59)}var dd={};function tv(n){if(dd[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),dd[n]=!0,!0}catch{return!1}}var ud=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,as=36e5,fd=6e4,nv=2,mt={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:ud};function ss(n,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var t=e||{},r=t.additionalDigits==null?nv:U0(t.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=rv(n),o=iv(i.date,r),a=o.year,s=o.restDateString,c=ov(s,a);if(isNaN(c))return new Date(NaN);if(c){var d=c.getTime(),u=0,f;if(i.time&&(u=av(i.time),isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(f=rs(i.timeZone||t.timeZone,new Date(d+u)),isNaN(f))return new Date(NaN)}else f=sd(new Date(d+u)),f=sd(new Date(d+u+f));return new Date(d+u+f)}else return new Date(NaN)}function rv(n){var e={},t=mt.dateTimePattern.exec(n),r;if(t?(e.date=t[1],r=t[3]):(t=mt.datePattern.exec(n),t?(e.date=t[1],r=t[2]):(e.date=null,r=n)),r){var i=mt.timeZone.exec(r);i?(e.time=r.replace(i[1],""),e.timeZone=i[1].trim()):e.time=r}return e}function iv(n,e){var t=mt.YYY[e],r=mt.YYYYY[e],i;if(i=mt.YYYY.exec(n)||r.exec(n),i){var o=i[1];return{year:parseInt(o,10),restDateString:n.slice(o.length)}}if(i=mt.YY.exec(n)||t.exec(n),i){var a=i[1];return{year:parseInt(a,10)*100,restDateString:n.slice(a.length)}}return{year:null}}function ov(n,e){if(e===null)return null;var t,r,i,o;if(n.length===0)return r=new Date(0),r.setUTCFullYear(e),r;if(t=mt.MM.exec(n),t)return r=new Date(0),i=parseInt(t[1],10)-1,md(e,i)?(r.setUTCFullYear(e,i),r):new Date(NaN);if(t=mt.DDD.exec(n),t){r=new Date(0);var a=parseInt(t[1],10);return cv(e,a)?(r.setUTCFullYear(e,0,a),r):new Date(NaN)}if(t=mt.MMDD.exec(n),t){r=new Date(0),i=parseInt(t[1],10)-1;var s=parseInt(t[2],10);return md(e,i,s)?(r.setUTCFullYear(e,i,s),r):new Date(NaN)}if(t=mt.Www.exec(n),t)return o=parseInt(t[1],10)-1,gd(e,o)?pd(e,o):new Date(NaN);if(t=mt.WwwD.exec(n),t){o=parseInt(t[1],10)-1;var c=parseInt(t[2],10)-1;return gd(e,o,c)?pd(e,o,c):new Date(NaN)}return null}function av(n){var e,t,r;if(e=mt.HH.exec(n),e)return t=parseFloat(e[1].replace(",",".")),ls(t)?t%24*as:NaN;if(e=mt.HHMM.exec(n),e)return t=parseInt(e[1],10),r=parseFloat(e[2].replace(",",".")),ls(t,r)?t%24*as+r*fd:NaN;if(e=mt.HHMMSS.exec(n),e){t=parseInt(e[1],10),r=parseInt(e[2],10);var i=parseFloat(e[3].replace(",","."));return ls(t,r,i)?t%24*as+r*fd+i*1e3:NaN}return null}function pd(n,e,t){e=e||0,t=t||0;var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,o=e*7+t+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var sv=[31,28,31,30,31,30,31,31,30,31,30,31],lv=[31,29,31,30,31,30,31,31,30,31,30,31];function hd(n){return n%400===0||n%4===0&&n%100!==0}function md(n,e,t){if(e<0||e>11)return!1;if(t!=null){if(t<1)return!1;var r=hd(n);if(r&&t>lv[e]||!r&&t>sv[e])return!1}return!0}function cv(n,e){if(e<1)return!1;var t=hd(n);return!(t&&e>366||!t&&e>365)}function gd(n,e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function ls(n,e,t){return!(n!=null&&(n<0||n>=25)||e!=null&&(e<0||e>=60)||t!=null&&(t<0||t>=60))}var cs={exports:{}},ds={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r,i){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o]);return r}n.exports=e.default})(ds,ds.exports);var dv=ds.exports;(function(n,e){var t=Y0.default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var r=t(dv);function i(o){return(0,r.default)({},o)}n.exports=e.default})(cs,cs.exports);var uv=cs.exports;const fv=Ja(uv);function pv(n,e,t){var r=ss(n,t),i=rs(e,r,!0),o=new Date(r.getTime()-i),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}function hv(n,e,t){if(typeof n=="string"&&!n.match(ud)){var r=fv(t);return r.timeZone=e,ss(n,r)}var i=ss(n,t),o=ts(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()).getTime(),a=rs(e,new Date(o));return new Date(o+a)}function yd(n){return e=>new Intl.DateTimeFormat(n,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${e}T00:00:00+00:00`)).slice(0,2)}function mv(n){return e=>$n(new Date(`2017-01-0${e}T00:00:00+00:00`),"EEEEEE",{locale:n})}const gv=(n,e,t)=>{const r=[1,2,3,4,5,6,7];let i;if(n!==null)try{i=r.map(mv(n))}catch{i=r.map(yd(e))}else i=r.map(yd(e));const o=i.slice(0,t),a=i.slice(t+1,i.length);return[i[t]].concat(...a).concat(...o)},us=(n,e)=>{const t=[];for(let r=+n[0];r<=+n[1];r++)t.push({value:+r,text:`${r}`});return e?t.reverse():t},vd=(n,e,t)=>{const r=[1,2,3,4,5,6,7,8,9,10,11,12].map(o=>{const a=o<10?`0${o}`:o;return new Date(`2017-${a}-01T00:00:00+00:00`)});if(n!==null)try{const o=t==="long"?"MMMM":"MMM";return r.map((a,s)=>{const c=$n(a,o,{locale:n});return{text:c.charAt(0).toUpperCase()+c.substring(1),value:s}})}catch{}const i=new Intl.DateTimeFormat(e,{month:t,timeZone:"UTC"});return r.map((o,a)=>{const s=i.format(o);return{text:s.charAt(0).toUpperCase()+s.substring(1),value:a}})},yv=n=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][n],Xe=n=>{const e=l.unref(n);return e!=null&&e.$el?e==null?void 0:e.$el:e},vv=n=>Object.assign({type:"dot"},n),bd=n=>Array.isArray(n)?!!n[0]&&!!n[1]:!1,Do={prop:n=>`"${n}" prop must be enabled!`,dateArr:n=>`You need to use array as "model-value" binding in order to support "${n}"`},et=n=>n,wd=n=>n===0?n:!n||isNaN(+n)?null:+n,kd=n=>n===null,bv=n=>{if(n)return[...n.querySelectorAll("input, button, select, textarea, a[href]")][0]},wv=n=>{const e=[],t=r=>r.filter(i=>i);for(let r=0;r<n.length;r+=3){const i=[n[r],n[r+1],n[r+2]];e.push(t(i))}return e},Bi=(n,e,t)=>{const r=t??t===0,i=e??e===0;if(!r&&!i)return!1;const o=+t,a=+e;return r&&i?+n>o||+n<a:r?+n>o:i?+n<a:!1},Yr=(n,e)=>wv(n).map(t=>t.map(r=>{const{active:i,disabled:o,isBetween:a,highlighted:s}=e(r);return{...r,active:i,disabled:o,className:{dp__overlay_cell_active:i,dp__overlay_cell:!i,dp__overlay_cell_disabled:o,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:o&&i,dp__cell_in_between:a,"dp--highlighted":s}}})),Ln=(n,e,t=!1)=>{n&&e.allowStopPropagation&&(t&&n.stopImmediatePropagation(),n.stopPropagation())},kv=()=>["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", ");function xv(n,e){let t=[...document.querySelectorAll(kv())];t=t.filter(i=>!n.contains(i)||i.hasAttribute("data-datepicker-instance"));const r=t.indexOf(n);if(r>=0&&(e?r-1>=0:r+1<=t.length))return t[r+(e?-1:1)]}const Cv=(n,e)=>{let t;return function(...r){clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}},xd=(n,e,t,r,i)=>{const o=Ha(n,e.slice(0,n.length),new Date);return Si(o)&&Oc(o)?r||i?o:Pe(o,{hours:+t.hours,minutes:+(t==null?void 0:t.minutes),seconds:+(t==null?void 0:t.seconds),milliseconds:0}):null},Mv=(n,e,t,r,i)=>{const o=Array.isArray(t)?t[0]:t;if(typeof e=="string")return xd(n,e,o,r,i);if(Array.isArray(e)){let a=null;for(const s of e)if(a=xd(n,s,o,r,i),a)break;return a}return typeof e=="function"?e(n):null},G=n=>n?new Date(n):new Date,Sv=(n,e,t)=>{if(e){const i=(n.getMonth()+1).toString().padStart(2,"0"),o=n.getDate().toString().padStart(2,"0"),a=n.getHours().toString().padStart(2,"0"),s=n.getMinutes().toString().padStart(2,"0"),c=t?n.getSeconds().toString().padStart(2,"0"):"00";return`${n.getFullYear()}-${i}-${o}T${a}:${s}:${c}.000Z`}const r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds());return new Date(r).toISOString()},kt=n=>{let e=G(JSON.parse(JSON.stringify(n)));return e=nd(e,0),e=rd(e,0),e=Ua(e,0),e=ja(e,0),e},Fn=(n,e,t,r)=>{let i=n?G(n):G();return(e||e===0)&&(i=nd(i,+e)),(t||t===0)&&(i=rd(i,+t)),(r||r===0)&&(i=Ua(i,+r)),ja(i,0)},ot=(n,e)=>!n||!e?!1:Ei(kt(n),kt(e)),Ee=(n,e)=>!n||!e?!1:zr(kt(n),kt(e)),dt=(n,e)=>!n||!e?!1:Oi(kt(n),kt(e)),Ao=(n,e,t)=>n!=null&&n[0]&&n!=null&&n[1]?dt(t,n[0])&&ot(t,n[1]):n!=null&&n[0]&&e?dt(t,n[0])&&ot(t,e)||ot(t,n[0])&&dt(t,e):!1,Kt=n=>{const e=Pe(new Date(n),{date:1});return kt(e)},fs=(n,e,t)=>e&&(t||t===0)?Object.fromEntries(["hours","minutes","seconds"].map(r=>r===e?[r,t]:[r,isNaN(+n[r])?void 0:+n[r]])):{hours:isNaN(+n.hours)?void 0:+n.hours,minutes:isNaN(+n.minutes)?void 0:+n.minutes,seconds:isNaN(+n.seconds)?void 0:+n.seconds},hr=n=>({hours:qt(n),minutes:cn(n),seconds:Fr(n)}),Cd=(n,e)=>{if(e){const t=be(G(e));if(t>n)return 12;if(t===n)return Se(G(e))}},Md=(n,e)=>{if(e){const t=be(G(e));return t<n?-1:t===n?Se(G(e)):void 0}},jr=n=>{if(n)return be(G(n))},Gt=(n,e)=>e?pv(n,e):n,Sd=(n,e)=>e?hv(n,e):n,Tv=n=>n instanceof Date?n:T0(n),Td=(n,e)=>{const t=dt(n,e)?e:n,r=dt(e,n)?e:n;return Nc({start:t,end:r})},Dv=n=>{const e=Wt(n,1);return{month:Se(e),year:be(e)}},Oo=(n,e,t)=>{const r=ur(Gt(n,e),{weekStartsOn:+t}),i=yg(Gt(n,e),{weekStartsOn:+t});return[r,i]},Dd=(n,e)=>{const t={hours:qt(G()),minutes:cn(G()),seconds:e?Fr(G()):0};return Object.assign(t,n)},zn=(n,e,t)=>[Pe(G(n),{date:1}),Pe(G(),{month:e,year:t,date:1})],Dn=(n,e,t)=>{let r=n?G(n):G();return(e||e===0)&&(r=td(r,e)),t&&(r=fn(r,t)),r},Ad=(n,e,t,r,i)=>{if(!r||i&&!e||!i&&!t)return!1;const o=i?Wt(n,1):Hr(n,1),a=[Se(o),be(o)];return i?!Ov(...a,e):!Av(...a,t)},Av=(n,e,t)=>ot(...zn(t,n,e))||Ee(...zn(t,n,e)),Ov=(n,e,t)=>dt(...zn(t,n,e))||Ee(...zn(t,n,e)),Od=(n,e,t,r,i,o,a)=>{if(typeof e=="function"&&!a)return e(n);const s=t?{locale:t}:void 0;return Array.isArray(n)?`${$n(n[0],o,s)}${i&&!n[1]?"":r}${n[1]?$n(n[1],o,s):""}`:$n(n,o,s)},Ur=n=>{if(n)return null;throw new Error(Do.prop("partial-range"))},Eo=(n,e)=>{if(e)return n();throw new Error(Do.prop("range"))},ps=n=>Array.isArray(n)?Si(n[0])&&(n[1]?Si(n[1]):!0):n?Si(n):!1,Ev=(n,e)=>Pe(e??G(),{hours:+n.hours||0,minutes:+n.minutes||0,seconds:+n.seconds||0}),hs=(n,e,t,r)=>{if(!n)return!0;if(r){const i=t==="max"?Ei(n,e):Oi(n,e),o={seconds:0,milliseconds:0};return i||zr(Pe(n,o),Pe(e,o))}return t==="max"?n.getTime()<=e.getTime():n.getTime()>=e.getTime()},ms=(n,e,t)=>n?Ev(n,e):G(t??e),Ed=(n,e,t,r,i)=>{if(Array.isArray(r)){const a=ms(n,r[0],e),s=ms(n,r[1],e);return hs(r[0],a,t,!!e)&&hs(r[1],s,t,!!e)&&i}const o=ms(n,r,e);return hs(r,o,t,!!e)&&i},gs=n=>Pe(G(),hr(n)),Nv=(n,e)=>Array.isArray(n)?n.map(t=>G(t)).filter(t=>be(G(t))===e).map(t=>Se(t)):[],Nd=(n,e,t)=>typeof n=="function"?n({month:e,year:t}):!!n.months.find(r=>r.month===e&&r.year===t),ys=(n,e)=>typeof n=="function"?n(e):n.years.includes(e),Pi=l.reactive({menuFocused:!1,shiftKeyInMenu:!1}),_d=()=>{const n=t=>{Pi.menuFocused=t},e=t=>{Pi.shiftKeyInMenu!==t&&(Pi.shiftKeyInMenu=t)};return{control:l.computed(()=>({shiftKeyInMenu:Pi.shiftKeyInMenu,menuFocused:Pi.menuFocused})),setMenuFocused:n,setShiftKey:e}},Ie=l.reactive({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),vs=l.ref(null),No=l.ref(!1),bs=l.ref(!1),ws=l.ref(!1),ks=l.ref(!1),gt=l.ref(0),at=l.ref(0),Hn=()=>{const n=l.computed(()=>No.value?[...Ie.selectionGrid,Ie.actionRow].filter(f=>f.length):bs.value?[...Ie.timePicker[0],...Ie.timePicker[1],ks.value?[]:[vs.value],Ie.actionRow].filter(f=>f.length):ws.value?[...Ie.monthPicker,Ie.actionRow]:[Ie.monthYear,...Ie.calendar,Ie.time,Ie.actionRow].filter(f=>f.length)),e=f=>{gt.value=f?gt.value+1:gt.value-1;let p=null;n.value[at.value]&&(p=n.value[at.value][gt.value]),p||(gt.value=f?gt.value-1:gt.value+1)},t=f=>{at.value===0&&!f||at.value===n.value.length&&f||(at.value=f?at.value+1:at.value-1,n.value[at.value]?n.value[at.value]&&!n.value[at.value][gt.value]&>.value!==0&&(gt.value=n.value[at.value].length-1):at.value=f?at.value-1:at.value+1)},r=f=>{let p=null;n.value[at.value]&&(p=n.value[at.value][gt.value]),p?p.focus({preventScroll:!No.value}):gt.value=f?gt.value-1:gt.value+1},i=()=>{e(!0),r(!0)},o=()=>{e(!1),r(!1)},a=()=>{t(!1),r(!0)},s=()=>{t(!0),r(!0)},c=(f,p)=>{Ie[p]=f},d=(f,p)=>{Ie[p]=f},u=()=>{gt.value=0,at.value=0};return{buildMatrix:c,buildMultiLevelMatrix:d,setTimePickerBackRef:f=>{vs.value=f},setSelectionGrid:f=>{No.value=f,u(),f||(Ie.selectionGrid=[])},setTimePicker:(f,p=!1)=>{bs.value=f,ks.value=p,u(),f||(Ie.timePicker[0]=[],Ie.timePicker[1]=[])},setTimePickerElements:(f,p=0)=>{Ie.timePicker[p]=f},arrowRight:i,arrowLeft:o,arrowUp:a,arrowDown:s,clearArrowNav:()=>{Ie.monthYear=[],Ie.calendar=[],Ie.time=[],Ie.actionRow=[],Ie.selectionGrid=[],Ie.timePicker[0]=[],Ie.timePicker[1]=[],No.value=!1,bs.value=!1,ks.value=!1,ws.value=!1,u(),vs.value=null},setMonthPicker:f=>{ws.value=f,u()},refSets:Ie}},Bd=n=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...n??{}}),_v=n=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",calendarWrap:"Calendar wrapper",calendarDays:"Calendar days",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:e=>`Increment ${e}`,decrementValue:e=>`Decrement ${e}`,openTpOverlay:e=>`Open ${e} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:()=>"",...n??{}}),Pd=n=>n?typeof n=="boolean"?n?2:0:+n>=2?+n:2:0,Bv=n=>{const e=typeof n=="object"&&n,t={static:!0,solo:!1};if(!n)return{...t,count:Pd(!1)};const r=e?n:{},i=e?r.count??!0:n,o=Pd(i);return Object.assign(t,r,{count:o})},Pv=(n,e,t)=>n||(typeof t=="string"?t:e),Iv=n=>typeof n=="boolean"?n?Bd({}):!1:Bd(n),Rv=n=>{const e={enterSubmit:!0,tabSubmit:!0,openMenu:!0,selectOnFocus:!1,rangeSeparator:" - "};return typeof n=="object"?{...e,...n??{},enabled:!0}:{...e,enabled:n}},Vv=n=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...n??{}}),$v=n=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...n??{}}),Lv=n=>{const e={input:!1};return typeof n=="object"?{...e,...n??{},enabled:!0}:{enabled:n,...e}},Fv=n=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,...n??{}}),zv=(n,e,t)=>{const r={dates:Array.isArray(n)?n.map(i=>G(i)):[],years:[],months:[],quarters:[],weeks:[],weekdays:e,options:{highlightDisabled:t}};return typeof n=="function"?n:{...r,...n??{}}},Hv=n=>typeof n=="object"?{type:n.type,hideOnOffsetDates:n.hideOnOffsetDates??!1}:{type:n,hideOnOffsetDates:!1},Ue=n=>{const e=()=>{const x=n.enableSeconds?":ss":"";return n.is24?`HH:mm${x}`:`hh:mm${x} aa`},t=()=>n.format?n.format:n.monthPicker?"MM/yyyy":n.timePicker?e():n.weekPicker?"MM/dd/yyyy":n.yearPicker?"yyyy":n.quarterPicker?"QQQ/yyyy":n.enableTimePicker?`MM/dd/yyyy, ${e()}`:"MM/dd/yyyy",r=x=>Dd(x,n.enableSeconds),i=()=>n.range?n.startTime&&Array.isArray(n.startTime)?[r(n.startTime[0]),r(n.startTime[1])]:null:n.startTime&&!Array.isArray(n.startTime)?r(n.startTime):null,o=l.computed(()=>Bv(n.multiCalendars)),a=l.computed(()=>i()),s=l.computed(()=>_v(n.ariaLabels)),c=l.computed(()=>Vv(n.filters)),d=l.computed(()=>Iv(n.transitions)),u=l.computed(()=>$v(n.actionRow)),f=l.computed(()=>Pv(n.previewFormat,n.format,t())),p=l.computed(()=>Rv(n.textInput)),h=l.computed(()=>Lv(n.inline)),m=l.computed(()=>Fv(n.config)),v=l.computed(()=>zv(n.highlight,n.highlightWeekDays,n.highlightDisabledDays)),w=l.computed(()=>Hv(n.weekNumbers));return{defaultedTransitions:d,defaultedMultiCalendars:o,defaultedStartTime:a,defaultedAriaLabels:s,defaultedFilters:c,defaultedActionRow:u,defaultedPreviewFormat:f,defaultedTextInput:p,defaultedInline:h,defaultedConfig:m,defaultedHighlight:v,defaultedWeekNumbers:w,getDefaultPattern:t,getDefaultStartTime:i}},Yv=(n,e,t)=>{const r=l.ref(),{defaultedTextInput:i,getDefaultPattern:o}=Ue(e),a=l.ref(""),s=l.toRef(e,"format");l.watch(r,()=>{n("internal-model-change",r.value)}),l.watch(s,()=>{L()});const c=g=>Sd(g,e.timezone),d=g=>Gt(g,e.timezone),u=(g,S,O=!1)=>Od(g,e.format,e.formatLocale,i.value.rangeSeparator,e.modelAuto,S??o(),O),f=g=>g?e.modelType?R(g):{hours:qt(g),minutes:cn(g),seconds:e.enableSeconds?Fr(g):0}:null,p=g=>e.modelType?R(g):{month:Se(g),year:be(g)},h=g=>Array.isArray(g)?e.multiDates?g.map(S=>m(S,fn(G(),S))):Eo(()=>[fn(G(),g[0]),g[1]?fn(G(),g[1]):Ur(e.partialRange)],e.range):fn(G(),+g),m=(g,S)=>(typeof g=="string"||typeof g=="number")&&e.modelType?T(g):S,v=g=>Array.isArray(g)?[m(g[0],Fn(null,+g[0].hours,+g[0].minutes,g[0].seconds)),m(g[1],Fn(null,+g[1].hours,+g[1].minutes,g[1].seconds))]:m(g,Fn(null,g.hours,g.minutes,g.seconds)),w=g=>Array.isArray(g)?e.multiDates?g.map(S=>m(S,Dn(null,+S.month,+S.year))):Eo(()=>[m(g[0],Dn(null,+g[0].month,+g[0].year)),m(g[1],g[1]?Dn(null,+g[1].month,+g[1].year):Ur(e.partialRange))],e.range):m(g,Dn(null,+g.month,+g.year)),x=g=>{if(Array.isArray(g))return g.map(S=>T(S));throw new Error(Do.dateArr("multi-dates"))},C=g=>{if(Array.isArray(g))return[G(g[0]),G(g[1])];throw new Error(Do.dateArr("week-picker"))},N=g=>e.modelAuto?Array.isArray(g)?[T(g[0]),T(g[1])]:e.autoApply?[T(g)]:[T(g),null]:Array.isArray(g)?Eo(()=>[T(g[0]),g[1]?T(g[1]):Ur(e.partialRange)],e.range):T(g),y=()=>{Array.isArray(r.value)&&e.range&&r.value.length===1&&r.value.push(Ur(e.partialRange))},_=()=>{const g=r.value;return[R(g[0]),g[1]?R(g[1]):Ur(e.partialRange)]},k=()=>r.value[1]?_():R(et(r.value[0])),E=()=>(r.value||[]).map(g=>R(g)),j=()=>(y(),e.modelAuto?k():e.multiDates?E():Array.isArray(r.value)?Eo(()=>_(),e.range):R(et(r.value))),I=g=>!g||Array.isArray(g)&&!g.length?null:e.timePicker?v(et(g)):e.monthPicker?w(et(g)):e.yearPicker?h(et(g)):e.multiDates?x(et(g)):e.weekPicker?C(et(g)):N(et(g)),M=g=>{const S=I(g);ps(et(S))?(r.value=et(S),L()):(r.value=null,a.value="")},B=()=>{const g=S=>$n(S,i.value.format);return`${g(r.value[0])} ${i.value.rangeSeparator} ${r.value[1]?g(r.value[1]):""}`},H=()=>t.value&&r.value?Array.isArray(r.value)?B():$n(r.value,i.value.format):u(r.value),W=()=>r.value?e.multiDates?r.value.map(g=>u(g)).join("; "):i.value.enabled&&typeof i.value.format=="string"?H():u(r.value):"",L=()=>{!e.format||typeof e.format=="string"||i.value.enabled&&typeof i.value.format=="string"?a.value=W():a.value=e.format(r.value)},T=g=>{if(e.utc){const S=new Date(g);return e.utc==="preserve"?new Date(S.getTime()+S.getTimezoneOffset()*6e4):S}return e.modelType?e.modelType==="date"||e.modelType==="timestamp"?d(new Date(g)):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?Ha(g,o(),new Date):d(Ha(g,e.modelType,new Date)):d(new Date(g))},R=g=>g?e.utc?Sv(g,e.utc==="preserve",e.enableSeconds):e.modelType?e.modelType==="timestamp"?+c(g):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?u(c(g)):u(c(g),e.modelType,!0):c(g):"",$=(g,S=!1)=>{if(n("update:model-value",g),e.emitTimezone&&S){const O=Array.isArray(g)?g.map(F=>Gt(et(F)),e.emitTimezone):Gt(et(g),e.emitTimezone);n("update:model-timezone-value",O)}},Y=g=>Array.isArray(r.value)?e.multiDates?r.value.map(S=>g(S)):[g(r.value[0]),r.value[1]?g(r.value[1]):Ur(e.partialRange)]:g(et(r.value)),b=g=>$(et(Y(g)));return{inputValue:a,internalModelValue:r,checkBeforeEmit:()=>r.value?e.range?e.partialRange?r.value.length>=1:r.value.length===2:!!r.value:!1,parseExternalModelValue:M,formatInputValue:L,emitModelValue:()=>(L(),e.monthPicker?b(p):e.timePicker?b(f):e.yearPicker?b(be):e.weekPicker?$(r.value.map(g=>R(g)),!0):$(j(),!0))}},jv=(n,e)=>{const{defaultedFilters:t}=Ue(n),{validateMonthYearInRange:r}=yr(n),i=(d,u)=>{let f=d;return t.value.months.includes(Se(f))?(f=u?Wt(d,1):Hr(d,1),i(f,u)):f},o=(d,u)=>{let f=d;return t.value.years.includes(be(f))?(f=u?Ba(d,1):id(d,1),o(f,u)):f},a=(d,u=!1)=>{const f=Pe(new Date,{month:n.month,year:n.year});let p=d?Wt(f,1):Hr(f,1);n.disableYearSelect&&(p=fn(p,n.year));let h=Se(p),m=be(p);t.value.months.includes(h)&&(p=i(p,d),h=Se(p),m=be(p)),t.value.years.includes(m)&&(p=o(p,d),m=be(p)),r(h,m,d,n.preventMinMaxNavigation)&&s(h,m,u)},s=(d,u,f)=>{e("update-month-year",{month:d,year:u,fromNav:f})},c=l.computed(()=>d=>Ad(Pe(new Date,{month:n.month,year:n.year}),n.maxDate,n.minDate,n.preventMinMaxNavigation,d));return{handleMonthYearChange:a,isDisabled:c,updateMonthYear:s}};var Wr=(n=>(n.center="center",n.left="left",n.right="right",n))(Wr||{}),Qt=(n=>(n.month="month",n.year="year",n))(Qt||{}),mr=(n=>(n.top="top",n.bottom="bottom",n))(mr||{}),gr=(n=>(n.header="header",n.calendar="calendar",n.timePicker="timePicker",n))(gr||{}),pn=(n=>(n.month="month",n.year="year",n.calendar="calendar",n.time="time",n.minutes="minutes",n.hours="hours",n.seconds="seconds",n))(pn||{});const Uv=({menuRef:n,menuRefInner:e,inputRef:t,pickerWrapperRef:r,inline:i,emit:o,props:a,slots:s})=>{const c=l.ref({}),d=l.ref(!1),u=l.ref({top:"0",left:"0"}),f=l.ref(!1),p=l.toRef(a,"teleportCenter");l.watch(p,()=>{u.value=JSON.parse(JSON.stringify({})),y()});const h=T=>{if(a.teleport){const R=T.getBoundingClientRect();return{left:R.left+window.scrollX,top:R.top+window.scrollY}}return{top:0,left:0}},m=(T,R)=>{u.value.left=`${T+R-c.value.width}px`},v=T=>{u.value.left=`${T}px`},w=(T,R)=>{a.position===Wr.left&&v(T),a.position===Wr.right&&m(T,R),a.position===Wr.center&&(u.value.left=`${T+R/2-c.value.width/2}px`)},x=T=>{const{width:R,height:$}=T.getBoundingClientRect(),{top:Y,left:b}=a.altPosition?a.altPosition(T):h(T);return{top:+Y,left:+b,width:R,height:$}},C=()=>{u.value.left="50%",u.value.top="50%",u.value.transform="translate(-50%, -50%)",u.value.position="fixed",delete u.value.opacity},N=()=>{const T=Xe(t),{top:R,left:$,transform:Y}=a.altPosition(T);u.value={top:`${R}px`,left:`${$}px`,transform:Y??""}},y=(T=!0)=>{var R;if(!i.value.enabled){if(p.value)return C();if(a.altPosition!==null)return N();if(T){const $=a.teleport?(R=e.value)==null?void 0:R.$el:n.value;$&&(c.value=$.getBoundingClientRect()),o("recalculate-position")}return B()}},_=({inputEl:T,left:R,width:$})=>{window.screen.width>768&&!d.value&&w(R,$),j(T)},k=T=>{const{top:R,left:$,height:Y,width:b}=x(T);u.value.top=`${Y+R+ +a.offset}px`,f.value=!1,d.value||(u.value.left=`${$+b/2-c.value.width/2}px`),_({inputEl:T,left:$,width:b})},E=T=>{const{top:R,left:$,width:Y}=x(T);u.value.top=`${R-+a.offset-c.value.height}px`,f.value=!0,_({inputEl:T,left:$,width:Y})},j=T=>{if(a.autoPosition){const{left:R,width:$}=x(T),{left:Y,right:b}=c.value;if(!d.value){if(Math.abs(Y)!==Math.abs(b)){if(Y<=0)return d.value=!0,v(R);if(b>=document.documentElement.clientWidth)return d.value=!0,m(R,$)}return w(R,$)}}},I=()=>{const T=Xe(t);if(T){const{height:R}=c.value,{top:$,height:Y}=T.getBoundingClientRect(),b=window.innerHeight-$-Y,g=$;return R<=b?mr.bottom:R>b&&R<=g?mr.top:b>=g?mr.bottom:mr.top}return mr.bottom},M=T=>I()===mr.bottom?k(T):E(T),B=()=>{const T=Xe(t);if(T)return a.autoPosition?M(T):k(T)},H=function(T){if(T){const R=T.scrollHeight>T.clientHeight,$=window.getComputedStyle(T).overflowY.indexOf("hidden")!==-1;return R&&!$}return!0},W=function(T){return!T||T===document.body||T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:H(T)?T:W(T.parentNode)},L=T=>{if(T)switch(a.position){case Wr.left:return{left:0,transform:"translateX(0)"};case Wr.right:return{left:`${T.width}px`,transform:"translateX(-100%)"};default:return{left:`${T.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:f,menuStyle:u,xCorrect:d,setMenuPosition:y,getScrollableParent:W,shadowRender:(T,R)=>{var $,Y,b;const g=document.createElement("div"),S=($=Xe(t))==null?void 0:$.getBoundingClientRect();g.setAttribute("id","dp--temp-container");const O=(Y=r.value)!=null&&Y.clientWidth?r.value:document.body;O.append(g);const F=L(S),z=l.h(T,{...R,shadow:!0,style:{opacity:0,position:"absolute",...F}},Object.fromEntries(Object.keys(s).filter(P=>["right-sidebar","left-sidebar"].includes(P)).map(P=>[P,s[P]])));l.render(z,g),c.value=(b=z.el)==null?void 0:b.getBoundingClientRect(),l.render(null,g),O.removeChild(g)}}},Yn=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]}],Wv=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],qv={all:()=>Yn,monthYear:()=>Yn.filter(n=>n.use.includes("month-year")),input:()=>Wv,timePicker:()=>Yn.filter(n=>n.use.includes("time")),action:()=>Yn.filter(n=>n.use.includes("action")),calendar:()=>Yn.filter(n=>n.use.includes("calendar")),menu:()=>Yn.filter(n=>n.use.includes("menu")),shared:()=>Yn.filter(n=>n.use.includes("shared")),yearMode:()=>Yn.filter(n=>n.use.includes("year-mode"))},Et=(n,e,t)=>{const r=[];return qv[e]().forEach(i=>{n[i.name]&&r.push(i.name)}),t!=null&&t.length&&t.forEach(i=>{i.slot&&r.push(i.slot)}),r},Ii=n=>{const e=l.computed(()=>r=>n.value?r?n.value.open:n.value.close:""),t=l.computed(()=>r=>n.value?r?n.value.menuAppearTop:n.value.menuAppearBottom:"");return{transitionName:e,showTransition:!!n.value,menuTransition:t}},Ri=(n,e)=>{const t=G(Gt(new Date,n.timezone)),r=l.ref([{month:Se(t),year:be(t)}]),i=l.reactive({hours:n.range?[qt(t),qt(t)]:qt(t),minutes:n.range?[cn(t),cn(t)]:cn(t),seconds:n.range?[0,0]:0}),o=l.computed({get:()=>n.internalModelValue,set:c=>{!n.readonly&&!n.disabled&&e("update:internal-model-value",c)}}),a=l.computed(()=>c=>r.value[c]?r.value[c].month:0),s=l.computed(()=>c=>r.value[c]?r.value[c].year:0);return{calendars:r,time:i,modelValue:o,month:a,year:s}},Kv=(n,e)=>{const{defaultedMultiCalendars:t,defaultedHighlight:r}=Ue(e),{isDisabled:i,matchDate:o}=yr(e),a=l.ref(null),s=l.ref(G(Gt(new Date,e.timezone))),c=b=>{!b.current&&e.hideOffsetDates||(a.value=b.value)},d=()=>{a.value=null},u=b=>Array.isArray(n.value)&&e.range&&n.value[0]&&a.value?b?dt(a.value,n.value[0]):ot(a.value,n.value[0]):!0,f=(b,g)=>{const S=()=>n.value?g?n.value[0]||null:n.value[1]:null,O=n.value&&Array.isArray(n.value)?S():null;return Ee(G(b.value),O)},p=b=>{const g=Array.isArray(n.value)?n.value[0]:null;return b?!ot(a.value??null,g):!0},h=(b,g=!0)=>(e.range||e.weekPicker)&&Array.isArray(n.value)&&n.value.length===2?e.hideOffsetDates&&!b.current?!1:Ee(G(b.value),n.value[g?0:1]):e.range?f(b,g)&&p(g)||Ee(b.value,Array.isArray(n.value)?n.value[0]:null)&&u(g):!1,m=(b,g,S)=>Array.isArray(n.value)&&n.value[0]&&n.value.length===1?b?!1:S?dt(n.value[0],g.value):ot(n.value[0],g.value):!1,v=b=>!n.value||e.hideOffsetDates&&!b.current?!1:e.range?e.modelAuto&&Array.isArray(n.value)?Ee(b.value,n.value[0]?n.value[0]:s.value):!1:e.multiDates&&Array.isArray(n.value)?n.value.some(g=>Ee(g,b.value)):Ee(b.value,n.value?n.value:s.value),w=b=>{if(e.autoRange||e.weekPicker){if(a.value){if(e.hideOffsetDates&&!b.current)return!1;const g=Tn(a.value,+e.autoRange),S=Oo(G(a.value),e.timezone,e.weekStart);return e.weekPicker?Ee(S[1],G(b.value)):Ee(g,G(b.value))}return!1}return!1},x=b=>{if(e.autoRange||e.weekPicker){if(a.value){const g=Tn(a.value,+e.autoRange);if(e.hideOffsetDates&&!b.current)return!1;const S=Oo(G(a.value),e.timezone,e.weekStart);return e.weekPicker?dt(b.value,S[0])&&ot(b.value,S[1]):dt(b.value,a.value)&&ot(b.value,g)}return!1}return!1},C=b=>{if(e.autoRange||e.weekPicker){if(a.value){if(e.hideOffsetDates&&!b.current)return!1;const g=Oo(G(a.value),e.timezone,e.weekStart);return e.weekPicker?Ee(g[0],b.value):Ee(a.value,b.value)}return!1}return!1},N=b=>Ao(n.value,a.value,b.value),y=()=>e.modelAuto&&Array.isArray(e.internalModelValue)?!!e.internalModelValue[0]:!1,_=()=>e.modelAuto?bd(e.internalModelValue):!0,k=b=>{if(Array.isArray(n.value)&&n.value.length||e.weekPicker)return!1;const g=e.range?!h(b)&&!h(b,!1):!0;return!i(b.value)&&!v(b)&&!(!b.current&&e.hideOffsetDates)&&g},E=b=>e.range?e.modelAuto?y()&&v(b):!1:v(b),j=b=>{var g;return r.value?typeof r.value=="function"?r.value(b.value):o(b.value,(g=e.arrMapValues)!=null&&g.highlightedDates?e.arrMapValues.highlightedDates:r.value.dates):!1},I=b=>{const g=i(b.value);return g&&(typeof r.value=="function"?!r.value(b.value,g):!r.value.options.highlightDisabled)},M=b=>{var g;return typeof r.value=="function"?r.value(b.value):(g=r.value.weekdays)==null?void 0:g.includes(b.value.getDay())},B=b=>(e.range||e.weekPicker)&&(!(t.value.count>0)||b.current)&&_()&&!(!b.current&&e.hideOffsetDates)&&!v(b)?N(b):!1,H=b=>{const{isRangeStart:g,isRangeEnd:S}=T(b),O=e.range?g||S:!1;return{dp__cell_offset:!b.current,dp__pointer:!e.disabled&&!(!b.current&&e.hideOffsetDates)&&!i(b.value),dp__cell_disabled:i(b.value),dp__cell_highlight:!I(b)&&(j(b)||M(b))&&!E(b)&&!O&&!C(b)&&!(B(b)&&e.weekPicker)&&!S,dp__cell_highlight_active:!I(b)&&(j(b)||M(b))&&E(b),dp__today:!e.noToday&&Ee(b.value,s.value)&&b.current}},W=b=>({dp__active_date:E(b),dp__date_hover:k(b)}),L=b=>({...R(b),...$(b),dp__range_between_week:B(b)&&e.weekPicker}),T=b=>{const g=t.value.count>0?b.current&&h(b)&&_():h(b)&&_(),S=t.value.count>0?b.current&&h(b,!1)&&_():h(b,!1)&&_();return{isRangeStart:g,isRangeEnd:S}},R=b=>{const{isRangeStart:g,isRangeEnd:S}=T(b);return{dp__range_start:g,dp__range_end:S,dp__range_between:B(b)&&!e.weekPicker,dp__date_hover_start:m(k(b),b,!0),dp__date_hover_end:m(k(b),b,!1)}},$=b=>({...R(b),dp__cell_auto_range:x(b),dp__cell_auto_range_start:C(b),dp__cell_auto_range_end:w(b)}),Y=b=>e.range?e.autoRange?$(b):e.modelAuto?{...W(b),...R(b)}:R(b):e.weekPicker?L(b):W(b);return{setHoverDate:c,clearHoverDate:d,getDayClassData:b=>e.hideOffsetDates&&!b.current?{}:{...H(b),...Y(b),[e.dayClass?e.dayClass(b.value):""]:!0,[e.calendarCellClassName]:!!e.calendarCellClassName}}},yr=n=>{const{defaultedFilters:e,defaultedHighlight:t}=Ue(n),r=()=>{if(n.timezone)return n.timezone;if(n.utc)return"UTC"},i=M=>{const B=kt(o(G(M))).toISOString(),[H]=B.split("T");return H},o=M=>n.utc==="preserve"?Sd(M,r()):Gt(M,r()),a=M=>{var B;const H=n.maxDate?dt(M,o(G(n.maxDate))):!1,W=n.minDate?ot(M,o(G(n.minDate))):!1,L=u(o(M),(B=n.arrMapValues)!=null&&B.disabledDates?n.arrMapValues.disabledDates:n.disabledDates),T=e.value.months.map(g=>+g).includes(Se(M)),R=n.disabledWeekDays.length?n.disabledWeekDays.some(g=>+g===ky(M)):!1,$=p(M),Y=be(M),b=Y<+n.yearRange[0]||Y>+n.yearRange[1];return!(H||W||L||T||b||R||$)},s=(M,B)=>ot(...zn(n.minDate,M,B))||Ee(...zn(n.minDate,M,B)),c=(M,B)=>dt(...zn(n.maxDate,M,B))||Ee(...zn(n.maxDate,M,B)),d=(M,B,H)=>{let W=!1;return n.maxDate&&H&&c(M,B)&&(W=!0),n.minDate&&!H&&s(M,B)&&(W=!0),W},u=(M,B)=>M?B instanceof Map?!!B.get(i(M)):Array.isArray(B)?B.some(H=>Ee(o(G(H)),M)):B?B(G(JSON.parse(JSON.stringify(M)))):!1:!0,f=(M,B,H,W)=>{let L=!1;return W?n.minDate&&n.maxDate?L=d(M,B,H):(n.minDate&&s(M,B)||n.maxDate&&c(M,B))&&(L=!0):L=!0,L},p=M=>{var B,H,W,L,T;return Array.isArray(n.allowedDates)&&!((B=n.allowedDates)!=null&&B.length)?!0:(H=n.arrMapValues)!=null&&H.allowedDates?!u(M,(W=n.arrMapValues)==null?void 0:W.allowedDates):(L=n.allowedDates)!=null&&L.length?!((T=n.allowedDates)!=null&&T.some(R=>Ee(o(G(R)),o(M)))):!1},h=M=>!a(M),m=M=>n.noDisabledRange?!Nc({start:M[0],end:M[1]}).some(B=>h(B)):!0,v=(M,B,H=0)=>{if(Array.isArray(B)&&B[H]){const W=ug(M,B[H]),L=Td(B[H],M),T=L.length===1?0:L.filter($=>h($)).length,R=Math.abs(W)-T;if(n.minRange&&n.maxRange)return R>=+n.minRange&&R<=+n.maxRange;if(n.minRange)return R>=+n.minRange;if(n.maxRange)return R<=+n.maxRange}return!0},w=M=>new Map(M.map(B=>[i(B),!0])),x=M=>Array.isArray(M)&&M.length>0,C=()=>{const M={disabledDates:null,allowedDates:null,highlightedDates:null};return x(n.allowedDates)&&(M.allowedDates=w(n.allowedDates)),typeof t.value!="function"&&x(t.value.dates)&&(M.highlightedDates=w(t.value.dates)),x(n.disabledDates)&&(M.disabledDates=w(n.disabledDates)),M},N=()=>!n.enableTimePicker||n.monthPicker||n.yearPicker||n.ignoreTimeValidation,y=M=>Array.isArray(M)?[M[0]?gs(M[0]):null,M[1]?gs(M[1]):null]:gs(M),_=(M,B,H)=>M.find(W=>+W.hours===qt(B)&&W.minutes==="*"?!0:+W.minutes===cn(B)&&+W.hours===qt(B))&&H,k=(M,B,H)=>{const[W,L]=M,[T,R]=B;return!_(W,T,H)&&!_(L,R,H)&&H},E=(M,B)=>{const H=Array.isArray(B)?B:[B];return Array.isArray(n.disabledTimes)?Array.isArray(n.disabledTimes[0])?k(n.disabledTimes,H,M):!H.some(W=>_(n.disabledTimes,W,M)):M},j=(M,B)=>{const H=Array.isArray(B)?[hr(B[0]),B[1]?hr(B[1]):void 0]:hr(B),W=!n.disabledTimes(H);return M&&W},I=(M,B)=>n.disabledTimes?Array.isArray(n.disabledTimes)?E(B,M):j(B,M):B;return{isDisabled:h,validateDate:a,validateMonthYearInRange:f,isDateRangeAllowed:m,checkMinMaxRange:v,matchDate:u,mapDatesArrToMap:C,isValidTime:M=>{let B=!0;if(!M||N())return!0;const H=!n.minDate&&!n.maxDate?y(M):M;return(n.maxTime||n.maxDate)&&(B=Ed(n.maxTime,n.maxDate,"max",et(H),B)),(n.minTime||n.minDate)&&(B=Ed(n.minTime,n.minDate,"min",et(H),B)),I(M,B)}}},_o=()=>{const n=l.computed(()=>(r,i)=>r==null?void 0:r.includes(i)),e=l.computed(()=>(r,i)=>r.count?r.solo?!0:i===0:!0),t=l.computed(()=>(r,i)=>r.count?r.solo?!0:i===r.count-1:!0);return{hideNavigationButtons:n,showLeftIcon:e,showRightIcon:t}},Gv=(n,e,t)=>{const r=l.ref(0),i=l.reactive({[gr.timePicker]:!n.enableTimePicker||n.timePicker||n.monthPicker,[gr.calendar]:!1,[gr.header]:!1}),o=l.computed(()=>n.monthPicker),a=f=>{var p;if((p=n.flow)!=null&&p.length){if(!f&&o.value)return u();i[f]=!0,Object.keys(i).filter(h=>!i[h]).length||u()}},s=()=>{var f;(f=n.flow)!=null&&f.length&&r.value!==-1&&(r.value+=1,e("flow-step",r.value),u())},c=()=>{r.value=-1},d=(f,p,...h)=>{n.flow[r.value]===f&&t.value&&t.value[p](...h)},u=()=>{d(pn.month,"toggleMonthPicker",!0),d(pn.year,"toggleYearPicker",!0),d(pn.calendar,"toggleTimePicker",!1,!0),d(pn.time,"toggleTimePicker",!0,!0);const f=n.flow[r.value];(f===pn.hours||f===pn.minutes||f===pn.seconds)&&d(f,"toggleTimePicker",!0,!0,f)};return{childMount:a,updateFlowStep:s,resetFlow:c,flowStep:r}},Bo={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:String,default:null},emitTimezone:{type:String,default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},menuClassName:{type:String,default:null},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},calendarCellClassName:{type:String,default:null},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},autoRange:{type:[Number,String],default:null},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},minRange:{type:[Number,String],default:null},maxRange:{type:[Number,String],default:null},multiDatesLimit:{type:[Number,String],default:null},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},disableTimeRangeValidation:{type:Boolean,default:!1},highlight:{type:[Array,Function,Object],default:null},highlightWeekDays:{type:Array,default:null},highlightDisabledDays:{type:Boolean,default:!1},teleport:{type:[String,Boolean,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},calendarClassName:{type:String,default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:Boolean,default:!1},partialRange:{type:Boolean,default:!0},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},inputClassName:{type:String,default:null},fixedStart:{type:Boolean,default:!1},fixedEnd:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:Boolean,default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},noDisabledRange:{type:Boolean,default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},showLastInRange:{type:Boolean,default:!0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1}},Jt={...Bo,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},arrMapValues:{type:Object,default:()=>({})},noOverlayFocus:{type:Boolean,default:!1}},Qv={key:1,class:"dp__input_wrap"},Jv=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid"],Xv={key:2,class:"dp__clear_icon"},Zv=l.defineComponent({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},...Bo},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur"],setup(n,{expose:e,emit:t}){const r=t,i=n,{defaultedTextInput:o,defaultedAriaLabels:a,defaultedInline:s,defaultedConfig:c,getDefaultPattern:d,getDefaultStartTime:u}=Ue(i),{checkMinMaxRange:f}=yr(i),p=l.ref(),h=l.ref(null),m=l.ref(!1),v=l.ref(!1),w=l.computed(()=>({dp__pointer:!i.disabled&&!i.readonly&&!o.value.enabled,dp__disabled:i.disabled,dp__input_readonly:!o.value.enabled,dp__input:!0,dp__input_icon_pad:!i.hideInputIcon,dp__input_valid:!!i.state,dp__input_invalid:i.state===!1,dp__input_focus:m.value||i.isMenuOpen,dp__input_reg:!o.value.enabled,[i.inputClassName]:!!i.inputClassName})),x=()=>{r("set-input-date",null),i.autoApply&&(r("set-empty-date"),p.value=null)},C=L=>{const T=u();return Mv(L,o.value.format??d(),T??Dd({},i.enableSeconds),i.inputValue,v.value)},N=L=>{const{rangeSeparator:T}=o.value,[R,$]=L.split(`${T}`);if(R){const Y=C(R.trim()),b=$?C($.trim()):null,g=Y&&b?[Y,b]:[Y];f(b,g,0)&&(p.value=Y?g:null)}},y=()=>{v.value=!0},_=L=>{if(i.range)N(L);else if(i.multiDates){const T=L.split(";");p.value=T.map(R=>C(R.trim())).filter(R=>R)}else p.value=C(L)},k=L=>{var T;const R=typeof L=="string"?L:(T=L.target)==null?void 0:T.value;R!==""?(o.value.openMenu&&!i.isMenuOpen&&r("open"),_(R),r("set-input-date",p.value)):x(),v.value=!1,r("update:input-value",R)},E=L=>{o.value.enabled?(_(L.target.value),o.value.enterSubmit&&ps(p.value)&&i.inputValue!==""?(r("set-input-date",p.value,!0),p.value=null):o.value.enterSubmit&&i.inputValue===""&&(p.value=null,r("clear"))):M(L)},j=L=>{o.value.enabled&&o.value.tabSubmit&&_(L.target.value),o.value.tabSubmit&&ps(p.value)&&i.inputValue!==""?(r("set-input-date",p.value,!0,!0),p.value=null):o.value.tabSubmit&&i.inputValue===""&&(p.value=null,r("clear",!0))},I=()=>{var L;m.value=!0,r("focus"),o.value.enabled&&o.value.selectOnFocus&&((L=h.value)==null||L.select())},M=L=>{L.preventDefault(),Ln(L,c.value,!0),o.value.enabled&&o.value.openMenu&&!s.value.input&&!i.isMenuOpen?r("open"):o.value.enabled||r("toggle")},B=()=>{r("real-blur"),m.value=!1,(!i.isMenuOpen||s.value.enabled&&s.value.input)&&r("blur"),i.autoApply&&o.value.enabled&&p.value&&!i.isMenuOpen&&(r("set-input-date",p.value),r("select-date"),p.value=null)},H=L=>{Ln(L,c.value,!0),r("clear")},W=L=>{if(!o.value.enabled){if(L.code==="Tab")return;L.preventDefault()}};return e({focusInput:()=>{var L;(L=h.value)==null||L.focus({preventScroll:!0})},setParsedDate:L=>{p.value=L}}),(L,T)=>{var R;return l.openBlock(),l.createElementBlock("div",{onClick:M},[L.$slots.trigger&&!L.$slots["dp-input"]&&!l.unref(s).enabled?l.renderSlot(L.$slots,"trigger",{key:0}):l.createCommentVNode("",!0),!L.$slots.trigger&&(!l.unref(s).enabled||l.unref(s).input)?(l.openBlock(),l.createElementBlock("div",Qv,[L.$slots["dp-input"]&&!L.$slots.trigger&&!l.unref(s).enabled?l.renderSlot(L.$slots,"dp-input",{key:0,value:n.inputValue,isMenuOpen:n.isMenuOpen,onInput:k,onEnter:E,onTab:j,onClear:H,onBlur:B,onKeypress:W,onPaste:y,openMenu:()=>L.$emit("open"),closeMenu:()=>L.$emit("close"),toggleMenu:()=>L.$emit("toggle")}):l.createCommentVNode("",!0),L.$slots["dp-input"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",{key:1,id:L.uid?`dp-input-${L.uid}`:void 0,ref_key:"inputRef",ref:h,name:L.name,class:l.normalizeClass(w.value),inputmode:l.unref(o).enabled?"text":"none",placeholder:L.placeholder,disabled:L.disabled,readonly:L.readonly,required:L.required,value:n.inputValue,autocomplete:L.autocomplete,"aria-label":(R=l.unref(a))==null?void 0:R.input,"aria-disabled":L.disabled||void 0,"aria-invalid":L.state===!1?!0:void 0,onInput:k,onKeydown:[l.withKeys(E,["enter"]),l.withKeys(j,["tab"]),W],onBlur:B,onFocus:I,onKeypress:W,onPaste:y},null,42,Jv)),l.createElementVNode("div",{onClick:T[2]||(T[2]=$=>r("toggle"))},[L.$slots["input-icon"]&&!L.hideInputIcon?(l.openBlock(),l.createElementBlock("span",{key:0,class:"dp__input_icon",onClick:T[0]||(T[0]=$=>r("toggle"))},[l.renderSlot(L.$slots,"input-icon")])):l.createCommentVNode("",!0),!L.$slots["input-icon"]&&!L.hideInputIcon&&!L.$slots["dp-input"]?(l.openBlock(),l.createBlock(l.unref(_i),{key:1,class:"dp__input_icon dp__input_icons",onClick:T[1]||(T[1]=$=>r("toggle"))})):l.createCommentVNode("",!0)]),L.$slots["clear-icon"]&&n.inputValue&&L.clearable&&!L.disabled&&!L.readonly?(l.openBlock(),l.createElementBlock("span",Xv,[l.renderSlot(L.$slots,"clear-icon",{clear:H})])):l.createCommentVNode("",!0),L.clearable&&!L.$slots["clear-icon"]&&n.inputValue&&!L.disabled&&!L.readonly?(l.openBlock(),l.createBlock(l.unref(od),{key:3,class:"dp__clear_icon dp__input_icons",onClick:T[3]||(T[3]=l.withModifiers($=>H($),["prevent"]))})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])}}}),eb=["title"],tb={class:"dp__action_buttons"},nb=["disabled"],rb=l.defineComponent({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...Jt},emits:["close-picker","select-date","select-now","invalid-select"],setup(n,{emit:e}){const t=e,r=n,{defaultedActionRow:i,defaultedPreviewFormat:o,defaultedMultiCalendars:a,defaultedTextInput:s,defaultedInline:c,getDefaultPattern:d}=Ue(r),{isValidTime:u}=yr(r),{buildMatrix:f}=Hn(),p=l.ref(null),h=l.ref(null);l.onMounted(()=>{r.arrowNavigation&&f([Xe(p),Xe(h)],"actionRow")});const m=l.computed(()=>r.range&&!r.partialRange&&r.internalModelValue?r.internalModelValue.length===2:!0),v=l.computed(()=>!w.value||!x.value||!m.value),w=l.computed(()=>!r.enableTimePicker||r.ignoreTimeValidation?!0:u(r.internalModelValue)),x=l.computed(()=>r.monthPicker?r.range&&Array.isArray(r.internalModelValue)?!r.internalModelValue.filter(M=>!j(M)).length:j(r.internalModelValue):!0),C=()=>{const M=o.value;return r.timePicker||r.monthPicker,M(et(r.internalModelValue))},N=()=>{const M=r.internalModelValue;return a.value.count>0?`${y(M[0])} - ${y(M[1])}`:[y(M[0]),y(M[1])]},y=M=>Od(M,o.value,r.formatLocale,s.value.rangeSeparator,r.modelAuto,d()),_=l.computed(()=>!r.internalModelValue||!r.menuMount?"":typeof o.value=="string"?Array.isArray(r.internalModelValue)?r.internalModelValue.length===2&&r.internalModelValue[1]?N():r.multiDates?r.internalModelValue.map(M=>`${y(M)}`):r.modelAuto?`${y(r.internalModelValue[0])}`:`${y(r.internalModelValue[0])} -`:y(r.internalModelValue):C()),k=()=>r.multiDates?"; ":" - ",E=l.computed(()=>Array.isArray(_.value)?_.value.join(k()):_.value),j=M=>{if(!r.monthPicker)return!0;let B=!0;const H=G(Kt(M));if(r.minDate&&r.maxDate){const W=G(Kt(r.minDate)),L=G(Kt(r.maxDate));return dt(H,W)&&ot(H,L)||Ee(H,W)||Ee(H,L)}if(r.minDate){const W=G(Kt(r.minDate));B=dt(H,W)||Ee(H,W)}if(r.maxDate){const W=G(Kt(r.maxDate));B=ot(H,W)||Ee(H,W)}return B},I=()=>{w.value&&x.value&&m.value?t("select-date"):t("invalid-select")};return(M,B)=>(l.openBlock(),l.createElementBlock("div",{class:"dp__action_row",style:l.normalizeStyle(n.calendarWidth?{width:`${n.calendarWidth}px`}:{})},[M.$slots["action-row"]?l.renderSlot(M.$slots,"action-row",l.normalizeProps(l.mergeProps({key:0},{internalModelValue:M.internalModelValue,disabled:v.value,selectDate:()=>M.$emit("select-date"),closePicker:()=>M.$emit("close-picker")}))):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.unref(i).showPreview?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__selection_preview",title:E.value},[M.$slots["action-preview"]?l.renderSlot(M.$slots,"action-preview",{key:0,value:M.internalModelValue}):l.createCommentVNode("",!0),M.$slots["action-preview"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(E.value),1)],64))],8,eb)):l.createCommentVNode("",!0),l.createElementVNode("div",tb,[M.$slots["action-buttons"]?l.renderSlot(M.$slots,"action-buttons",{key:0,value:M.internalModelValue}):l.createCommentVNode("",!0),M.$slots["action-buttons"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[!l.unref(c).enabled&&l.unref(i).showCancel?(l.openBlock(),l.createElementBlock("button",{key:0,ref_key:"cancelButtonRef",ref:p,type:"button",class:"dp__action_button dp__action_cancel",onClick:B[0]||(B[0]=H=>M.$emit("close-picker")),onKeydown:[B[1]||(B[1]=l.withKeys(H=>M.$emit("close-picker"),["enter"])),B[2]||(B[2]=l.withKeys(H=>M.$emit("close-picker"),["space"]))]},l.toDisplayString(M.cancelText),545)):l.createCommentVNode("",!0),l.unref(i).showNow?(l.openBlock(),l.createElementBlock("button",{key:1,ref_key:"cancelButtonRef",ref:p,type:"button",class:"dp__action_button dp__action_cancel",onClick:B[3]||(B[3]=H=>M.$emit("select-now")),onKeydown:[B[4]||(B[4]=l.withKeys(H=>M.$emit("select-now"),["enter"])),B[5]||(B[5]=l.withKeys(H=>M.$emit("select-now"),["space"]))]},l.toDisplayString(M.nowButtonLabel),545)):l.createCommentVNode("",!0),l.unref(i).showSelect?(l.openBlock(),l.createElementBlock("button",{key:2,ref_key:"selectButtonRef",ref:h,type:"button",class:"dp__action_button dp__action_select",disabled:v.value,onKeydown:[l.withKeys(I,["enter"]),l.withKeys(I,["space"])],onClick:I},l.toDisplayString(M.selectText),41,nb)):l.createCommentVNode("",!0)],64))])],64))],4))}}),ib=["onKeydown"],ob={class:"dp__selection_grid_header"},ab=["aria-selected","aria-disabled","onClick","onKeydown","onMouseover"],sb=["aria-label"],Vi=l.defineComponent({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(n,{expose:e,emit:t}){const{setSelectionGrid:r,buildMultiLevelMatrix:i,setMonthPicker:o}=Hn(),a=t,s=n,{defaultedAriaLabels:c,defaultedTextInput:d,defaultedConfig:u}=Ue(s),{hideNavigationButtons:f}=_o(),p=l.ref(!1),h=l.ref(null),m=l.ref(null),v=l.ref([]),w=l.ref(),x=l.ref(null),C=l.ref(0),N=l.ref(null);l.onBeforeUpdate(()=>{h.value=null}),l.onMounted(()=>{l.nextTick().then(()=>B()),s.noOverlayFocus||_(),y(!0)}),l.onUnmounted(()=>y(!1));const y=b=>{var g;s.arrowNavigation&&((g=s.headerRefs)!=null&&g.length?o(b):r(b))},_=()=>{var b;const g=Xe(m);g&&(d.value.enabled||(h.value?(b=h.value)==null||b.focus({preventScroll:!0}):g.focus({preventScroll:!0})),p.value=g.clientHeight<g.scrollHeight)},k=l.computed(()=>({dp__overlay:!0,"dp--overlay-absolute":!s.useRelative,"dp--overlay-relative":s.useRelative})),E=l.computed(()=>s.useRelative?{height:`${s.height}px`,width:"260px"}:void 0),j=l.computed(()=>({dp__overlay_col:!0})),I=l.computed(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:p.value,dp__button_bottom:s.isLast})),M=l.computed(()=>{var b,g;return{dp__overlay_container:!0,dp__container_flex:((b=s.items)==null?void 0:b.length)<=6,dp__container_block:((g=s.items)==null?void 0:g.length)>6}});l.watch(()=>s.items,()=>B(),{deep:!0});const B=()=>{l.nextTick().then(()=>{const b=Xe(h),g=Xe(m),S=Xe(x),O=Xe(N),F=S?S.getBoundingClientRect().height:0;g&&(g.getBoundingClientRect().height?C.value=g.getBoundingClientRect().height-F:C.value=u.value.modeHeight-F),b&&O&&(O.scrollTop=b.offsetTop-O.offsetTop-(C.value/2-b.getBoundingClientRect().height)-F)})},H=b=>{b.disabled||a("selected",b.value)},W=()=>{a("toggle"),a("reset-flow")},L=()=>{s.escClose&&W()},T=(b,g,S,O)=>{b&&((g.active||g.value===s.focusValue)&&(h.value=b),s.arrowNavigation&&(Array.isArray(v.value[S])?v.value[S][O]=b:v.value[S]=[b],R()))},R=()=>{var b,g;const S=(b=s.headerRefs)!=null&&b.length?[s.headerRefs].concat(v.value):v.value.concat([s.skipButtonRef?[]:[x.value]]);i(et(S),(g=s.headerRefs)!=null&&g.length?"monthPicker":"selectionGrid")},$=b=>{s.arrowNavigation||Ln(b,u.value,!0)},Y=b=>{w.value=b,a("hover-value",b)};return e({focusGrid:_}),(b,g)=>{var S;return l.openBlock(),l.createElementBlock("div",{ref_key:"gridWrapRef",ref:m,class:l.normalizeClass(k.value),style:l.normalizeStyle(E.value),role:"dialog",tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(L,["prevent"]),["esc"]),g[0]||(g[0]=l.withKeys(l.withModifiers(O=>$(O),["prevent"]),["left"])),g[1]||(g[1]=l.withKeys(l.withModifiers(O=>$(O),["prevent"]),["up"])),g[2]||(g[2]=l.withKeys(l.withModifiers(O=>$(O),["prevent"]),["down"])),g[3]||(g[3]=l.withKeys(l.withModifiers(O=>$(O),["prevent"]),["right"]))]},[l.createElementVNode("div",{ref_key:"containerRef",ref:N,class:l.normalizeClass(M.value),role:"grid",style:l.normalizeStyle({height:`${C.value}px`})},[l.createElementVNode("div",ob,[l.renderSlot(b.$slots,"header")]),b.$slots.overlay?l.renderSlot(b.$slots,"overlay",{key:0}):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(b.items,(O,F)=>(l.openBlock(),l.createElementBlock("div",{key:F,class:l.normalizeClass(["dp__overlay_row",{dp__flex_row:b.items.length>=3}]),role:"row"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(O,(z,P)=>(l.openBlock(),l.createElementBlock("div",{key:z.value,ref_for:!0,ref:D=>T(D,z,F,P),role:"gridcell",class:l.normalizeClass(j.value),"aria-selected":z.active,"aria-disabled":z.disabled||void 0,tabindex:"0",onClick:D=>H(z),onKeydown:[l.withKeys(l.withModifiers(D=>H(z),["prevent"]),["enter"]),l.withKeys(l.withModifiers(D=>H(z),["prevent"]),["space"])],onMouseover:D=>Y(z.value)},[l.createElementVNode("div",{class:l.normalizeClass(z.className)},[b.$slots.item?l.renderSlot(b.$slots,"item",{key:0,item:z}):l.createCommentVNode("",!0),b.$slots.item?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(z.text),1)],64))],2)],42,ab))),128))],2))),128))],6),b.$slots["button-icon"]?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:0,ref_key:"toggleButton",ref:x,type:"button","aria-label":(S=l.unref(c))==null?void 0:S.toggleOverlay,class:l.normalizeClass(I.value),tabindex:"0",onClick:W,onKeydown:[l.withKeys(W,["enter"]),l.withKeys(W,["tab"])]},[l.renderSlot(b.$slots,"button-icon")],42,sb)),[[l.vShow,!l.unref(f)(b.hideNavigation,b.type)]]):l.createCommentVNode("",!0)],46,ib)}}}),Po=l.defineComponent({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean}},setup(n){const e=n,t=l.computed(()=>e.multiCalendars>0?[...Array(e.multiCalendars).keys()]:[0]),r=l.computed(()=>({dp__instance_calendar:e.multiCalendars>0}));return(i,o)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({dp__menu_inner:!i.stretch,"dp--menu--inner-stretched":i.stretch,dp__flex_display:i.multiCalendars>0})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.value,(a,s)=>(l.openBlock(),l.createElementBlock("div",{key:a,class:l.normalizeClass(r.value)},[l.renderSlot(i.$slots,"default",{instance:a,index:s})],2))),128))],2))}}),lb=["aria-label","aria-disabled"],$i=l.defineComponent({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(n,{emit:e}){const t=e,r=l.ref(null);return l.onMounted(()=>t("set-ref",r)),(i,o)=>(l.openBlock(),l.createElementBlock("button",{ref_key:"elRef",ref:r,type:"button",class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":i.ariaLabel,"aria-disabled":i.disabled||void 0,onClick:o[0]||(o[0]=a=>i.$emit("activate")),onKeydown:[o[1]||(o[1]=l.withKeys(l.withModifiers(a=>i.$emit("activate"),["prevent"]),["enter"])),o[2]||(o[2]=l.withKeys(l.withModifiers(a=>i.$emit("activate"),["prevent"]),["space"]))]},[l.createElementVNode("span",{class:l.normalizeClass(["dp__inner_nav",{dp__inner_nav_disabled:i.disabled}])},[l.renderSlot(i.$slots,"default")],2)],40,lb))}}),cb={class:"dp--year-mode-picker"},db=["aria-label"],Id=l.defineComponent({__name:"YearModePicker",props:{...Jt,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(n,{emit:e}){const t=e,r=n,{showRightIcon:i,showLeftIcon:o}=_o(),{defaultedConfig:a,defaultedMultiCalendars:s,defaultedAriaLabels:c,defaultedTransitions:d}=Ue(r),{showTransition:u,transitionName:f}=Ii(d),p=(v=!1,w)=>{t("toggle-year-picker",{flow:v,show:w})},h=v=>{t("year-select",v)},m=(v=!1)=>{t("handle-year",v)};return(v,w)=>{var x,C,N;return l.openBlock(),l.createElementBlock("div",cb,[l.unref(o)(l.unref(s),n.instance)?(l.openBlock(),l.createBlock($i,{key:0,ref:"mpPrevIconRef","aria-label":(x=l.unref(c))==null?void 0:x.prevYear,disabled:n.isDisabled(!1),onActivate:w[0]||(w[0]=y=>m(!1))},{default:l.withCtx(()=>[v.$slots["arrow-left"]?l.renderSlot(v.$slots,"arrow-left",{key:0}):l.createCommentVNode("",!0),v.$slots["arrow-left"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Wa),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createElementVNode("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":(C=l.unref(c))==null?void 0:C.openYearsOverlay,onClick:w[1]||(w[1]=()=>p(!1)),onKeydown:w[2]||(w[2]=l.withKeys(()=>p(!1),["enter"]))},[v.$slots.year?l.renderSlot(v.$slots,"year",{key:0,year:n.year}):l.createCommentVNode("",!0),v.$slots.year?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(n.year),1)],64))],40,db),l.unref(i)(l.unref(s),n.instance)?(l.openBlock(),l.createBlock($i,{key:1,ref:"mpNextIconRef","aria-label":(N=l.unref(c))==null?void 0:N.nextYear,disabled:n.isDisabled(!0),onActivate:w[3]||(w[3]=y=>m(!0))},{default:l.withCtx(()=>[v.$slots["arrow-right"]?l.renderSlot(v.$slots,"arrow-right",{key:0}):l.createCommentVNode("",!0),v.$slots["arrow-right"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(qa),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:l.unref(f)(n.showYearPicker),css:l.unref(u)},{default:l.withCtx(()=>[n.showYearPicker?(l.openBlock(),l.createBlock(Vi,{key:0,items:n.items,"text-input":v.textInput,"esc-close":v.escClose,config:v.config,"is-last":v.autoApply&&!l.unref(a).keepActionRow,type:"year",onToggle:p,onSelected:w[4]||(w[4]=y=>h(y))},l.createSlots({"button-icon":l.withCtx(()=>[v.$slots["calendar-icon"]?l.renderSlot(v.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),v.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(_i),{key:1}))]),_:2},[v.$slots["year-overlay-value"]?{name:"item",fn:l.withCtx(({item:y})=>[l.renderSlot(v.$slots,"year-overlay-value",{text:y.text,value:y.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last"])):l.createCommentVNode("",!0)]),_:3},8,["name","css"])])}}}),xs=(n,e,t)=>{if(e.value&&Array.isArray(e.value))if(e.value.some(r=>Ee(n,r))){const r=e.value.filter(i=>!Ee(i,n));e.value=r.length?r:null}else(t&&+t>e.value.length||!t)&&e.value.push(n);else e.value=[n]},Cs=(n,e,t)=>{let r=n.value?n.value.slice():[];return r.length===2&&r[1]!==null&&(r=[]),r.length?ot(e,r[0])?(r.unshift(e),t("range-start",r[0]),t("range-start",r[1])):(r[1]=e,t("range-end",e)):(r=[e],t("range-start",e)),n.value=r,r},Io=(n,e,t,r)=>{n[0]&&n[1]&&t&&e("auto-apply"),n[0]&&!n[1]&&r&&t&&e("auto-apply")},Rd=n=>{Array.isArray(n.value)&&n.value.length<=2&&n.range?n.modelValue.value=n.value.map(e=>Gt(G(e),n.timezone)):Array.isArray(n.value)||(n.modelValue.value=Gt(G(n.value),n.timezone))},Vd=({multiCalendars:n,highlight:e,calendars:t,modelValue:r,props:i,year:o,month:a,emit:s})=>{const c=l.computed(()=>us(i.yearRange,i.reverseYears)),d=l.ref([!1]),u=l.computed(()=>(y,_)=>{const k=Pe(Kt(new Date),{month:a.value(y),year:o.value(y)});return Ad(k,i.maxDate,i.minDate,i.preventMinMaxNavigation,_)}),f=()=>{for(let y=0;y<n.value.count;y++)if(y===0)t.value[y]=t.value[0];else{const _=Pe(G(),t.value[y-1]);t.value[y]={month:Se(_),year:be(Ba(_,1))}}},p=y=>{if(!y)return f();const _=Pe(G(),t.value[y]);return t.value[0].year=be(id(_,n.value.count-1)),f()},h=y=>i.focusStartDate?y[0]:y[1]?y[1]:y[0],m=()=>{if(r.value){const y=Array.isArray(r.value)?h(r.value):r.value;t.value[0]={month:Se(y),year:be(y)}}};l.onMounted(()=>{m(),n.value.count&&f()});const v=(y,_)=>{t.value[_].year=y,n.value.count&&!n.value.solo&&p(_)},w=l.computed(()=>y=>Yr(c.value,_=>{const k=o.value(y)===_.value,E=Bi(_.value,jr(i.minDate),jr(i.maxDate)),j=ys(e.value,_.value);return{active:k,disabled:E,highlighted:j}})),x=(y,_)=>{v(y,_),N(_)},C=(y,_=!1)=>{if(!u.value(y,_)){const k=_?o.value(y)+1:o.value(y)-1;v(k,y)}},N=(y,_=!1,k)=>{_||s("reset-flow"),k!==void 0?d.value[y]=k:d.value[y]=!d.value[y],d.value||s("overlay-closed")};return{isDisabled:u,groupedYears:w,showYearPicker:d,selectYear:v,toggleYearPicker:N,handleYearSelect:x,handleYear:C}},ub=(n,e)=>{const{defaultedMultiCalendars:t,defaultedAriaLabels:r,defaultedTransitions:i,defaultedConfig:o,defaultedHighlight:a}=Ue(n),{modelValue:s,year:c,month:d,calendars:u}=Ri(n,e),f=l.computed(()=>vd(n.formatLocale,n.locale,n.monthNameFormat)),p=l.ref(null),{selectYear:h,groupedYears:m,showYearPicker:v,toggleYearPicker:w,handleYearSelect:x,handleYear:C,isDisabled:N}=Vd({modelValue:s,multiCalendars:t,highlight:a,calendars:u,year:c,month:d,props:n,emit:e});l.onMounted(()=>{n.startDate&&(s.value&&n.focusStartDate||!s.value)&&h(be(G(n.startDate)),0)});const y=$=>$?{month:Se($),year:be($)}:{month:null,year:null},_=()=>s.value?Array.isArray(s.value)?s.value.map($=>y($)):y(s.value):y(),k=($,Y)=>{const b=u.value[$],g=_();return Array.isArray(g)?g.some(S=>S.year===(b==null?void 0:b.year)&&S.month===Y):(b==null?void 0:b.year)===g.year&&Y===g.month},E=($,Y,b)=>{var g,S;const O=_();return Array.isArray(O)?c.value(Y)===((g=O[b])==null?void 0:g.year)&&$===((S=O[b])==null?void 0:S.month):!1},j=($,Y)=>{if(n.range){const b=_();if(Array.isArray(s.value)&&Array.isArray(b)){const g=E($,Y,0)||E($,Y,1),S=Dn(Kt(G()),$,c.value(Y));return Ao(s.value,p.value,S)&&!g}return!1}return!1},I=l.computed(()=>$=>Yr(f.value,Y=>{const b=k($,Y.value),g=Bi(Y.value,Cd(c.value($),n.minDate),Md(c.value($),n.maxDate))||Nv(n.disabledDates,c.value($)).includes(Y.value),S=j(Y.value,$),O=Nd(a.value,Y.value,c.value($));return{active:b,disabled:g,isBetween:S,highlighted:O}})),M=($,Y)=>Dn(Kt(G()),$,c.value(Y)),B=($,Y)=>{const b=s.value?s.value:Kt(new Date);s.value=Dn(b,$,c.value(Y)),e("auto-apply")},H=($,Y)=>{const b=Cs(s,M($,Y),e);Io(b,e,n.autoApply,n.modelAuto)},W=($,Y)=>{xs(M($,Y),s,n.multiDatesLimit),e("auto-apply",!0)},L=($,Y)=>(u.value[Y].month=$,R(Y,u.value[Y].year,$),n.multiDates?W($,Y):n.range?H($,Y):B($,Y)),T=($,Y)=>{h($,Y),R(Y,$,null)},R=($,Y,b)=>{let g=b;if(!g){const S=_();g=Array.isArray(S)?S[$].month:S.month}e("update-month-year",{instance:$,year:Y,month:g})};return{groupedMonths:I,groupedYears:m,year:c,isDisabled:N,defaultedMultiCalendars:t,defaultedAriaLabels:r,defaultedTransitions:i,defaultedConfig:o,showYearPicker:v,modelValue:s,presetDate:($,Y)=>{Rd({value:$,modelValue:s,range:n.range,timezone:Y?void 0:n.timezone}),e("auto-apply")},setHoverDate:($,Y)=>{p.value=M($,Y)},selectMonth:L,selectYear:T,toggleYearPicker:w,handleYearSelect:x,handleYear:C,getModelMonthYear:_}},fb=l.defineComponent({compatConfig:{MODE:3},__name:"MonthPicker",props:{...Jt},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","mount"],setup(n,{expose:e,emit:t}){const r=t,i=l.useSlots(),o=Et(i,"yearMode"),a=n;l.onMounted(()=>{a.shadow||r("mount",null)});const{groupedMonths:s,groupedYears:c,year:d,isDisabled:u,defaultedMultiCalendars:f,defaultedConfig:p,showYearPicker:h,modelValue:m,presetDate:v,setHoverDate:w,selectMonth:x,selectYear:C,toggleYearPicker:N,handleYearSelect:y,handleYear:_,getModelMonthYear:k}=ub(a,r);return e({getSidebarProps:()=>({modelValue:m,year:d,getModelMonthYear:k,selectMonth:x,selectYear:C,handleYear:_}),presetDate:v,toggleYearPicker:E=>N(0,E)}),(E,j)=>(l.openBlock(),l.createBlock(Po,{"multi-calendars":l.unref(f).count,stretch:""},{default:l.withCtx(({instance:I})=>[E.$slots["month-year"]?l.renderSlot(E.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{year:l.unref(d),months:l.unref(s)(I),years:l.unref(c)(I),selectMonth:l.unref(x),selectYear:l.unref(C),instance:I}))):(l.openBlock(),l.createBlock(Vi,{key:1,items:l.unref(s)(I),"arrow-navigation":E.arrowNavigation,"is-last":E.autoApply&&!l.unref(p).keepActionRow,"esc-close":E.escClose,height:l.unref(p).modeHeight,config:E.config,"no-overlay-focus":E.noOverlayFocus,"use-relative":"",type:"month",onSelected:M=>l.unref(x)(M,I),onHoverValue:M=>l.unref(w)(M,I)},{header:l.withCtx(()=>[l.createVNode(Id,l.mergeProps(E.$props,{items:l.unref(c)(I),instance:I,"show-year-picker":l.unref(h)[I],year:l.unref(d)(I),"is-disabled":M=>l.unref(u)(I,M),onHandleYear:M=>l.unref(_)(I,M),onYearSelect:M=>l.unref(y)(M,I),onToggleYearPicker:M=>l.unref(N)(I,M==null?void 0:M.flow,M==null?void 0:M.show)}),l.createSlots({_:2},[l.renderList(l.unref(o),(M,B)=>({name:M,fn:l.withCtx(H=>[l.renderSlot(E.$slots,M,l.normalizeProps(l.guardReactiveProps(H)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars"]))}}),pb=(n,e)=>{const{modelValue:t}=Ri(n,e),r=l.ref(null),{defaultedHighlight:i}=Ue(n),o=l.ref();l.onMounted(()=>{n.startDate&&(t.value&&n.focusStartDate||!t.value)&&(o.value=be(G(n.startDate)))});const a=u=>Array.isArray(t.value)?t.value.some(f=>be(f)===u):t.value?be(t.value)===u:!1,s=u=>n.range&&Array.isArray(t.value)?Ao(t.value,r.value,d(u)):!1,c=l.computed(()=>Yr(us(n.yearRange,n.reverseYears),u=>{const f=a(u.value),p=Bi(u.value,jr(n.minDate),jr(n.maxDate)),h=s(u.value),m=ys(i.value,u.value);return{active:f,disabled:p,isBetween:h,highlighted:m}})),d=u=>fn(Kt(new Date),u);return{groupedYears:c,modelValue:t,focusYear:o,setHoverValue:u=>{r.value=fn(Kt(new Date),u)},selectYear:u=>{var f;if(n.multiDates)return t.value?Array.isArray(t.value)&&(((f=t.value)==null?void 0:f.map(p=>be(p))).includes(u)?t.value=t.value.filter(p=>be(p)!==u):t.value.push(fn(kt(G()),u))):t.value=[fn(kt(G()),u)],e("auto-apply",!0);if(n.range){const p=Cs(t,d(u),e);return Io(p,e,n.autoApply,n.modelAuto)}t.value=d(u),e("auto-apply")}}},hb=l.defineComponent({compatConfig:{MODE:3},__name:"YearPicker",props:{...Jt},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply"],setup(n,{expose:e,emit:t}){const r=t,i=n,{groupedYears:o,modelValue:a,focusYear:s,selectYear:c,setHoverValue:d}=pb(i,r),{defaultedConfig:u}=Ue(i);return e({getSidebarProps:()=>({modelValue:a,selectYear:c})}),(f,p)=>(l.openBlock(),l.createElementBlock("div",null,[f.$slots["month-year"]?l.renderSlot(f.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{years:l.unref(o),selectYear:l.unref(c)}))):(l.openBlock(),l.createBlock(Vi,{key:1,items:l.unref(o),"is-last":f.autoApply&&!l.unref(u).keepActionRow,height:l.unref(u).modeHeight,config:f.config,"no-overlay-focus":f.noOverlayFocus,"focus-value":l.unref(s),type:"year","use-relative":"",onSelected:l.unref(c),onHoverValue:l.unref(d)},l.createSlots({_:2},[f.$slots["year-overlay-value"]?{name:"item",fn:l.withCtx(({item:h})=>[l.renderSlot(f.$slots,"year-overlay-value",{text:h.text,value:h.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),mb={key:0,class:"dp__time_input"},gb=["aria-label","onKeydown","onClick"],yb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),vb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),bb=["aria-label","disabled","onKeydown","onClick"],wb=["aria-label","onKeydown","onClick"],kb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),xb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),Cb={key:0},Mb=["aria-label","onKeydown"],Sb=l.defineComponent({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...Jt},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","am-pm-change"],setup(n,{expose:e,emit:t}){const r=t,i=n,{setTimePickerElements:o,setTimePickerBackRef:a}=Hn(),{defaultedAriaLabels:s,defaultedTransitions:c,defaultedFilters:d,defaultedConfig:u}=Ue(i),{transitionName:f,showTransition:p}=Ii(c),h=l.reactive({hours:!1,minutes:!1,seconds:!1}),m=l.ref("AM"),v=l.ref(null),w=l.ref([]);l.onMounted(()=>{r("mounted")});const x=D=>Pe(new Date,{hours:D.hours,minutes:D.minutes,seconds:i.enableSeconds?D.seconds:0,milliseconds:0}),C=l.computed(()=>D=>L(D,i[D])||y(D,i[D])),N=l.computed(()=>({hours:i.hours,minutes:i.minutes,seconds:i.seconds})),y=(D,ee)=>i.range&&!i.disableTimeRangeValidation?!i.validateTime(D,ee):!1,_=(D,ee)=>{if(i.range&&!i.disableTimeRangeValidation){const ne=ee?+i[`${D}Increment`]:-+i[`${D}Increment`],q=i[D]+ne;return!i.validateTime(D,q)}return!1},k=l.computed(()=>D=>!R(+i[D]+ +i[`${D}Increment`],D)||_(D,!0)),E=l.computed(()=>D=>!R(+i[D]-+i[`${D}Increment`],D)||_(D,!1)),j=(D,ee)=>Dc(Pe(G(),D),ee),I=(D,ee)=>H0(Pe(G(),D),ee),M=l.computed(()=>({dp__time_col:!0,dp__time_col_block:!i.timePickerInline,dp__time_col_reg_block:!i.enableSeconds&&i.is24&&!i.timePickerInline,dp__time_col_reg_inline:!i.enableSeconds&&i.is24&&i.timePickerInline,dp__time_col_reg_with_button:!i.enableSeconds&&!i.is24,dp__time_col_sec:i.enableSeconds&&i.is24,dp__time_col_sec_with_button:i.enableSeconds&&!i.is24})),B=l.computed(()=>{const D=[{type:"hours"},{type:"",separator:!0},{type:"minutes"}];return i.enableSeconds?D.concat([{type:"",separator:!0},{type:"seconds"}]):D}),H=l.computed(()=>B.value.filter(D=>!D.separator)),W=l.computed(()=>D=>{if(D==="hours"){const ee=S(+i.hours);return{text:ee<10?`0${ee}`:`${ee}`,value:ee}}return{text:i[D]<10?`0${i[D]}`:`${i[D]}`,value:i[D]}}),L=(D,ee)=>{var ne;if(!i.disabledTimesConfig)return!1;const q=i.disabledTimesConfig(i.order,D==="hours"?ee:void 0);return q[D]?!!((ne=q[D])!=null&&ne.includes(ee)):!0},T=D=>{const ee=i.is24?24:12,ne=D==="hours"?ee:60,q=+i[`${D}GridIncrement`],le=D==="hours"&&!i.is24?q:0,oe=[];for(let U=le;U<ne;U+=q)oe.push({value:U,text:U<10?`0${U}`:`${U}`});return D==="hours"&&!i.is24&&oe.push({value:0,text:"12"}),Yr(oe,U=>({active:!1,disabled:d.value.times[D].includes(U.value)||!R(U.value,D)||L(D,U.value)||y(D,U.value)}))},R=(D,ee)=>{const ne=i.minTime?x(fs(i.minTime)):null,q=i.maxTime?x(fs(i.maxTime)):null,le=x(fs(N.value,ee,D));return ne&&q?(Ei(le,q)||zr(le,q))&&(Oi(le,ne)||zr(le,ne)):ne?Oi(le,ne)||zr(le,ne):q?Ei(le,q)||zr(le,q):!0},$=D=>i[`no${D[0].toUpperCase()+D.slice(1)}Overlay`],Y=D=>{$(D)||(h[D]=!h[D],h[D]||r("overlay-closed"))},b=D=>D==="hours"?qt:D==="minutes"?cn:Fr,g=(D,ee=!0)=>{const ne=ee?j:I,q=ee?+i[`${D}Increment`]:-+i[`${D}Increment`];R(+i[D]+q,D)&&r(`update:${D}`,b(D)(ne({[D]:+i[D]},{[D]:+i[`${D}Increment`]})))},S=D=>i.is24?D:(D>=12?m.value="PM":m.value="AM",yv(D)),O=()=>{m.value==="PM"?(m.value="AM",r("update:hours",i.hours-12)):(m.value="PM",r("update:hours",i.hours+12)),r("am-pm-change",m.value)},F=D=>{h[D]=!0},z=(D,ee,ne)=>{if(D&&i.arrowNavigation){Array.isArray(w.value[ee])?w.value[ee][ne]=D:w.value[ee]=[D];const q=w.value.reduce((le,oe)=>oe.map((U,Z)=>[...le[Z]||[],oe[Z]]),[]);a(i.closeTimePickerBtn),v.value&&(q[1]=q[1].concat(v.value)),o(q,i.order)}},P=(D,ee)=>(Y(D),D==="hours"&&!i.is24?r(`update:${D}`,m.value==="PM"?ee+12:ee):r(`update:${D}`,ee));return e({openChildCmp:F}),(D,ee)=>{var ne;return D.disabled?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",mb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(B.value,(q,le)=>{var oe,U,Z;return l.openBlock(),l.createElementBlock("div",{key:le,class:l.normalizeClass(M.value)},[q.separator?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(" : ")],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("button",{ref_for:!0,ref:he=>z(he,le,0),type:"button",class:l.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_top:D.timePickerInline,dp__inc_dec_button_disabled:k.value(q.type)}),"aria-label":(oe=l.unref(s))==null?void 0:oe.incrementValue(q.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(he=>g(q.type),["prevent"]),["enter"]),l.withKeys(l.withModifiers(he=>g(q.type),["prevent"]),["space"])],onClick:he=>g(q.type)},[i.timePickerInline?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[yb,vb],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[D.$slots["arrow-up"]?l.renderSlot(D.$slots,"arrow-up",{key:0}):l.createCommentVNode("",!0),D.$slots["arrow-up"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ga),{key:1}))],64))],42,gb),l.createElementVNode("button",{ref_for:!0,ref:he=>z(he,le,1),type:"button","aria-label":(U=l.unref(s))==null?void 0:U.openTpOverlay(q.type),class:l.normalizeClass({dp__time_display:!0,dp__time_display_block:!D.timePickerInline,dp__time_display_inline:D.timePickerInline,"dp--time-invalid":C.value(q.type),"dp--time-overlay-btn":!C.value(q.type)}),disabled:$(q.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(he=>Y(q.type),["prevent"]),["enter"]),l.withKeys(l.withModifiers(he=>Y(q.type),["prevent"]),["space"])],onClick:he=>Y(q.type)},[D.$slots[q.type]?l.renderSlot(D.$slots,q.type,{key:0,text:W.value(q.type).text,value:W.value(q.type).value}):l.createCommentVNode("",!0),D.$slots[q.type]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(W.value(q.type).text),1)],64))],42,bb),l.createElementVNode("button",{ref_for:!0,ref:he=>z(he,le,2),type:"button",class:l.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_bottom:D.timePickerInline,dp__inc_dec_button_disabled:E.value(q.type)}),"aria-label":(Z=l.unref(s))==null?void 0:Z.decrementValue(q.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(he=>g(q.type,!1),["prevent"]),["enter"]),l.withKeys(l.withModifiers(he=>g(q.type,!1),["prevent"]),["space"])],onClick:he=>g(q.type,!1)},[i.timePickerInline?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[kb,xb],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[D.$slots["arrow-down"]?l.renderSlot(D.$slots,"arrow-down",{key:0}):l.createCommentVNode("",!0),D.$slots["arrow-down"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Qa),{key:1}))],64))],42,wb)],64))],2)}),128)),D.is24?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",Cb,[D.$slots["am-pm-button"]?l.renderSlot(D.$slots,"am-pm-button",{key:0,toggle:O,value:m.value}):l.createCommentVNode("",!0),D.$slots["am-pm-button"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("button",{key:1,ref_key:"amPmButton",ref:v,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(ne=l.unref(s))==null?void 0:ne.amPmButton,tabindex:"0",onClick:O,onKeydown:[l.withKeys(l.withModifiers(O,["prevent"]),["enter"]),l.withKeys(l.withModifiers(O,["prevent"]),["space"])]},l.toDisplayString(m.value),41,Mb))])),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(H.value,(q,le)=>(l.openBlock(),l.createBlock(l.Transition,{key:le,name:l.unref(f)(h[q.type]),css:l.unref(p)},{default:l.withCtx(()=>[h[q.type]?(l.openBlock(),l.createBlock(Vi,{key:0,items:T(q.type),"is-last":D.autoApply&&!l.unref(u).keepActionRow,"esc-close":D.escClose,type:q.type,"text-input":D.textInput,config:D.config,"arrow-navigation":D.arrowNavigation,onSelected:oe=>P(q.type,oe),onToggle:oe=>Y(q.type),onResetFlow:ee[0]||(ee[0]=oe=>D.$emit("reset-flow"))},l.createSlots({"button-icon":l.withCtx(()=>[D.$slots["clock-icon"]?l.renderSlot(D.$slots,"clock-icon",{key:0}):l.createCommentVNode("",!0),D.$slots["clock-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ka),{key:1}))]),_:2},[D.$slots[`${q.type}-overlay-value`]?{name:"item",fn:l.withCtx(({item:oe})=>[l.renderSlot(D.$slots,`${q.type}-overlay-value`,{text:oe.text,value:oe.value})]),key:"0"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","onSelected","onToggle"])):l.createCommentVNode("",!0)]),_:2},1032,["name","css"]))),128))]))}}}),Tb={class:"dp--tp-wrap"},Db=["aria-label","tabindex"],Ab=["tabindex"],Ob=["aria-label"],$d=l.defineComponent({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...Jt},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(n,{expose:e,emit:t}){const r=t,i=n,{buildMatrix:o,setTimePicker:a}=Hn(),s=l.useSlots(),{defaultedTransitions:c,defaultedAriaLabels:d,defaultedTextInput:u,defaultedConfig:f}=Ue(i),{transitionName:p,showTransition:h}=Ii(c),{hideNavigationButtons:m}=_o(),v=l.ref(null),w=l.ref(null),x=l.ref([]),C=l.ref(null);l.onMounted(()=>{r("mount"),!i.timePicker&&i.arrowNavigation?o([Xe(v.value)],"time"):a(!0,i.timePicker)});const N=l.computed(()=>i.range&&i.modelAuto?bd(i.internalModelValue):!0),y=l.ref(!1),_=T=>({hours:Array.isArray(i.hours)?i.hours[T]:i.hours,minutes:Array.isArray(i.minutes)?i.minutes[T]:i.minutes,seconds:Array.isArray(i.seconds)?i.seconds[T]:i.seconds}),k=l.computed(()=>{const T=[];if(i.range)for(let R=0;R<2;R++)T.push(_(R));else T.push(_(0));return T}),E=(T,R=!1,$="")=>{R||r("reset-flow"),y.value=T,r(T?"overlay-opened":"overlay-closed"),i.arrowNavigation&&a(T),l.nextTick(()=>{$!==""&&x.value[0]&&x.value[0].openChildCmp($)})},j=l.computed(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:i.autoApply&&!f.value.keepActionRow})),I=Et(s,"timePicker"),M=(T,R,$)=>i.range?R===0?[T,k.value[1][$]]:[k.value[0][$],T]:T,B=T=>{r("update:hours",T)},H=T=>{r("update:minutes",T)},W=T=>{r("update:seconds",T)},L=()=>{if(C.value&&!u.value.enabled&&!i.noOverlayFocus){const T=bv(C.value);T&&T.focus({preventScroll:!0})}};return e({toggleTimePicker:E}),(T,R)=>{var $;return l.openBlock(),l.createElementBlock("div",Tb,[!T.timePicker&&!T.timePickerInline?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:0,ref_key:"openTimePickerBtn",ref:v,type:"button",class:l.normalizeClass(j.value),"aria-label":($=l.unref(d))==null?void 0:$.openTimePicker,tabindex:T.noOverlayFocus?void 0:0,onKeydown:[R[0]||(R[0]=l.withKeys(Y=>E(!0),["enter"])),R[1]||(R[1]=l.withKeys(Y=>E(!0),["space"]))],onClick:R[2]||(R[2]=Y=>E(!0))},[T.$slots["clock-icon"]?l.renderSlot(T.$slots,"clock-icon",{key:0}):l.createCommentVNode("",!0),T.$slots["clock-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ka),{key:1}))],42,Db)),[[l.vShow,!l.unref(m)(T.hideNavigation,"time")]]):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:l.unref(p)(y.value),css:l.unref(h)&&!T.timePickerInline},{default:l.withCtx(()=>{var Y;return[y.value||T.timePicker||T.timePickerInline?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:C,class:l.normalizeClass({dp__overlay:!T.timePickerInline,"dp--overlay-absolute":!i.timePicker&&!T.timePickerInline,"dp--overlay-relative":i.timePicker}),style:l.normalizeStyle(T.timePicker?{height:`${l.unref(f).modeHeight}px`}:void 0),tabindex:T.timePickerInline?void 0:0},[l.createElementVNode("div",{class:l.normalizeClass(T.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[T.$slots["time-picker-overlay"]?l.renderSlot(T.$slots,"time-picker-overlay",{key:0,hours:n.hours,minutes:n.minutes,seconds:n.seconds,setHours:B,setMinutes:H,setSeconds:W}):l.createCommentVNode("",!0),T.$slots["time-picker-overlay"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(T.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(k.value,(b,g)=>l.withDirectives((l.openBlock(),l.createBlock(Sb,l.mergeProps({key:g},{...T.$props,order:g,hours:b.hours,minutes:b.minutes,seconds:b.seconds,closeTimePickerBtn:w.value,disabledTimesConfig:n.disabledTimesConfig,disabled:g===0?T.fixedStart:T.fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:x,"validate-time":(S,O)=>n.validateTime(S,M(O,g,S)),"onUpdate:hours":S=>B(M(S,g,"hours")),"onUpdate:minutes":S=>H(M(S,g,"minutes")),"onUpdate:seconds":S=>W(M(S,g,"seconds")),onMounted:L,onOverlayClosed:L,onAmPmChange:R[3]||(R[3]=S=>T.$emit("am-pm-change",S))}),l.createSlots({_:2},[l.renderList(l.unref(I),(S,O)=>({name:S,fn:l.withCtx(F=>[l.renderSlot(T.$slots,S,l.normalizeProps(l.guardReactiveProps(F)))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[l.vShow,g===0?!0:N.value]])),128))],2)),!T.timePicker&&!T.timePickerInline?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:2,ref_key:"closeTimePickerBtn",ref:w,type:"button",class:l.normalizeClass(j.value),"aria-label":(Y=l.unref(d))==null?void 0:Y.closeTimePicker,tabindex:"0",onKeydown:[R[4]||(R[4]=l.withKeys(b=>E(!1),["enter"])),R[5]||(R[5]=l.withKeys(b=>E(!1),["space"]))],onClick:R[6]||(R[6]=b=>E(!1))},[T.$slots["calendar-icon"]?l.renderSlot(T.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),T.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(_i),{key:1}))],42,Ob)),[[l.vShow,!l.unref(m)(T.hideNavigation,"time")]]):l.createCommentVNode("",!0)],2)],14,Ab)):l.createCommentVNode("",!0)]}),_:3},8,["name","css"])])}}}),Ld=(n,e,t,r)=>{const i=(x,C)=>Array.isArray(e[x])?e[x][C]:e[x],o=x=>n.enableSeconds?Array.isArray(e.seconds)?e.seconds[x]:e.seconds:0,a=(x,C)=>x?C!==void 0?Fn(x,i("hours",C),i("minutes",C),o(C)):Fn(x,e.hours,e.minutes,o()):Ua(G(),o(C)),s=(x,C)=>{e[x]=C},c=(x,C)=>{const N=Object.fromEntries(Object.keys(e).map(y=>y===x?[y,C]:[y,e[y]].slice()));if(n.range&&!n.disableTimeRangeValidation){const y=k=>t.value?Fn(t.value[k],N.hours[k],N.minutes[k],N.seconds[k]):null,_=k=>ja(t.value[k],0);return!(Ee(y(0),y(1))&&(Oi(y(0),_(1))||Ei(y(1),_(0))))}return!0},d=(x,C)=>{c(x,C)&&(s(x,C),r&&r())},u=x=>{d("hours",x)},f=x=>{d("minutes",x)},p=x=>{d("seconds",x)},h=(x,C,N,y)=>{C&&u(x),!C&&!N&&f(x),N&&p(x),t.value&&y(t.value)},m=x=>{if(x){const C=Array.isArray(x),N=C?[+x[0].hours,+x[1].hours]:+x.hours,y=C?[+x[0].minutes,+x[1].minutes]:+x.minutes,_=C?[+x[0].seconds,+x[1].seconds]:+x.seconds;s("hours",N),s("minutes",y),n.enableSeconds&&s("seconds",_)}},v=(x,C)=>{const N={hours:Array.isArray(e.hours)?e.hours[x]:e.hours,disabledArr:[]};return(C||C===0)&&(N.hours=C),Array.isArray(n.disabledTimes)&&(N.disabledArr=n.range&&Array.isArray(n.disabledTimes[x])?n.disabledTimes[x]:n.disabledTimes),N},w=l.computed(()=>(x,C)=>{var N;if(Array.isArray(n.disabledTimes)){const{disabledArr:y,hours:_}=v(x,C),k=y.filter(E=>+E.hours===_);return((N=k[0])==null?void 0:N.minutes)==="*"?{hours:[_],minutes:void 0,seconds:void 0}:{hours:[],minutes:(k==null?void 0:k.map(E=>+E.minutes))??[],seconds:(k==null?void 0:k.map(E=>E.seconds?+E.seconds:void 0))??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:s,updateHours:u,updateMinutes:f,updateSeconds:p,getSetDateTime:a,updateTimeValues:h,getSecondsValue:o,assignStartTime:m,validateTime:c,disabledTimesConfig:w}},Eb=(n,e)=>{const{modelValue:t,time:r}=Ri(n,e),{defaultedStartTime:i}=Ue(n),{updateTimeValues:o,getSetDateTime:a,setTime:s,assignStartTime:c,disabledTimesConfig:d,validateTime:u}=Ld(n,r,t),f=C=>{const{hours:N,minutes:y,seconds:_}=C;return{hours:+N,minutes:+y,seconds:_?+_:0}},p=()=>{if(n.startTime){if(Array.isArray(n.startTime)){const N=f(n.startTime[0]),y=f(n.startTime[1]);return[Pe(G(),N),Pe(G(),y)]}const C=f(n.startTime);return Pe(G(),C)}return n.range?[null,null]:null},h=()=>{if(n.range){const[C,N]=p();t.value=[a(C,0),a(N,1)]}else t.value=a(p())},m=C=>Array.isArray(C)?[hr(G(C[0])),hr(G(C[1]))]:[hr(C??G())],v=(C,N,y)=>{s("hours",C),s("minutes",N),s("seconds",n.enableSeconds?y:0)},w=()=>{const[C,N]=m(t.value);return n.range?v([C.hours,N.hours],[C.minutes,N.minutes],[C.seconds,N.minutes]):v(C.hours,C.minutes,C.seconds)};l.onMounted(()=>{if(!n.shadow)return c(i.value),t.value?w():h()});const x=()=>{Array.isArray(t.value)?t.value=t.value.map((C,N)=>C&&a(C,N)):t.value=a(t.value),e("time-update")};return{modelValue:t,time:r,disabledTimesConfig:d,updateTime:(C,N=!0,y=!1)=>{o(C,N,y,x)},validateTime:u}},Nb=l.defineComponent({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...Jt},emits:["update:internal-model-value","time-update","am-pm-change"],setup(n,{expose:e,emit:t}){const r=t,i=n,o=l.useSlots(),a=Et(o,"timePicker"),{time:s,modelValue:c,disabledTimesConfig:d,updateTime:u,validateTime:f}=Eb(i,r);return e({getSidebarProps:()=>({modelValue:c,time:s,updateTime:u})}),(p,h)=>(l.openBlock(),l.createBlock(Po,{"multi-calendars":0,stretch:""},{default:l.withCtx(()=>[l.createVNode($d,l.mergeProps(p.$props,{hours:l.unref(s).hours,minutes:l.unref(s).minutes,seconds:l.unref(s).seconds,"internal-model-value":p.internalModelValue,"disabled-times-config":l.unref(d),"validate-time":l.unref(f),"onUpdate:hours":h[0]||(h[0]=m=>l.unref(u)(m)),"onUpdate:minutes":h[1]||(h[1]=m=>l.unref(u)(m,!1)),"onUpdate:seconds":h[2]||(h[2]=m=>l.unref(u)(m,!1,!0)),onAmPmChange:h[3]||(h[3]=m=>p.$emit("am-pm-change",m))}),l.createSlots({_:2},[l.renderList(l.unref(a),(m,v)=>({name:m,fn:l.withCtx(w=>[l.renderSlot(p.$slots,m,l.normalizeProps(l.guardReactiveProps(w)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),_b={class:"dp__month_year_row"},Bb=["aria-label","onClick","onKeydown"],Pb=l.defineComponent({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...Jt},emits:["update-month-year","mount","reset-flow","overlay-closed"],setup(n,{expose:e,emit:t}){const r=t,i=n,{defaultedTransitions:o,defaultedAriaLabels:a,defaultedMultiCalendars:s,defaultedFilters:c,defaultedConfig:d,defaultedHighlight:u}=Ue(i),{transitionName:f,showTransition:p}=Ii(o),{buildMatrix:h}=Hn(),{handleMonthYearChange:m,isDisabled:v,updateMonthYear:w}=jv(i,r),{showLeftIcon:x,showRightIcon:C}=_o(),N=l.ref(!1),y=l.ref(!1),_=l.ref([null,null,null,null]);l.onMounted(()=>{r("mount")});const k=g=>({get:()=>i[g],set:S=>{const O=g===Qt.month?Qt.year:Qt.month;r("update-month-year",{[g]:S,[O]:i[O]}),g===Qt.month?L(!0):T(!0)}}),E=l.computed(k(Qt.month)),j=l.computed(k(Qt.year)),I=l.computed(()=>g=>({month:i.month,year:i.year,items:g===Qt.month?i.months:i.years,instance:i.instance,updateMonthYear:w,toggle:g===Qt.month?L:T})),M=l.computed(()=>i.months.find(S=>S.value===i.month)||{text:"",value:0}),B=l.computed(()=>Yr(i.months,g=>{const S=i.month===g.value,O=Bi(g.value,Cd(i.year,i.minDate),Md(i.year,i.maxDate))||c.value.months.includes(g.value),F=Nd(u.value,g.value,i.year);return{active:S,disabled:O,highlighted:F}})),H=l.computed(()=>Yr(i.years,g=>{const S=i.year===g.value,O=Bi(g.value,jr(i.minDate),jr(i.maxDate))||c.value.years.includes(g.value),F=ys(u.value,g.value);return{active:S,disabled:O,highlighted:F}})),W=(g,S)=>{S!==void 0?g.value=S:g.value=!g.value,g.value||r("overlay-closed")},L=(g=!1,S)=>{R(g),W(N,S)},T=(g=!1,S)=>{R(g),W(y,S)},R=g=>{g||r("reset-flow")},$=(g,S)=>{i.arrowNavigation&&(_.value[S]=Xe(g),h(_.value,"monthYear"))},Y=l.computed(()=>{var g,S;return[{type:Qt.month,index:1,toggle:L,modelValue:E.value,updateModelValue:O=>E.value=O,text:M.value.text,showSelectionGrid:N.value,items:B.value,ariaLabel:(g=a.value)==null?void 0:g.openMonthsOverlay},{type:Qt.year,index:2,toggle:T,modelValue:j.value,updateModelValue:O=>j.value=O,text:i.year,showSelectionGrid:y.value,items:H.value,ariaLabel:(S=a.value)==null?void 0:S.openYearsOverlay}]}),b=l.computed(()=>i.disableYearSelect?[Y.value[0]]:i.yearFirst?[...Y.value].reverse():Y.value);return e({toggleMonthPicker:L,toggleYearPicker:T,handleMonthYearChange:m}),(g,S)=>{var O,F,z;return l.openBlock(),l.createElementBlock("div",_b,[g.$slots["month-year"]?l.renderSlot(g.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{month:n.month,year:n.year,months:n.months,years:n.years,updateMonthYear:l.unref(w),handleMonthYearChange:l.unref(m),instance:n.instance}))):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.unref(x)(l.unref(s),n.instance)&&!g.vertical?(l.openBlock(),l.createBlock($i,{key:0,"aria-label":(O=l.unref(a))==null?void 0:O.prevMonth,disabled:l.unref(v)(!1),onActivate:S[0]||(S[0]=P=>l.unref(m)(!1,!0)),onSetRef:S[1]||(S[1]=P=>$(P,0))},{default:l.withCtx(()=>[g.$slots["arrow-left"]?l.renderSlot(g.$slots,"arrow-left",{key:0}):l.createCommentVNode("",!0),g.$slots["arrow-left"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Wa),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["dp__month_year_wrap",{dp__year_disable_select:g.disableYearSelect}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b.value,(P,D)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:P.type},[l.createElementVNode("button",{ref_for:!0,ref:ee=>$(ee,D+1),type:"button",class:"dp__btn dp__month_year_select",tabindex:"0","aria-label":P.ariaLabel,onClick:P.toggle,onKeydown:[l.withKeys(l.withModifiers(P.toggle,["prevent"]),["enter"]),l.withKeys(l.withModifiers(P.toggle,["prevent"]),["space"])]},[g.$slots[P.type]?l.renderSlot(g.$slots,P.type,{key:0,text:P.text,value:i[P.type]}):l.createCommentVNode("",!0),g.$slots[P.type]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(P.text),1)],64))],40,Bb),l.createVNode(l.Transition,{name:l.unref(f)(P.showSelectionGrid),css:l.unref(p)},{default:l.withCtx(()=>[P.showSelectionGrid?(l.openBlock(),l.createBlock(Vi,{key:0,items:P.items,"arrow-navigation":g.arrowNavigation,"hide-navigation":g.hideNavigation,"is-last":g.autoApply&&!l.unref(d).keepActionRow,"skip-button-ref":!1,config:g.config,type:P.type,"header-refs":[],"esc-close":g.escClose,"text-input":g.textInput,onSelected:P.updateModelValue,onToggle:P.toggle},l.createSlots({"button-icon":l.withCtx(()=>[g.$slots["calendar-icon"]?l.renderSlot(g.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),g.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(_i),{key:1}))]),_:2},[g.$slots[`${P.type}-overlay-value`]?{name:"item",fn:l.withCtx(({item:ee})=>[l.renderSlot(g.$slots,`${P.type}-overlay-value`,{text:ee.text,value:ee.value})]),key:"0"}:void 0,g.$slots[`${P.type}-overlay`]?{name:"overlay",fn:l.withCtx(()=>[l.renderSlot(g.$slots,`${P.type}-overlay`,l.normalizeProps(l.guardReactiveProps(I.value(P.type))))]),key:"1"}:void 0,g.$slots[`${P.type}-overlay-header`]?{name:"header",fn:l.withCtx(()=>[l.renderSlot(g.$slots,`${P.type}-overlay-header`,{toggle:P.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","text-input","onSelected","onToggle"])):l.createCommentVNode("",!0)]),_:2},1032,["name","css"])],64))),128))],2),l.unref(x)(l.unref(s),n.instance)&&g.vertical?(l.openBlock(),l.createBlock($i,{key:1,"aria-label":(F=l.unref(a))==null?void 0:F.prevMonth,disabled:l.unref(v)(!1),onActivate:S[2]||(S[2]=P=>l.unref(m)(!1,!0))},{default:l.withCtx(()=>[g.$slots["arrow-up"]?l.renderSlot(g.$slots,"arrow-up",{key:0}):l.createCommentVNode("",!0),g.$slots["arrow-up"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ga),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.unref(C)(l.unref(s),n.instance)?(l.openBlock(),l.createBlock($i,{key:2,ref:"rightIcon",disabled:l.unref(v)(!0),"aria-label":(z=l.unref(a))==null?void 0:z.nextMonth,onActivate:S[3]||(S[3]=P=>l.unref(m)(!0,!0)),onSetRef:S[4]||(S[4]=P=>$(P,g.disableYearSelect?2:3))},{default:l.withCtx(()=>[g.$slots[g.vertical?"arrow-down":"arrow-right"]?l.renderSlot(g.$slots,g.vertical?"arrow-down":"arrow-right",{key:0}):l.createCommentVNode("",!0),g.$slots[g.vertical?"arrow-down":"arrow-right"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.vertical?l.unref(Qa):l.unref(qa)),{key:1}))]),_:3},8,["disabled","aria-label"])):l.createCommentVNode("",!0)],64))])}}}),Ib=["aria-label"],Rb={class:"dp__calendar_header",role:"row"},Vb={key:0,class:"dp__calendar_header_item",role:"gridcell"},$b=l.createElementVNode("div",{class:"dp__calendar_header_separator"},null,-1),Lb=["aria-label"],Fb={key:0,role:"gridcell",class:"dp__calendar_item dp__week_num"},zb={class:"dp__cell_inner"},Hb=["id","aria-selected","aria-disabled","aria-label","onClick","onKeydown","onMouseenter","onMouseleave"],Yb=l.defineComponent({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...Jt},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(n,{expose:e,emit:t}){const r=t,i=n,{buildMultiLevelMatrix:o}=Hn(),{defaultedTransitions:a,defaultedConfig:s,defaultedAriaLabels:c,defaultedMultiCalendars:d,defaultedWeekNumbers:u}=Ue(i),f=l.ref(null),p=l.ref({bottom:"",left:"",transform:""}),h=l.ref([]),m=l.ref(null),v=l.ref(!0),w=l.ref(""),x=l.ref({startX:0,endX:0,startY:0,endY:0}),C=l.ref([]),N=l.ref({left:"50%"}),y=l.computed(()=>i.calendar?i.calendar(i.mappedDates):i.mappedDates),_=l.computed(()=>i.dayNames?Array.isArray(i.dayNames)?i.dayNames:i.dayNames(i.locale,+i.weekStart):gv(i.formatLocale,i.locale,+i.weekStart));l.onMounted(()=>{r("mount",{cmp:"calendar",refs:h}),s.value.noSwipe||m.value&&(m.value.addEventListener("touchstart",T,{passive:!1}),m.value.addEventListener("touchend",R,{passive:!1}),m.value.addEventListener("touchmove",$,{passive:!1})),i.monthChangeOnScroll&&m.value&&m.value.addEventListener("wheel",g,{passive:!1})});const k=P=>P?i.vertical?"vNext":"next":i.vertical?"vPrevious":"previous",E=(P,D)=>{if(i.transitions){const ee=kt(Dn(G(),i.month,i.year));w.value=dt(kt(Dn(G(),P,D)),ee)?a.value[k(!0)]:a.value[k(!1)],v.value=!1,l.nextTick(()=>{v.value=!0})}},j=l.computed(()=>({[i.calendarClassName]:!!i.calendarClassName})),I=l.computed(()=>P=>{const D=vv(P);return{dp__marker_dot:D.type==="dot",dp__marker_line:D.type==="line"}}),M=l.computed(()=>P=>Ee(P,f.value)),B=l.computed(()=>({dp__calendar:!0,dp__calendar_next:d.value.count>0&&i.instance!==0})),H=l.computed(()=>P=>i.hideOffsetDates?P.current:!0),W=async(P,D,ee)=>{var ne,q;if(r("set-hover-date",P),(q=(ne=P.marker)==null?void 0:ne.tooltip)!=null&&q.length){const le=Xe(h.value[D][ee]);if(le){const{width:oe,height:U}=le.getBoundingClientRect();f.value=P.value;let Z={left:`${oe/2}px`},he=-50;if(await l.nextTick(),C.value[0]){const{left:te,width:Ae}=C.value[0].getBoundingClientRect();te<0&&(Z={left:"0"},he=0,N.value.left=`${oe/2}px`),window.innerWidth<te+Ae&&(Z={right:"0"},he=0,N.value.left=`${Ae-oe/2}px`)}p.value={bottom:`${U}px`,...Z,transform:`translateX(${he}%)`},r("tooltip-open",P.marker)}}},L=P=>{f.value&&(f.value=null,p.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),r("tooltip-close",P.marker))},T=P=>{x.value.startX=P.changedTouches[0].screenX,x.value.startY=P.changedTouches[0].screenY},R=P=>{x.value.endX=P.changedTouches[0].screenX,x.value.endY=P.changedTouches[0].screenY,Y()},$=P=>{i.vertical&&!i.inline&&P.preventDefault()},Y=()=>{const P=i.vertical?"Y":"X";Math.abs(x.value[`start${P}`]-x.value[`end${P}`])>10&&r("handle-swipe",x.value[`start${P}`]>x.value[`end${P}`]?"right":"left")},b=(P,D,ee)=>{P&&(Array.isArray(h.value[D])?h.value[D][ee]=P:h.value[D]=[P]),i.arrowNavigation&&o(h.value,"calendar")},g=P=>{i.monthChangeOnScroll&&(P.preventDefault(),r("handle-scroll",P))},S=P=>u.value.type==="local"?Ay(P.value,{weekStartsOn:+i.weekStart}):u.value.type==="iso"?My(P.value):typeof u.value.type=="function"?u.value.type(P.value):"",O=P=>{const D=P[0];return u.value.hideOnOffsetDates?P.some(ee=>ee.current)?S(D):"":S(D)},F=(P,D)=>{Ln(P,s.value),r("select-date",D)},z=P=>{Ln(P,s.value)};return e({triggerTransition:E}),(P,D)=>{var ee;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(B.value)},[l.createElementVNode("div",{ref_key:"calendarWrapRef",ref:m,role:"grid",class:l.normalizeClass(j.value),"aria-label":(ee=l.unref(c))==null?void 0:ee.calendarWrap},[(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",Rb,[P.weekNumbers?(l.openBlock(),l.createElementBlock("div",Vb,l.toDisplayString(P.weekNumName),1)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,(ne,q)=>(l.openBlock(),l.createElementBlock("div",{key:q,class:"dp__calendar_header_item",role:"gridcell"},[P.$slots["calendar-header"]?l.renderSlot(P.$slots,"calendar-header",{key:0,day:ne,index:q}):l.createCommentVNode("",!0),P.$slots["calendar-header"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(ne),1)],64))]))),128))]),$b,l.createVNode(l.Transition,{name:w.value,css:!!P.transitions},{default:l.withCtx(()=>{var ne;return[v.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__calendar",role:"rowgroup","aria-label":((ne=l.unref(c))==null?void 0:ne.calendarDays)||void 0},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(y.value,(q,le)=>(l.openBlock(),l.createElementBlock("div",{key:le,class:"dp__calendar_row",role:"row"},[P.weekNumbers?(l.openBlock(),l.createElementBlock("div",Fb,[l.createElementVNode("div",zb,l.toDisplayString(O(q.days)),1)])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(q.days,(oe,U)=>{var Z,he,te;return l.openBlock(),l.createElementBlock("div",{id:oe.value.toISOString().split("T")[0],ref_for:!0,ref:Ae=>b(Ae,le,U),key:U+le,role:"gridcell",class:"dp__calendar_item","aria-selected":oe.classData.dp__active_date||oe.classData.dp__range_start||oe.classData.dp__range_start,"aria-disabled":oe.classData.dp__cell_disabled||void 0,"aria-label":(he=(Z=l.unref(c))==null?void 0:Z.day)==null?void 0:he.call(Z,oe),tabindex:"0",onClick:l.withModifiers(Ae=>F(Ae,oe),["prevent"]),onKeydown:[l.withKeys(Ae=>P.$emit("select-date",oe),["enter"]),l.withKeys(Ae=>P.$emit("handle-space",oe),["space"])],onMouseenter:Ae=>W(oe,le,U),onMouseleave:Ae=>L(oe)},[l.createElementVNode("div",{class:l.normalizeClass(["dp__cell_inner",oe.classData])},[P.$slots.day&&H.value(oe)?l.renderSlot(P.$slots,"day",{key:0,day:+oe.text,date:oe.value}):l.createCommentVNode("",!0),P.$slots.day?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(oe.text),1)],64)),oe.marker&&H.value(oe)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[P.$slots.marker?l.renderSlot(P.$slots,"marker",{key:0,marker:oe.marker,day:+oe.text,date:oe.value}):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(I.value(oe.marker)),style:l.normalizeStyle(oe.marker.color?{backgroundColor:oe.marker.color}:{})},null,6))],64)):l.createCommentVNode("",!0),M.value(oe.value)?(l.openBlock(),l.createElementBlock("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:C,class:"dp__marker_tooltip",style:l.normalizeStyle(p.value)},[(te=oe.marker)!=null&&te.tooltip?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__tooltip_content",onClick:z},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(oe.marker.tooltip,(Ae,Qe)=>(l.openBlock(),l.createElementBlock("div",{key:Qe,class:"dp__tooltip_text"},[P.$slots["marker-tooltip"]?l.renderSlot(P.$slots,"marker-tooltip",{key:0,tooltip:Ae,day:oe.value}):l.createCommentVNode("",!0),P.$slots["marker-tooltip"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("div",{class:"dp__tooltip_mark",style:l.normalizeStyle(Ae.color?{backgroundColor:Ae.color}:{})},null,4),l.createElementVNode("div",null,l.toDisplayString(Ae.text),1)],64))]))),128)),l.createElementVNode("div",{class:"dp__arrow_bottom_tp",style:l.normalizeStyle(N.value)},null,4)])):l.createCommentVNode("",!0)],4)):l.createCommentVNode("",!0)],2)],40,Hb)}),128))]))),128))],8,Lb)):l.createCommentVNode("",!0)]}),_:3},8,["name","css"])],64))],10,Ib)],2)}}}),Fd=n=>Array.isArray(n),jb=(n,e,t,r)=>{const i=l.ref([]),{modelValue:o,calendars:a,time:s}=Ri(n,e),{defaultedMultiCalendars:c,defaultedStartTime:d}=Ue(n),{validateMonthYearInRange:u,isDisabled:f,isDateRangeAllowed:p,checkMinMaxRange:h}=yr(n),{updateTimeValues:m,getSetDateTime:v,setTime:w,assignStartTime:x,validateTime:C,disabledTimesConfig:N}=Ld(n,s,o,r),y=l.computed(()=>V=>a.value[V]?a.value[V].month:0),_=l.computed(()=>V=>a.value[V]?a.value[V].year:0),k=(V,X,fe)=>{var we,Re;a.value[V]||(a.value[V]={month:0,year:0}),a.value[V].month=kd(X)?(we=a.value[V])==null?void 0:we.month:X,a.value[V].year=kd(fe)?(Re=a.value[V])==null?void 0:Re.year:fe},E=()=>{n.autoApply&&e("select-date")};l.watch(o,(V,X)=>{JSON.stringify(V)!==JSON.stringify(X)&&M()}),l.onMounted(()=>{n.shadow||(o.value||(g(),d.value&&x(d.value)),M(!0),n.focusStartDate&&n.startDate&&g())});const j=l.computed(()=>{var V;return(V=n.flow)!=null&&V.length&&!n.partialFlow?n.flowStep===n.flow.length:!0}),I=()=>{n.autoApply&&j.value&&e("auto-apply",n.partialFlow)},M=(V=!1)=>{if(o.value)return Array.isArray(o.value)?(i.value=o.value,R(V)):H(o.value,V);if(c.value.count&&V&&!n.startDate)return B(G(),V)},B=(V,X=!1)=>{if((!c.value.count||!c.value.static||X)&&k(0,Se(V),be(V)),c.value.count&&!c.value.solo)for(let fe=1;fe<c.value.count;fe++){const we=Pe(G(),{month:y.value(fe-1),year:_.value(fe-1)}),Re=Dc(we,{months:1});a.value[fe]={month:Se(Re),year:be(Re)}}},H=(V,X)=>{B(V),w("hours",qt(V)),w("minutes",cn(V)),w("seconds",Fr(V)),c.value.count&&X&&b()},W=V=>{if(c.value.count){if(c.value.solo)return 0;const X=Se(V[0]),fe=Se(V[1]);return Math.abs(fe-X)<c.value.count?0:1}return 1},L=(V,X)=>{V[1]&&n.showLastInRange?B(V[W(V)],X):B(V[0],X);const fe=(we,Re)=>[we(V[0]),V[1]?we(V[1]):s[Re][1]];w("hours",fe(qt,"hours")),w("minutes",fe(cn,"minutes")),w("seconds",fe(Fr,"seconds"))},T=(V,X)=>{if((n.range||n.weekPicker)&&!n.multiDates)return L(V,X);if(n.multiDates&&X){const fe=V[V.length-1];return H(fe,X)}},R=V=>{const X=o.value;T(X,V),c.value.count&&c.value.solo&&b()},$=(V,X)=>{const fe=Pe(G(),{month:y.value(X),year:_.value(X)}),we=V<0?Wt(fe,1):Hr(fe,1);u(Se(we),be(we),V<0,n.preventMinMaxNavigation)&&(k(X,Se(we),be(we)),e("update-month-year",{instance:X,month:Se(we),year:be(we)}),c.value.count&&!c.value.solo&&Y(X),t())},Y=V=>{for(let X=V-1;X>=0;X--){const fe=Hr(Pe(G(),{month:y.value(X+1),year:_.value(X+1)}),1);k(X,Se(fe),be(fe))}for(let X=V+1;X<=c.value.count-1;X++){const fe=Wt(Pe(G(),{month:y.value(X-1),year:_.value(X-1)}),1);k(X,Se(fe),be(fe))}},b=()=>{if(Array.isArray(o.value)&&o.value.length===2){const V=G(G(o.value[1]?o.value[1]:Wt(o.value[0],1))),[X,fe]=[Se(o.value[0]),be(o.value[0])],[we,Re]=[Se(o.value[1]),be(o.value[1])];(X!==we||X===we&&fe!==Re)&&c.value.solo&&k(1,Se(V),be(V))}else o.value&&!Array.isArray(o.value)&&(k(0,Se(o.value),be(o.value)),B(G()))},g=()=>{n.startDate&&(k(0,Se(G(n.startDate)),be(G(n.startDate))),c.value.count&&Y(0))},S=Cv((V,X)=>{n.monthChangeOnScroll&&$(n.monthChangeOnScroll!=="inverse"?-V.deltaY:V.deltaY,X)},50),O=(V,X,fe=!1)=>{n.monthChangeOnArrows&&n.vertical===fe&&F(V,X)},F=(V,X)=>{$(V==="right"?-1:1,X)},z=V=>n.markers.find(X=>Ee(Tv(V.value),Gt(G(X.date),n.timezone))),P=(V,X)=>{switch(n.sixWeeks===!0?"append":n.sixWeeks){case"prepend":return[!0,!1];case"center":return[V==0,!0];case"fair":return[V==0||X>V,!0];case"append":return[!1,!1];default:return[!1,!1]}},D=(V,X,fe,we)=>{if(n.sixWeeks&&V.length<6){const Re=6-V.length,Ut=(X.getDay()+7-we)%7,A=6-(fe.getDay()+7-we)%7,[K,J]=P(Ut,A);for(let ke=1;ke<=Re;ke++)if(J?!!(ke%2)==K:K){const me=V[0].days[0],We=ee(Tn(me.value,-7),Se(X));V.unshift({days:We})}else{const me=V[V.length-1],We=me.days[me.days.length-1],Ot=ee(Tn(We.value,1),Se(X));V.push({days:Ot})}}return V},ee=(V,X)=>{const fe=G(V),we=[];for(let Re=0;Re<7;Re++){const Ut=Tn(fe,Re),A=Se(Ut)!==X;we.push({text:n.hideOffsetDates&&A?"":Ut.getDate(),value:Ut,current:!A,classData:{}})}return we},ne=(V,X)=>{const fe=[],we=new Date(X,V),Re=new Date(X,V+1,0),Ut=n.weekStart,A=ur(we,{weekStartsOn:Ut}),K=J=>{const ke=ee(J,V);if(fe.push({days:ke}),!fe[fe.length-1].days.some(me=>Ee(kt(me.value),kt(Re)))){const me=Tn(J,7);K(me)}};return K(A),D(fe,we,Re,Ut)},q=V=>(o.value=Oo(G(V.value),n.timezone,n.weekStart),e("date-update",V.value),I()),le=V=>{const X=Fn(G(V.value),s.hours,s.minutes,Yt());e("date-update",X),n.multiDates?xs(X,o,n.multiDatesLimit):o.value=X,r(),l.nextTick().then(()=>{I()})},oe=V=>n.noDisabledRange?Td(i.value[0],V).some(X=>f(X)):!1,U=()=>{i.value=o.value?o.value.slice():[],i.value.length===2&&!(n.fixedStart||n.fixedEnd)&&(i.value=[])},Z=(V,X)=>{const fe=[G(V.value),Tn(G(V.value),+n.autoRange)];p(fe)?(X&&he(V.value),i.value=fe):e("invalid-date",V.value)},he=V=>{const X=Se(G(V)),fe=be(G(V));if(k(0,X,fe),c.value.count>0)for(let we=1;we<c.value.count;we++){const Re=Dv(Pe(G(V),{year:y.value(we-1),month:_.value(we-1)}));k(we,Re.month,Re.year)}},te=V=>Array.isArray(o.value)&&o.value.length===2?n.fixedStart&&(dt(V,o.value[0])||Ee(V,o.value[0]))?[o.value[0],V]:n.fixedEnd&&(ot(V,o.value[1])||Ee(V,o.value[1]))?[V,o.value[1]]:(e("invalid-fixed-range",V),o.value):[],Ae=V=>{if(oe(V.value)||!h(V.value,o.value,n.fixedStart?0:1))return e("invalid-date",V.value);i.value=te(G(V.value))},Qe=(V,X)=>{if(U(),n.autoRange)return Z(V,X);if(n.fixedStart||n.fixedEnd)return Ae(V);i.value[0]?h(G(V.value),o.value)&&!oe(V.value)?ot(G(V.value),G(i.value[0]))?(i.value.unshift(G(V.value)),e("range-end",i.value[0])):(i.value[1]=G(V.value),e("range-end",i.value[1])):(n.autoApply&&e("auto-apply-invalid",V.value),e("invalid-date",V.value)):(i.value[0]=G(V.value),e("range-start",i.value[0]))},Yt=(V=!0)=>n.enableSeconds?Array.isArray(s.seconds)?V?s.seconds[0]:s.seconds[1]:s.seconds:0,on=V=>{i.value[V]=Fn(i.value[V],s.hours[V],s.minutes[V],Yt(V!==1))},At=()=>{var V,X;i.value[0]&&i.value[1]&&+((V=i.value)==null?void 0:V[0])>+((X=i.value)==null?void 0:X[1])&&(i.value.reverse(),e("range-start",i.value[0]),e("range-end",i.value[1]))},jt=()=>{i.value.length&&(i.value[0]&&!i.value[1]?on(0):(on(0),on(1),r()),At(),o.value=i.value.slice(),Io(i.value,e,n.autoApply,n.modelAuto))},an=(V,X=!1)=>{if(f(V.value)||!V.current&&n.hideOffsetDates)return e("invalid-date",V.value);if(n.weekPicker)return q(V);if(!n.range)return le(V);Fd(s.hours)&&Fd(s.minutes)&&!n.multiDates&&(Qe(V,X),jt())},Je=(V,X)=>{var fe;k(V,X.month,X.year),c.value.count&&!c.value.solo&&Y(V),e("update-month-year",{instance:V,month:X.month,year:X.year}),t(c.value.solo?V:void 0);const we=(fe=n.flow)!=null&&fe.length?n.flow[n.flowStep]:void 0;!X.fromNav&&(we===pn.month||we===pn.year)&&r()},Pn=(V,X)=>{Rd({value:V,modelValue:o,range:n.range,timezone:X?void 0:n.timezone}),E(),n.multiCalendars&&l.nextTick().then(()=>M(!0))},cr=()=>{n.range?o.value&&Array.isArray(o.value)&&o.value[0]?o.value=ot(G(),o.value[0])?[G(),o.value[0]]:[o.value[0],G()]:o.value=[G()]:o.value=G(),E()},In=()=>{if(Array.isArray(o.value))if(n.multiDates){const V=dr();o.value[o.value.length-1]=v(V)}else o.value=o.value.map((V,X)=>V&&v(V,X));else o.value=v(o.value);e("time-update")},dr=()=>Array.isArray(o.value)&&o.value.length?o.value[o.value.length-1]:null;return{calendars:a,modelValue:o,month:y,year:_,time:s,disabledTimesConfig:N,validateTime:C,getCalendarDays:ne,getMarker:z,handleScroll:S,handleSwipe:F,handleArrow:O,selectDate:an,updateMonthYear:Je,presetDate:Pn,selectCurrentDate:cr,updateTime:(V,X=!0,fe=!1)=>{m(V,X,fe,In)}}},Ub={key:0},Wb=l.defineComponent({__name:"DatePicker",props:{...Jt},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date"],setup(n,{expose:e,emit:t}){const r=t,i=n,{calendars:o,month:a,year:s,modelValue:c,time:d,disabledTimesConfig:u,validateTime:f,getCalendarDays:p,getMarker:h,handleArrow:m,handleScroll:v,handleSwipe:w,selectDate:x,updateMonthYear:C,presetDate:N,selectCurrentDate:y,updateTime:_}=jb(i,r,b,g),k=l.useSlots(),{setHoverDate:E,getDayClassData:j,clearHoverDate:I}=Kv(c,i),{defaultedMultiCalendars:M}=Ue(i),B=l.ref([]),H=l.ref([]),W=l.ref(null),L=Et(k,"calendar"),T=Et(k,"monthYear"),R=Et(k,"timePicker"),$=O=>{i.shadow||r("mount",O)};l.watch(o,()=>{i.shadow||setTimeout(()=>{r("recalculate-position")},0)},{deep:!0});const Y=l.computed(()=>O=>p(a.value(O),s.value(O)).map(F=>({...F,days:F.days.map(z=>(z.marker=h(z),z.classData=j(z),z))})));function b(O){var F;O||O===0?(F=H.value[O])==null||F.triggerTransition(a.value(O),s.value(O)):H.value.forEach((z,P)=>z.triggerTransition(a.value(P),s.value(P)))}function g(){r("update-flow-step")}const S=(O,F=!1)=>{x(O,F),i.spaceConfirm&&r("select-date")};return e({clearHoverDate:I,presetDate:N,selectCurrentDate:y,toggleMonthPicker:(O,F,z=0)=>{var P;(P=B.value[z])==null||P.toggleMonthPicker(O,F)},toggleYearPicker:(O,F,z=0)=>{var P;(P=B.value[z])==null||P.toggleYearPicker(O,F)},toggleTimePicker:(O,F,z)=>{var P;(P=W.value)==null||P.toggleTimePicker(O,F,z)},handleArrow:m,updateMonthYear:C,getSidebarProps:()=>({modelValue:c,month:a,year:s,time:d,updateTime:_,updateMonthYear:C,selectDate:x,presetDate:N})}),(O,F)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(Po,{"multi-calendars":l.unref(M).count},{default:l.withCtx(({instance:z,index:P})=>[O.disableMonthYearSelect?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Pb,l.mergeProps({key:0,ref:D=>{D&&(B.value[P]=D)},months:l.unref(vd)(O.formatLocale,O.locale,O.monthNameFormat),years:l.unref(us)(O.yearRange,O.reverseYears),month:l.unref(a)(z),year:l.unref(s)(z),instance:z},O.$props,{onMount:F[0]||(F[0]=D=>$(l.unref(gr).header)),onResetFlow:F[1]||(F[1]=D=>O.$emit("reset-flow")),onUpdateMonthYear:D=>l.unref(C)(z,D),onOverlayClosed:F[2]||(F[2]=D=>O.$emit("focus-menu"))}),l.createSlots({_:2},[l.renderList(l.unref(T),(D,ee)=>({name:D,fn:l.withCtx(ne=>[l.renderSlot(O.$slots,D,l.normalizeProps(l.guardReactiveProps(ne)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),l.createVNode(Yb,l.mergeProps({ref:D=>{D&&(H.value[P]=D)},"mapped-dates":Y.value(z),month:l.unref(a)(z),year:l.unref(s)(z),instance:z},O.$props,{onSelectDate:D=>l.unref(x)(D,z!==1),onHandleSpace:D=>S(D,z!==1),onSetHoverDate:F[3]||(F[3]=D=>l.unref(E)(D)),onHandleScroll:D=>l.unref(v)(D,z),onHandleSwipe:D=>l.unref(w)(D,z),onMount:F[4]||(F[4]=D=>$(l.unref(gr).calendar)),onResetFlow:F[5]||(F[5]=D=>O.$emit("reset-flow")),onTooltipOpen:F[6]||(F[6]=D=>O.$emit("tooltip-open",D)),onTooltipClose:F[7]||(F[7]=D=>O.$emit("tooltip-close",D))}),l.createSlots({_:2},[l.renderList(l.unref(L),(D,ee)=>({name:D,fn:l.withCtx(ne=>[l.renderSlot(O.$slots,D,l.normalizeProps(l.guardReactiveProps({...ne})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars"]),O.enableTimePicker?(l.openBlock(),l.createElementBlock("div",Ub,[O.$slots["time-picker"]?l.renderSlot(O.$slots,"time-picker",l.normalizeProps(l.mergeProps({key:0},{time:l.unref(d),updateTime:l.unref(_)}))):(l.openBlock(),l.createBlock($d,l.mergeProps({key:1,ref_key:"timePickerRef",ref:W},O.$props,{hours:l.unref(d).hours,minutes:l.unref(d).minutes,seconds:l.unref(d).seconds,"internal-model-value":O.internalModelValue,"disabled-times-config":l.unref(u),"validate-time":l.unref(f),onMount:F[8]||(F[8]=z=>$(l.unref(gr).timePicker)),"onUpdate:hours":F[9]||(F[9]=z=>l.unref(_)(z)),"onUpdate:minutes":F[10]||(F[10]=z=>l.unref(_)(z,!1)),"onUpdate:seconds":F[11]||(F[11]=z=>l.unref(_)(z,!1,!0)),onResetFlow:F[12]||(F[12]=z=>O.$emit("reset-flow")),onOverlayClosed:F[13]||(F[13]=z=>O.$emit("time-picker-close")),onOverlayOpened:F[14]||(F[14]=z=>O.$emit("time-picker-open",z)),onAmPmChange:F[15]||(F[15]=z=>O.$emit("am-pm-change",z))}),l.createSlots({_:2},[l.renderList(l.unref(R),(z,P)=>({name:z,fn:l.withCtx(D=>[l.renderSlot(O.$slots,z,l.normalizeProps(l.guardReactiveProps(D)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):l.createCommentVNode("",!0)],64))}}),qb=(n,e)=>{const t=l.ref(),{defaultedMultiCalendars:r,defaultedConfig:i,defaultedHighlight:o}=Ue(n),{modelValue:a,year:s,month:c,calendars:d}=Ri(n,e),{isDisabled:u}=yr(n),{selectYear:f,groupedYears:p,showYearPicker:h,isDisabled:m,toggleYearPicker:v,handleYearSelect:w,handleYear:x}=Vd({modelValue:a,multiCalendars:r,highlight:o,calendars:d,month:c,year:s,props:n,emit:e}),C=(I,M)=>[I,M].map(B=>$n(B,"MMMM",{locale:n.formatLocale})).join("-"),N=l.computed(()=>I=>a.value?Array.isArray(a.value)?a.value.some(M=>Zc(I,M)):Zc(a.value,I):!1),y=I=>{if(n.range){if(Array.isArray(a.value)){const M=Ee(I,a.value[0])||Ee(I,a.value[1]);return Ao(a.value,t.value,I)&&!M}return!1}return!1},_=l.computed(()=>I=>{const M=Pe(new Date,{year:s.value(I)});return hg({start:gg(M),end:mg(M)}).map(B=>{const H=Ti(B),W=_c(B),L=u(B),T=y(H),R=typeof o.value=="function"?o.value({quarter:Ec(H),year:be(H)}):!!o.value.quarters.find($=>$.quarter===Ec(H)&&$.year===be(H));return{text:C(H,W),value:H,active:N.value(H),highlighted:R,disabled:L,isBetween:T}})}),k=I=>{xs(I,a,n.multiDatesLimit),e("auto-apply",!0)},E=I=>{const M=Cs(a,I,e);Io(M,e,n.autoApply,n.modelAuto)},j=I=>{a.value=I,e("auto-apply")};return{defaultedConfig:i,defaultedMultiCalendars:r,groupedYears:p,year:s,isDisabled:m,quarters:_,showYearPicker:h,modelValue:a,setHoverDate:I=>{t.value=I},selectYear:f,selectQuarter:(I,M,B)=>{if(!B)return d.value[M].month=Se(_c(I)),n.multiDates?k(I):n.range?E(I):j(I)},toggleYearPicker:v,handleYearSelect:w,handleYear:x}},Kb={class:"dp--quarter-items"},Gb=["disabled","onClick","onMouseover"],Qb=l.defineComponent({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...Jt},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end"],setup(n,{expose:e,emit:t}){const r=t,i=n,o=l.useSlots(),a=Et(o,"yearMode"),{defaultedMultiCalendars:s,defaultedConfig:c,groupedYears:d,year:u,isDisabled:f,quarters:p,modelValue:h,showYearPicker:m,setHoverDate:v,selectQuarter:w,toggleYearPicker:x,handleYearSelect:C,handleYear:N}=qb(i,r);return e({getSidebarProps:()=>({modelValue:h,year:u,selectQuarter:w,handleYearSelect:C,handleYear:N})}),(y,_)=>(l.openBlock(),l.createBlock(Po,{"multi-calendars":l.unref(s).count,stretch:""},{default:l.withCtx(({instance:k})=>[l.createElementVNode("div",{class:"dp-quarter-picker-wrap",style:l.normalizeStyle({minHeight:`${l.unref(c).modeHeight}px`})},[l.createElementVNode("div",null,[l.createVNode(Id,l.mergeProps(y.$props,{items:l.unref(d)(k),instance:k,"show-year-picker":l.unref(m)[k],year:l.unref(u)(k),"is-disabled":E=>l.unref(f)(k,E),onHandleYear:E=>l.unref(N)(k,E),onYearSelect:E=>l.unref(C)(E,k),onToggleYearPicker:E=>l.unref(x)(k,E==null?void 0:E.flow,E==null?void 0:E.show)}),l.createSlots({_:2},[l.renderList(l.unref(a),(E,j)=>({name:E,fn:l.withCtx(I=>[l.renderSlot(y.$slots,E,l.normalizeProps(l.guardReactiveProps(I)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),l.createElementVNode("div",Kb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(p)(k),(E,j)=>(l.openBlock(),l.createElementBlock("div",{key:j},[l.createElementVNode("button",{type:"button",class:l.normalizeClass(["dp--qr-btn",{"dp--qr-btn-active":E.active,"dp--qr-btn-between":E.isBetween,"dp--qr-btn-disabled":E.disabled,"dp--highlighted":E.highlighted}]),disabled:E.disabled,onClick:I=>l.unref(w)(E.value,k,E.disabled),onMouseover:I=>l.unref(v)(E.value)},[y.$slots.quarter?l.renderSlot(y.$slots,"quarter",{key:0,value:E.value,text:E.text}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(E.text),1)],64))],42,Gb)]))),128))])],4)]),_:3},8,["multi-calendars"]))}}),Jb=["id"],Xb={key:0,class:"dp__sidebar_left"},Zb={key:1,class:"dp--preset-dates"},ew=["onClick","onKeydown"],tw={key:2,class:"dp__sidebar_right"},nw={key:3,class:"dp__action_extra"},zd=l.defineComponent({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{...Bo,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},arrMapValues:{type:Object,default:()=>({})},noOverlayFocus:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date"],setup(n,{expose:e,emit:t}){const r=t,i=n,o=l.computed(()=>{const{openOnTop:U,...Z}=i;return{...Z,flowStep:j.value,noOverlayFocus:i.noOverlayFocus}}),{setMenuFocused:a,setShiftKey:s,control:c}=_d(),d=l.useSlots(),{defaultedTextInput:u,defaultedInline:f,defaultedConfig:p}=Ue(i),h=l.ref(null),m=l.ref(0),v=l.ref(null),w=l.ref(null),x=l.ref(!1),C=l.ref(null);l.onMounted(()=>{if(!i.shadow){x.value=!0,N(),window.addEventListener("resize",N);const U=Xe(v);if(U&&!u.value.enabled&&!f.value.enabled&&(a(!0),W()),U){const Z=he=>{p.value.allowPreventDefault&&he.preventDefault(),Ln(he,p.value,!0)};U.addEventListener("pointerdown",Z),U.addEventListener("mousedown",Z)}}}),l.onUnmounted(()=>{window.removeEventListener("resize",N)});const N=()=>{const U=Xe(w);U&&(m.value=U.getBoundingClientRect().width)},{arrowRight:y,arrowLeft:_,arrowDown:k,arrowUp:E}=Hn(),{flowStep:j,updateFlowStep:I,childMount:M,resetFlow:B}=Gv(i,r,C),H=l.computed(()=>i.monthPicker?fb:i.yearPicker?hb:i.timePicker?Nb:i.quarterPicker?Qb:Wb),W=()=>{const U=Xe(v);U&&U.focus({preventScroll:!0})},L=l.computed(()=>{var U;return((U=C.value)==null?void 0:U.getSidebarProps())||{}}),T=()=>{i.openOnTop&&r("recalculate-position")},R=Et(d,"action"),$=l.computed(()=>i.monthPicker||i.yearPicker?Et(d,"monthYear"):i.timePicker?Et(d,"timePicker"):Et(d,"shared")),Y=l.computed(()=>i.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),b=l.computed(()=>({dp__menu_disabled:i.disabled,dp__menu_readonly:i.readonly})),g=l.computed(()=>({dp__menu:!0,dp__menu_index:!f.value.enabled,dp__relative:f.value.enabled,[i.menuClassName]:!!i.menuClassName})),S=U=>{Ln(U,p.value,!0)},O=()=>{i.escClose&&r("close-picker")},F=U=>{if(i.arrowNavigation){if(U==="up")return E();if(U==="down")return k();if(U==="left")return _();if(U==="right")return y()}else U==="left"||U==="up"?ne("handleArrow","left",0,U==="up"):ne("handleArrow","right",0,U==="down")},z=U=>{s(U.shiftKey),!i.disableMonthYearSelect&&U.code==="Tab"&&U.target.classList.contains("dp__menu")&&c.value.shiftKeyInMenu&&(U.preventDefault(),Ln(U,p.value,!0),r("close-picker"))},P=()=>{W(),r("time-picker-close")},D=U=>{var Z,he,te;(Z=C.value)==null||Z.toggleTimePicker(!1,!1),(he=C.value)==null||he.toggleMonthPicker(!1,!1,U),(te=C.value)==null||te.toggleYearPicker(!1,!1,U)},ee=(U,Z=0)=>{var he,te,Ae;return U==="month"?(he=C.value)==null?void 0:he.toggleMonthPicker(!1,!0,Z):U==="year"?(te=C.value)==null?void 0:te.toggleYearPicker(!1,!0,Z):U==="time"?(Ae=C.value)==null?void 0:Ae.toggleTimePicker(!0,!1):D(Z)},ne=(U,...Z)=>{var he,te;(he=C.value)!=null&&he[U]&&((te=C.value)==null||te[U](...Z))},q=()=>{ne("selectCurrentDate")},le=(U,Z)=>{ne("presetDate",U,Z)},oe=()=>{ne("clearHoverDate")};return e({updateMonthYear:(U,Z)=>{ne("updateMonthYear",U,Z)},switchView:ee}),(U,Z)=>{var he;return l.openBlock(),l.createElementBlock("div",{id:U.uid?`dp-menu-${U.uid}`:void 0,ref_key:"dpMenuRef",ref:v,tabindex:"0",role:"dialog",class:l.normalizeClass(g.value),onMouseleave:oe,onClick:S,onKeydown:[l.withKeys(O,["esc"]),Z[18]||(Z[18]=l.withKeys(l.withModifiers(te=>F("left"),["prevent"]),["left"])),Z[19]||(Z[19]=l.withKeys(l.withModifiers(te=>F("up"),["prevent"]),["up"])),Z[20]||(Z[20]=l.withKeys(l.withModifiers(te=>F("down"),["prevent"]),["down"])),Z[21]||(Z[21]=l.withKeys(l.withModifiers(te=>F("right"),["prevent"]),["right"])),z]},[(U.disabled||U.readonly)&&l.unref(f).enabled?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(b.value)},null,2)):l.createCommentVNode("",!0),!l.unref(f).enabled&&!U.teleportCenter?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(Y.value)},null,2)):l.createCommentVNode("",!0),l.createElementVNode("div",{ref_key:"innerMenuRef",ref:w,class:l.normalizeClass({dp__menu_content_wrapper:((he=U.presetDates)==null?void 0:he.length)||!!U.$slots["left-sidebar"]||!!U.$slots["right-sidebar"]}),style:l.normalizeStyle({"--dp-menu-width":`${m.value}px`})},[U.$slots["left-sidebar"]?(l.openBlock(),l.createElementBlock("div",Xb,[l.renderSlot(U.$slots,"left-sidebar",l.normalizeProps(l.guardReactiveProps(L.value)))])):l.createCommentVNode("",!0),U.presetDates.length?(l.openBlock(),l.createElementBlock("div",Zb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(U.presetDates,(te,Ae)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:Ae},[te.slot?l.renderSlot(U.$slots,te.slot,{key:0,presetDate:le,label:te.label,value:te.value}):(l.openBlock(),l.createElementBlock("button",{key:1,type:"button",style:l.normalizeStyle(te.style||{}),class:"dp__btn dp--preset-range",onClick:l.withModifiers(Qe=>le(te.value,te.noTz),["prevent"]),onKeydown:[l.withKeys(l.withModifiers(Qe=>le(te.value,te.noTz),["prevent"]),["enter"]),l.withKeys(l.withModifiers(Qe=>le(te.value,te.noTz),["prevent"]),["space"])]},l.toDisplayString(te.label),45,ew))],64))),128))])):l.createCommentVNode("",!0),l.createElementVNode("div",{ref_key:"calendarWrapperRef",ref:h,class:"dp__instance_calendar",role:"document"},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(H.value),l.mergeProps({ref_key:"dynCmpRef",ref:C},o.value,{"flow-step":l.unref(j),onMount:l.unref(M),onUpdateFlowStep:l.unref(I),onResetFlow:l.unref(B),onFocusMenu:W,onSelectDate:Z[0]||(Z[0]=te=>U.$emit("select-date")),onDateUpdate:Z[1]||(Z[1]=te=>U.$emit("date-update",te)),onTooltipOpen:Z[2]||(Z[2]=te=>U.$emit("tooltip-open",te)),onTooltipClose:Z[3]||(Z[3]=te=>U.$emit("tooltip-close",te)),onAutoApply:Z[4]||(Z[4]=te=>U.$emit("auto-apply",te)),onRangeStart:Z[5]||(Z[5]=te=>U.$emit("range-start",te)),onRangeEnd:Z[6]||(Z[6]=te=>U.$emit("range-end",te)),onInvalidFixedRange:Z[7]||(Z[7]=te=>U.$emit("invalid-fixed-range",te)),onTimeUpdate:Z[8]||(Z[8]=te=>U.$emit("time-update")),onAmPmChange:Z[9]||(Z[9]=te=>U.$emit("am-pm-change",te)),onTimePickerOpen:Z[10]||(Z[10]=te=>U.$emit("time-picker-open",te)),onTimePickerClose:P,onRecalculatePosition:T,onUpdateMonthYear:Z[11]||(Z[11]=te=>U.$emit("update-month-year",te)),onAutoApplyInvalid:Z[12]||(Z[12]=te=>U.$emit("auto-apply-invalid",te)),onInvalidDate:Z[13]||(Z[13]=te=>U.$emit("invalid-date",te)),"onUpdate:internalModelValue":Z[14]||(Z[14]=te=>U.$emit("update:internal-model-value",te))}),l.createSlots({_:2},[l.renderList($.value,(te,Ae)=>({name:te,fn:l.withCtx(Qe=>[l.renderSlot(U.$slots,te,l.normalizeProps(l.guardReactiveProps({...Qe})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),U.$slots["right-sidebar"]?(l.openBlock(),l.createElementBlock("div",tw,[l.renderSlot(U.$slots,"right-sidebar",l.normalizeProps(l.guardReactiveProps(L.value)))])):l.createCommentVNode("",!0),U.$slots["action-extra"]?(l.openBlock(),l.createElementBlock("div",nw,[U.$slots["action-extra"]?l.renderSlot(U.$slots,"action-extra",{key:0,selectCurrentDate:q}):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],6),!U.autoApply||l.unref(p).keepActionRow?(l.openBlock(),l.createBlock(rb,l.mergeProps({key:2,"menu-mount":x.value},o.value,{"calendar-width":m.value,onClosePicker:Z[15]||(Z[15]=te=>U.$emit("close-picker")),onSelectDate:Z[16]||(Z[16]=te=>U.$emit("select-date")),onInvalidSelect:Z[17]||(Z[17]=te=>U.$emit("invalid-select")),onSelectNow:q}),l.createSlots({_:2},[l.renderList(l.unref(R),(te,Ae)=>({name:te,fn:l.withCtx(Qe=>[l.renderSlot(U.$slots,te,l.normalizeProps(l.guardReactiveProps({...Qe})))])}))]),1040,["menu-mount","calendar-width"])):l.createCommentVNode("",!0)],42,Jb)}}}),rw=typeof window<"u"?window:void 0,Ms=()=>{},iw=n=>l.getCurrentScope()?(l.onScopeDispose(n),!0):!1,ow=(n,e,t,r)=>{if(!n)return Ms;let i=Ms;const o=l.watch(()=>l.unref(n),s=>{i(),s&&(s.addEventListener(e,t,r),i=()=>{s.removeEventListener(e,t,r),i=Ms})},{immediate:!0,flush:"post"}),a=()=>{o(),i()};return iw(a),a},aw=(n,e,t,r={})=>{const{window:i=rw,event:o="pointerdown"}=r;return i?ow(i,o,a=>{const s=Xe(n),c=Xe(e);!s||!c||s===a.target||a.composedPath().includes(s)||a.composedPath().includes(c)||t(a)},{passive:!0}):void 0},sw=l.defineComponent({compatConfig:{MODE:3},__name:"VueDatePicker",props:{...Bo},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date"],setup(n,{expose:e,emit:t}){const r=t,i=n,o=l.useSlots(),a=l.ref(!1),s=l.toRef(i,"modelValue"),c=l.toRef(i,"timezone"),d=l.ref(null),u=l.ref(null),f=l.ref(null),p=l.ref(!1),h=l.ref(null),m=l.ref(!1),v=l.ref(!1),{setMenuFocused:w,setShiftKey:x}=_d(),{clearArrowNav:C}=Hn(),{mapDatesArrToMap:N,validateDate:y,isValidTime:_}=yr(i),{defaultedTransitions:k,defaultedTextInput:E,defaultedInline:j,defaultedConfig:I}=Ue(i),{menuTransition:M,showTransition:B}=Ii(k);l.onMounted(()=>{F(i.modelValue),l.nextTick().then(()=>{if(!j.value.enabled){const A=b(h.value);A==null||A.addEventListener("scroll",oe),window==null||window.addEventListener("resize",U)}}),j.value.enabled&&(a.value=!0),window==null||window.addEventListener("keyup",Z),window==null||window.addEventListener("keydown",he)});const H=l.computed(()=>N());l.onUnmounted(()=>{if(!j.value.enabled){const A=b(h.value);A==null||A.removeEventListener("scroll",oe),window==null||window.removeEventListener("resize",U)}window==null||window.removeEventListener("keyup",Z),window==null||window.removeEventListener("keydown",he)});const W=Et(o,"all",i.presetDates),L=Et(o,"input");l.watch([s,c],()=>{F(s.value)},{deep:!0});const{openOnTop:T,menuStyle:R,xCorrect:$,setMenuPosition:Y,getScrollableParent:b,shadowRender:g}=Uv({menuRef:d,menuRefInner:u,inputRef:f,pickerWrapperRef:h,inline:j,emit:r,props:i,slots:o}),{inputValue:S,internalModelValue:O,parseExternalModelValue:F,emitModelValue:z,formatInputValue:P,checkBeforeEmit:D}=Yv(r,i,p),ee=l.computed(()=>({dp__main:!0,dp__theme_dark:i.dark,dp__theme_light:!i.dark,dp__flex_display:j.value.enabled,dp__flex_display_with_input:j.value.input})),ne=l.computed(()=>i.dark?"dp__theme_dark":"dp__theme_light"),q=l.computed(()=>i.teleport?{to:typeof i.teleport=="boolean"?"body":i.teleport,disabled:j.value.enabled}:{class:"dp__outer_menu_wrap"}),le=l.computed(()=>j.value.enabled&&(i.timePicker||i.monthPicker||i.yearPicker||i.quarterPicker)),oe=()=>{a.value&&(I.value.closeOnScroll?Je():Y())},U=()=>{a.value&&Y()},Z=A=>{A.key==="Tab"&&!j.value.enabled&&!i.teleport&&I.value.tabOutClosesMenu&&(h.value.contains(document.activeElement)||Je()),v.value=A.shiftKey},he=A=>{v.value=A.shiftKey},te=()=>{!i.disabled&&!i.readonly&&(g(zd,i),Y(!1),a.value=!0,a.value&&r("open"),a.value||an(),F(i.modelValue))},Ae=()=>{var A;S.value="",an(),(A=f.value)==null||A.setParsedDate(null),r("update:model-value",null),r("update:model-timezone-value",null),r("cleared"),I.value.closeOnClearValue&&Je()},Qe=()=>{const A=O.value;return!A||!Array.isArray(A)&&y(A)?!0:Array.isArray(A)?i.multiDates||A.length===2&&y(A[0])&&y(A[1])?!0:i.partialRange&&!i.timePicker?y(A[0]):!1:!1},Yt=()=>{D()&&Qe()?(z(),Je()):r("invalid-select",O.value)},on=A=>{At(),z(),I.value.closeOnAutoApply&&!A&&Je()},At=()=>{f.value&&E.value.enabled&&f.value.setParsedDate(O.value)},jt=(A=!1)=>{i.autoApply&&_(O.value)&&Qe()&&(i.range&&Array.isArray(O.value)?(i.partialRange||O.value.length===2)&&on(A):on(A))},an=()=>{E.value.enabled||(O.value=null)},Je=()=>{j.value.enabled||(a.value&&(a.value=!1,$.value=!1,w(!1),x(!1),C(),r("closed"),S.value&&F(s.value)),an(),r("blur"))},Pn=(A,K,J=!1)=>{if(!A){O.value=null;return}const ke=Array.isArray(A)?!A.some(We=>!y(We)):y(A),me=_(A);ke&&me&&(O.value=A,K&&(m.value=J,Yt(),r("text-submit")))},cr=()=>{i.autoApply&&_(O.value)&&z(),At()},In=()=>a.value?Je():te(),dr=A=>{O.value=A},V=()=>{E.value.enabled&&(p.value=!0,P()),r("focus")},X=()=>{if(E.value.enabled&&(p.value=!1,F(i.modelValue),m.value)){const A=xv(h.value,v.value);A==null||A.focus()}r("blur")},fe=A=>{u.value&&u.value.updateMonthYear(0,{month:wd(A.month),year:wd(A.year)})},we=A=>{F(A??i.modelValue)},Re=(A,K)=>{var J;(J=u.value)==null||J.switchView(A,K)},Ut=A=>I.value.onClickOutside?I.value.onClickOutside(A):Je();return aw(d,f,()=>Ut(Qe)),e({closeMenu:Je,selectDate:Yt,clearValue:Ae,openMenu:te,onScroll:oe,formatInputValue:P,updateInternalModelValue:dr,setMonthYear:fe,parseModel:we,switchView:Re,toggleMenu:In}),(A,K)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"pickerWrapperRef",ref:h,class:l.normalizeClass(ee.value),"data-datepicker-instance":""},[l.createVNode(Zv,l.mergeProps({ref_key:"inputRef",ref:f,"input-value":l.unref(S),"onUpdate:inputValue":K[0]||(K[0]=J=>l.isRef(S)?S.value=J:null),"is-menu-open":a.value},A.$props,{onClear:Ae,onOpen:te,onSetInputDate:Pn,onSetEmptyDate:l.unref(z),onSelectDate:Yt,onToggle:In,onClose:Je,onFocus:V,onBlur:X,onRealBlur:K[1]||(K[1]=J=>p.value=!1)}),l.createSlots({_:2},[l.renderList(l.unref(L),(J,ke)=>({name:J,fn:l.withCtx(me=>[l.renderSlot(A.$slots,J,l.normalizeProps(l.guardReactiveProps(me)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),l.createVNode(l.Transition,{name:l.unref(M)(l.unref(T)),css:l.unref(B)&&!l.unref(j).enabled},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(A.teleport?l.Teleport:"div"),l.mergeProps({key:0,ref_key:"dpWrapMenuRef",ref:d},q.value,{class:{"dp--menu-wrapper":!l.unref(j).enabled},style:l.unref(j).enabled?void 0:l.unref(R)}),{default:l.withCtx(()=>[l.createVNode(zd,l.mergeProps({ref_key:"dpMenuRef",ref:u},A.$props,{"internal-model-value":l.unref(O),"onUpdate:internalModelValue":K[2]||(K[2]=J=>l.isRef(O)?O.value=J:null),class:{[ne.value]:!0,"dp--menu-wrapper":A.teleport},style:A.teleport?l.unref(R):void 0,"open-on-top":l.unref(T),"arr-map-values":H.value,"no-overlay-focus":le.value,onClosePicker:Je,onSelectDate:Yt,onAutoApply:jt,onTimeUpdate:cr,onFlowStep:K[3]||(K[3]=J=>A.$emit("flow-step",J)),onUpdateMonthYear:K[4]||(K[4]=J=>A.$emit("update-month-year",J)),onInvalidSelect:K[5]||(K[5]=J=>A.$emit("invalid-select",l.unref(O))),onAutoApplyInvalid:K[6]||(K[6]=J=>A.$emit("invalid-select",J)),onInvalidFixedRange:K[7]||(K[7]=J=>A.$emit("invalid-fixed-range",J)),onRecalculatePosition:l.unref(Y),onTooltipOpen:K[8]||(K[8]=J=>A.$emit("tooltip-open",J)),onTooltipClose:K[9]||(K[9]=J=>A.$emit("tooltip-close",J)),onTimePickerOpen:K[10]||(K[10]=J=>A.$emit("time-picker-open",J)),onTimePickerClose:K[11]||(K[11]=J=>A.$emit("time-picker-close",J)),onAmPmChange:K[12]||(K[12]=J=>A.$emit("am-pm-change",J)),onRangeStart:K[13]||(K[13]=J=>A.$emit("range-start",J)),onRangeEnd:K[14]||(K[14]=J=>A.$emit("range-end",J)),onDateUpdate:K[15]||(K[15]=J=>A.$emit("date-update",J)),onInvalidDate:K[16]||(K[16]=J=>A.$emit("invalid-date",J))}),l.createSlots({_:2},[l.renderList(l.unref(W),(J,ke)=>({name:J,fn:l.withCtx(me=>[l.renderSlot(A.$slots,J,l.normalizeProps(l.guardReactiveProps({...me})))])}))]),1040,["internal-model-value","class","style","open-on-top","arr-map-values","no-overlay-focus","onRecalculatePosition"])]),_:3},16,["class","style"])):l.createCommentVNode("",!0)]),_:3},8,["name","css"])],2))}}),Ss=(()=>{const n=sw;return n.install=e=>{e.component("Vue3DatePicker",n)},n})();Object.entries(Object.freeze(Object.defineProperty({__proto__:null,default:Ss},Symbol.toStringTag,{value:"Module"}))).forEach(([n,e])=>{n!=="default"&&(Ss[n]=e)});const lw={components:{VueDatePicker:Ss},props:{setDate:{type:[Date,String],default:()=>new Date,required:!0},invalid:{type:Boolean,default:!1}},data(){return{selectedDate:this.setDate?new Date(this.setDate):null,minDate:new Date}},watch:{selectedDate(n){this.$emit("update:selectedDate",n)}}};function cw(n,e,t,r,i,o){const a=l.resolveComponent("VueDatePicker");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(a,{modelValue:i.selectedDate,"onUpdate:modelValue":e[0]||(e[0]=s=>i.selectedDate=s),"enable-time-picker":!1,format:"MM/dd/yyyy","min-date":i.minDate,mode:"date",placeholder:"Select Start Date"},null,8,["modelValue","min-date"])])}const Ts=Le(lw,[["render",cw],["__scopeId","data-v-18850cde"]]),dw={name:"TournamentCard",components:{TournamentHeader:xc,TournamentDetail:wc},props:{detail:{type:Object,required:!0,default:()=>({artwork:"",tags:[],name:"",description:"",date:"",closes:"",location:""})}}},uw={class:"rounded-xl w-72 shadow"};function fw(n,e,t,r,i,o){const a=l.resolveComponent("TournamentHeader"),s=l.resolveComponent("TournamentDetail");return l.openBlock(),l.createElementBlock("div",uw,[l.createVNode(a,{artwork:t.detail.artwork,tags:t.detail.tags},null,8,["artwork","tags"]),l.createVNode(s,{detail:t.detail},null,8,["detail"])])}const Hd=Le(dw,[["render",fw]]),pw={name:"GridContainer",components:{FilterAndSortBar:Cc,BaseText:sn,TournamentCard:Hd,FilterUpcomingPast:Mc},props:{items:{type:Array,default:()=>[]},component:{type:String,required:!0},label:{type:String},dropdownItems:{type:Array,default:()=>[]},selectedItem:null},data(){return{filterOn:"",sortCriteria:"Date",selectedTimeFrame:"All"}},computed:{filteredItems(){let n=this.items;if(this.filterOn.trim()){const t=this.filterOn.toLowerCase();n=n.filter(r=>Object.values(r).some(i=>typeof i=="string"&&i.toLowerCase().includes(t)))}const e=new Date;switch(e.setHours(0,0,0,0),this.selectedTimeFrame){case"Upcoming":n=n.filter(t=>new Date(t.date)>=e);break;case"Past":n=n.filter(t=>new Date(t.date)<e);break}switch(this.sortCriteria){case"Date":n=[...n].sort((t,r)=>new Date(t.date)-new Date(r.date));break;case"Name":n=[...n].sort((t,r)=>t.name.localeCompare(r.name));break;case"Location":n=[...n].sort((t,r)=>t.location.localeCompare(r.location));break}return n}},methods:{handleFilter(n){this.filterOn=n},handleSort(n){this.sortCriteria=n.text},handleTimeFrameChange(n){this.selectedTimeFrame=n}}},hw={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},mw={class:"my-4"},gw={class:"my-4"},yw={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 3xl:grid-cols-4 gap-6 w-full"};function vw(n,e,t,r,i,o){const a=l.resolveComponent("FilterUpcomingPast"),s=l.resolveComponent("FilterAndSortBar");return l.openBlock(),l.createElementBlock("div",hw,[l.createElementVNode("div",mw,[l.createVNode(a,{selected:i.selectedTimeFrame,onTimeFrame:o.handleTimeFrameChange},null,8,["selected","onTimeFrame"])]),l.createElementVNode("div",gw,[l.createVNode(s,{items:t.dropdownItems,label:t.label,selectedItem:t.selectedItem,onFilterbar:o.handleFilter,onSort:o.handleSort},null,8,["items","label","selectedItem","onFilterbar","onSort"])]),l.createElementVNode("div",yw,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.filteredItems,c=>(l.openBlock(),l.createElementBlock("div",{key:c.id},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(t.component),{detail:c},null,8,["detail"]))]))),128))])])}const bw=Le(pw,[["render",vw]]);function ww(n){if(Array.isArray(n))return n}function kw(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],c=!0,d=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(u){d=!0,i=u}finally{try{if(!c&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(d)throw i}}return s}}function xw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
1
|
+
(function(_e,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(_e=typeof globalThis<"u"?globalThis:_e||self,l(_e.HemaTournamentUI={},_e.Vue))})(this,function(_e,l){"use strict";const Pe=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},em={name:"BaseIcon",props:{iconName:{type:String,default:"fa-face-smile",required:!0},style:{type:String,default:"fa-solid",validator:function(n){return["fa-solid","fa-regular","fa-solid","fa-light","fa-thing"].indexOf(n)!==-1}},size:{type:String,validator:function(n){return["xs","sm","md","lg","xl","2xl","3xl","4xl","5xl"].indexOf(n)!==-1},default:"sm"},color:{type:String,default:"primary"},hover:{type:String,default:"primary"}},computed:{computedIconClass(){return[this.style,this.iconName,`text-${this.size}`,this.colorClass,this.hoverClass]},colorClass(){return`text-${this.color}`},hoverClass(){return`hover:text-${this.hover}`}}};function tm(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("i",{class:l.normalizeClass(o.computedIconClass)},null,2)}const pr=Pe(em,[["render",tm]]),nm={name:"BaseInput",components:{BaseIcon:pr},props:{placeholder:{type:String,default:""},value:{type:String,default:""},invalid:{type:Boolean,default:!1},addBorder:{type:Boolean,default:!1},iconName:{type:String,default:""},iconStyle:{type:String,default:"fa-solid",validator:n=>["fa-solid","fa-regular","fa-light","fa-thing"].includes(n)},size:{type:String,default:"sm",validator:n=>["xs","sm","md","lg","xl","2xl","3xl","4xl"].includes(n)},iconColor:{type:String,default:"primary",validator:n=>["neutral","primary","secondary","tertiary","quaternary","bright","white","alarm"].includes(n)},emits:["click"]},setup(n,{emit:e}){const t=l.ref(n.value),r=l.ref(null);l.watch(()=>n.value,a=>{t.value=a});const i=l.computed(()=>{let a="appearance-none focus:outline-none w-full text-sm rounded-lg";return n.addBorder&&(a+=n.invalid?" border border-alarm p-2":" border border-dropdownSelect p-2"),a});return{internalValue:t,baseClasses:i,onInput:()=>{clearTimeout(r.value),r.value=setTimeout(()=>{e("update:value",t.value)},300)}}}},rm=["placeholder"];function im(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass((t.iconName,""))},[l.withDirectives(l.createElementVNode("input",{"onUpdate:modelValue":e[0]||(e[0]=a=>r.internalValue=a),class:l.normalizeClass(r.baseClasses),placeholder:t.placeholder,onInput:e[1]||(e[1]=a=>r.onInput(a.target.value))},null,42,rm),[[l.vModelText,r.internalValue]])],2)}const Vn=Pe(nm,[["render",im]]),om={name:"BaseRadioGroup",props:{invalid:{type:Boolean,default:!1},items:{type:Array,required:!0}},data(){return{selectedIndex:null}},methods:{selectItem(n){this.selectedIndex=n,this.$emit("update:value",this.items[n].value)}}},am={class:"text-xl",role:"radiogroup"},sm=["onClick","aria-checked","onKeydown"],lm={class:"flex flex-col"};function cm(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",am,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,(a,s)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["flex flex-row p-4 text-quaternary rounded-lg mb-2 shadow border hover:bg-tertiary",[i.selectedIndex===s?" bg-tertiary":" bg-white",t.invalid?" border-alarm":" border-dropdownSelect"]]),key:s,onClick:c=>o.selectItem(s),role:"radio","aria-checked":i.selectedIndex===s?"true":"false",tabindex:"0",onKeydown:l.withKeys(l.withModifiers(c=>o.selectItem(s),["prevent"]),["enter"])},[l.createElementVNode("i",{class:l.normalizeClass([[i.selectedIndex===s?"fa-circle-dot text-quaternary ":"fa-circle "],"fa-regular pr-4 pt-2"])},null,2),l.createElementVNode("div",lm,[l.createElementVNode("p",{class:l.normalizeClass([[i.selectedIndex===s?"text-quaternary ":""],"font-bold text-sm"])},l.toDisplayString(a.label),3),l.createElementVNode("p",{class:l.normalizeClass([[i.selectedIndex===s?"text-quaternary ":""],"text-sm"])},l.toDisplayString(a.description),3)])],42,sm))),128))])}const kc=Pe(om,[["render",cm]]),dm={name:"base-tag",props:{label:{type:String,required:!0},backgroundColor:{type:String,validator:function(n){return["primary","secondary","tertiary","neutral","bright"].indexOf(n)!==-1}}},setup(n){return n=l.reactive(n),{classes:l.computed(()=>{let e="cursor-pointer inline-block py-1 px-3 my-2 ml-3 text-xs font-normal rounded-full text-neutral";switch(n.backgroundColor){case"primary":e+=" bg-primary";break;case"secondary":e+=" bg-secondary";break;case"tertiary":e+=" bg-tertiary";break;case"neutral":e+=" bg-neutral";break;case"bright":e+=" bg-bright";break;default:e+=" bg-primary";break}return e})}}};function um(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(r.classes)},l.toDisplayString(t.label),3)}const xc=Pe(dm,[["render",um]]),pm={name:"BaseText",props:{text:{type:String,required:!0,default:""},weight:{type:String,default:"normal",validator:function(n){return["light","normal","medium","semi-bold","bold","extra-bold"].indexOf(n)!==-1}},size:{type:String,default:"sm",validator:function(n){return["xs","sm","md","lg","xl","2xl","3xl"].indexOf(n)!==-1}},color:{type:String,default:"primary",validator:function(n){return["neutral","quaternary","tertiary","secondary","primary","bright","primaryHighlight","alarm"].indexOf(n)!==-1}},invalid:{type:Boolean,default:!1},hoverColor:{type:String,default:"none",validator:function(n){return["primary","secondary","tertiary","quaternary","neutral","bright","none"].indexOf(n)!==-1}}},setup(n){return{classes:l.computed(()=>{let e="";switch(n.color){case"neutral":e+=" text-neutral";break;case"tertiary":e+=" text-tertiary";break;case"secondary":e+=" text-secondary";break;case"quaternary":e+=" text-quaternary";break;case"primary":e+=" text-primary";break;case"primaryHighlight":e+=" text-primaryHighlight";break;case"bright":e+=" text-bright";break;case"alarm":e+=" text-alarmText";break}switch(n.invalid&&(e=" text-alarm"),n.hoverColor){case"neutral":e+=" hover:text-neutral";break;case"tertiary":e+=" hover:text-tertiary";break;case"secondary":e+=" hover:text-secondary";break;case"quaternary":e+=" hover:text-quaternary";break;case"primary":e+=" hover:text-primary";break;case"bright":e+=" hover:text-bright";break;case"none":e+="";break}switch(n.weight){case"light":e+=" font-light";break;case"normal":e+=" font-normal";break;case"medium":e+=" font-medium";break;case"semi-bold":e+=" font-semibold";break;case"bold":e+=" font-bold";break;case"extra-bold":e+=" font-extrabold";break}switch(n.size){case"xs":e+=" text-xs";break;case"sm":e+=" text-sm";break;case"md":e+=" text-md";break;case"lg":e+=" text-lg";break;case"xl":e+=" text-xl";break;case"2xl":e+=" text-2xl";break;case"3xl":e+=" text-3xl";break}return e})}}};function fm(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(r.classes)},l.toDisplayString(t.text),3)}const Lt=Pe(pm,[["render",fm]]),hm={name:"Breadcrumb",components:{BaseText:Lt},props:{items:{type:Array,required:!0,default:()=>[]},onLinkClick:{type:Function,default:()=>{}}}},mm={class:"flex flex-row w-full"};function gm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("router-link");return l.openBlock(),l.createElementBlock("nav",mm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,(c,d)=>(l.openBlock(),l.createElementBlock("div",{key:d,class:"flex flex-row"},[d>0?(l.openBlock(),l.createBlock(a,{key:0,text:" > ",size:"lg",color:"quaternary",class:"mr-2"})):l.createCommentVNode("",!0),c.link?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(a,{key:1,class:"mr-2",text:c.text,size:"lg",color:"quaternary"},null,8,["text"])),c.link?(l.openBlock(),l.createBlock(s,{key:2,to:c.link,onClick:t.onLinkClick,class:"mr-2"},{default:l.withCtx(()=>[l.createVNode(a,{text:c.text,size:"lg",color:"quaternary","hover-color":"bright",class:"underline"},null,8,["text"])]),_:2},1032,["to","onClick"])):l.createCommentVNode("",!0)]))),128))])}const ym=Pe(hm,[["render",gm]]),vm={name:"base-button",components:{BaseText:Lt,BaseIcon:pr},props:{label:{type:String,required:!0},iconName:{type:String,default:""},iconStyle:{type:String,default:"fa-solid",validator:n=>["fa-solid","fa-regular","fa-light","fa-thing"].includes(n)},size:{type:String,default:"sm",validator:n=>["xs","sm","md","lg","xl","2xl","3xl","4xl"].includes(n)},type:{type:String,default:"primary",validator:n=>["primary","secondary","tertiary","bright","admin","adminSecondary","iconOnly","editor","square"].includes(n)},selected:{type:Boolean,default:!1}},emits:["click"],setup(n,{emit:e}){const t={primary:"mx-1 p-2 items-center gap-2.5 text-center rounded-md shadow border border-dropdownSelect justify-center hover:bg-tertiary "+(n.selected?"bg-dropdownSelect":"bg-neutral"),secondary:"px-2.5 items-center gap-2.5 text-center my-1 p-3 border-b border-secondary hover:border-b hover:border-neutral w-full rounded-lg flex flex-row justify-center "+(n.selected?"bg-secondary":"bg-primary"),tertiary:"px-2.5 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-primary "+(n.selected?"bg-primary":"bg-tertiary"),bright:"px-2.5 py-0.5 items-center gap-2.5 rounded-md text-center justify-center hover:bg-primary text-neutral "+(n.selected?"bg-primary":"bg-bright"),admin:"px-2.5 py-2 items-center rounded-md gap-2.5 text-center my-1 text-neutral hover:bg-primaryHighlight "+(n.selected,"bg-primary"),adminSecondary:"px-2.5 py-0.5 items-center gap-2.5 text-center my-1 pb-0.5 border-b border-secondary hover:border-b hover:border-neutral w-11/12 text-neutral "+(n.selected,"bg-primary"),iconOnly:"px-0.5 items-center rounded-full text-center text-tertiary shadow border border-dropdownSelect justify-center bg-primaryHighlight",editor:"px-1 items-center rounded-md text-center justify-center hover:bg-tertiary",square:"p-8 my-3 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary "+(n.selected?"bg-dropdownSelect":"bg-neutral")},r={xs:"text-xs",sm:"text-sm",md:"text-md",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl"};return{textColor:l.computed(()=>({primary:"primary",secondary:"neutral",tertiary:"tertiary",bright:"bright",admin:"neutral",adminSecondary:"neutral",iconOnly:"neutral",editor:n.selected?"bright":"quaternary",square:"primary"})[n.type]),classes:l.computed(()=>{let i="inline-flex",o=t[n.type],a=r[n.size];return`${i} ${o} ${a}`}),onClick(){e("click")}}}};function bm(n,e,t,r,i,o){const a=l.resolveComponent("BaseIcon"),s=l.resolveComponent("BaseText");return l.openBlock(),l.createElementBlock("button",{class:l.normalizeClass(r.classes),"data-testid":"base-button",type:"button",onClick:e[0]||(e[0]=(...c)=>r.onClick&&r.onClick(...c))},[t.iconName?(l.openBlock(),l.createBlock(a,{key:0,color:r.textColor,"icon-name":t.iconName,size:t.size,style:l.normalizeStyle(t.iconStyle),"data-testid":"base-icon"},null,8,["color","icon-name","size","style"])):l.createCommentVNode("",!0),l.createVNode(s,{color:r.textColor,size:t.size,text:t.label,"data-testid":"base-text",weight:"normal"},null,8,["color","size","text"])],2)}const ln=Pe(vm,[["render",bm]]),wm={name:"tournament-card-details",components:{BaseButton:ln,BaseText:Lt},props:{detail:{type:Object,required:!0,default:()=>({TournamentId:null,Name:"",StartDate:"",EndDate:"",Description:"",ClubId:null,AddressId:null,"Club.Name":"",Address:[{Name:"",Address1:"",City:"",State:"",Zip:null,Coordinates:""}],SocialMedia:[],images:[],tags:[]})}}},km={class:"flex flex-col w-full pt-4 pb-3 px-3"},xm={class:"mt-4 flex flex-col"},Cm=["innerHTML"],Tm={class:"mt-4 flex flex-col"},Mm={class:"flex flex-row w-full justify-end"};function Sm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",km,[l.createVNode(a,{text:t.detail.Name,color:"primary",size:"xl",weight:"semi-bold"},null,8,["text"]),l.createVNode(a,{text:t.detail.Address[0].Name,color:"primary",size:"sm",weight:"normal"},null,8,["text"]),l.createElementVNode("div",xm,[l.createElementVNode("div",{class:"mt-4 flex flex-col",innerHTML:t.detail.Description},null,8,Cm)]),l.createElementVNode("div",Tm,[l.createVNode(a,{text:`${t.detail.StartDate}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"]),l.createVNode(a,{text:`${t.detail.EndDate}`,color:"primaryHighlight",size:"sm",weight:"light"},null,8,["text"])]),l.createElementVNode("div",Mm,[l.createVNode(s,{label:"Edit",class:"mt-2",primary:""})])])}const Cc=Pe(wm,[["render",Sm]]),Tc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAAAAXNSR0IArs4c6QAABdlJREFUeF7t1AEJACAQBEGNaiOzWkDBFgvzCY655+ba5w5HgACBgMA0WIGWRCRA4AsYLI9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBAyWHyBAICNgsDJVCUqAgMHyAwQIZAQMVqYqQQkQMFh+gACBjIDBylQlKAECBssPECCQETBYmaoEJUDAYPkBAgQyAgYrU5WgBAgYLD9AgEBGwGBlqhKUAAGD5QcIEMgIGKxMVYISIGCw/AABAhkBg5WpSlACBB4p/0F3nyMcxwAAAABJRU5ErkJggg==",Dm={name:"tournament-card-header",components:{BaseTag:xc},props:{artwork:{type:String,required:!0,default:Tc},altText:{type:String,default:""},tags:{type:Array,default:()=>[]}},computed:{backgroundStyle(){return`background-image: url('${this.artwork||Tc}');`}}},Am={class:"rounded-t-xl w-full"},Em={class:"flex flex-row"};function Nm(n,e,t,r,i,o){const a=l.resolveComponent("BaseTag");return l.openBlock(),l.createElementBlock("div",Am,[l.createElementVNode("div",{style:l.normalizeStyle(o.backgroundStyle),class:"h-36 w-full flex flex-col justify-end rounded-t-xl bg-cover bg-no-repeat bg-center"},[l.createElementVNode("div",Em,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.tags,s=>(l.openBlock(),l.createBlock(a,{key:s,label:s},null,8,["label"]))),128))])],4)])}const Mc=Pe(Dm,[["render",Nm]]),Om={name:"DropDownMenu",components:{BaseText:Lt},props:{label:{type:String},items:{type:Array,validator:n=>n.every(e=>typeof e.text=="string")},selectedItem:{type:Object,default:()=>({text:""}),validator:n=>typeof n.text=="string"}},data:()=>({isDropDownOpen:!1}),methods:{handleClick(n){this.isDropDownOpen=!1,this.$emit("update:selectedItem",n)},handleDropDown(){this.isDropDownOpen=!this.isDropDownOpen}}},_m={class:"flex flex-row"},Bm=l.createElementVNode("i",{class:"fa-solid fa-chevron-down text-xs"},null,-1),Pm={key:0,class:"flex flex-col w-32 shadow mt-2 z-10 rounded-xl py-1 absolute bg-neutral"},Im=["onClick"];function Rm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText");return l.openBlock(),l.createElementBlock("div",_m,[l.createElementVNode("span",null,[l.createElementVNode("div",{class:"z-10 rounded-lg shadow px-2 py-2 w-40 flex flex-row justify-between",onClick:e[0]||(e[0]=s=>o.handleDropDown())},[l.createVNode(a,{text:t.label,color:"quaternary",size:"sm",weight:"normal"},null,8,["text"]),l.createVNode(a,{text:t.selectedItem.text,color:"secondary",size:"sm",weight:"normal"},null,8,["text"]),Bm]),n.isDropDownOpen?(l.openBlock(),l.createElementBlock("div",Pm,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.items,s=>(l.openBlock(),l.createElementBlock("a",{key:s.id,onClick:c=>o.handleClick(s),class:"hover:bg-dropdownSelect py-1 px-2 border-b border-dropdownSelect last:border-0"},[l.createVNode(a,{text:s.text,color:"primary",size:"xs",weight:"normal"},null,8,["text"])],8,Im))),128))])):l.createCommentVNode("",!0)])])}const _a=Pe(Om,[["render",Rm]]),Vm={name:"FilterAndSortBar",components:{DropDownMenu:_a,BaseInput:Vn},props:{label:{type:String},items:{type:Array,default:()=>[]},selectedItem:null},data(){return{filterText:"",localSelectedItem:this.selectedItem}},methods:{handleFilter(n){this.$emit("filterbar",n)},handleSelectedItem(n){this.$emit("sort",n),this.localSelectedItem=n}}},Lm={class:"flex flex-row w-full justify-between"},$m={class:"rounded-lg shadow px-2 py-1 w-full flex flex-row mt-0.5 mr-4"},Fm=l.createElementVNode("i",{class:"fa-solid fa-magnifying-glass text-primaryHighlight w-6 mt-1"},null,-1);function zm(n,e,t,r,i,o){const a=l.resolveComponent("BaseInput"),s=l.resolveComponent("DropDownMenu");return l.openBlock(),l.createElementBlock("section",Lm,[l.createElementVNode("div",$m,[Fm,l.createVNode(a,{placeholder:"Search on Name, Location, or Date",class:"text-quaternary w-full",addBorder:!1,value:i.filterText,"onUpdate:value":o.handleFilter},null,8,["value","onUpdate:value"])]),l.createElementVNode("div",null,[l.createVNode(s,{label:t.label,items:t.items,selectedItem:i.localSelectedItem,"onUpdate:selectedItem":o.handleSelectedItem},null,8,["label","items","selectedItem","onUpdate:selectedItem"])])])}const Hm=Pe(Vm,[["render",zm]]),Ym={name:"FilterUpcomingPast",components:{BaseText:Lt,BaseButton:ln,DropDownMenu:_a,BaseInput:Vn},props:{selected:{type:String,default:"All"}},data(){return{localSelected:this.selected}},methods:{handleTimeFrame(n){this.$emit("timeFrame",n),this.localSelected=n}}},jm={class:"flex flex-row w-full justify-between"},Um={class:"rounded-lg w-3/4"},Wm={class:"flex flex-row h-8 w-1/4 justify-end"};function qm(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("section",jm,[l.createElementVNode("div",Um,[l.createVNode(a,{text:"Tournament",color:"primary",size:"2xl",weight:"normal"})]),l.createElementVNode("div",Wm,[l.createVNode(s,{label:"All",color:"primary",size:"sm",selected:i.localSelected==="All",onClick:e[0]||(e[0]=c=>o.handleTimeFrame("ALL"))},null,8,["selected"]),l.createVNode(s,{label:"Upcoming",color:"primary",size:"sm",selected:i.localSelected==="Upcoming",onClick:e[1]||(e[1]=c=>o.handleTimeFrame("Upcoming"))},null,8,["selected"]),l.createVNode(s,{label:"Past",color:"primary",size:"sm",selected:i.localSelected==="Past",onClick:e[2]||(e[2]=c=>o.handleTimeFrame("Past"))},null,8,["selected"])])])}const Km=Pe(Ym,[["render",qm]]),Gm={name:"BaseModal",components:{BaseButton:ln,BaseIcon:pr,BaseText:Lt},props:{show:{type:Boolean,default:!1},iconName:{type:String,default:"fa-check-circle"},iconColor:{type:String,default:"accepted"},iconBackgroundColor:{type:String,default:"acceptedHighlight"},iconBorderColor:{type:String,default:"acceptedBorder"},headerText:{type:String,default:"Default Header"},bodyText:{type:String,default:"Default Body Text"},buttonText:{type:String,default:"Button Text"}},emits:["update:show","submit-modal"],methods:{close(){this.$emit("update:show",!1)},submit(){this.$emit("submit-modal"),this.close()}}},Jm={class:"absolute top-3 right-3"},Qm={class:"mt-3 text-center w-full"},Xm={class:"w-full flex flex-row justify-center mb-8"},Zm={class:"mt-4"};function eg(n,e,t,r,i,o){const a=l.resolveComponent("BaseIcon"),s=l.resolveComponent("BaseText"),c=l.resolveComponent("BaseButton");return t.show?(l.openBlock(),l.createElementBlock("div",{key:0,class:"fixed inset-0 bg-secondary bg-opacity-50 overflow-y-auto h-full w-full z-20",onClick:e[1]||(e[1]=(...d)=>o.close&&o.close(...d))},[l.createElementVNode("div",{class:"relative top-20 mx-auto p-5 border w-96 shadow-lg rounded-md bg-neutral",onClick:e[0]||(e[0]=l.withModifiers(()=>{},["stop"]))},[l.createElementVNode("div",Jm,[l.createVNode(a,{"icon-name":"fa-circle-xmark",size:"lg",color:"quaternary",hover:"alarm",onClick:o.close},null,8,["onClick"])]),l.createElementVNode("div",Qm,[l.createElementVNode("div",Xm,[l.createElementVNode("p",{class:l.normalizeClass(["bg-"+t.iconBackgroundColor,"flex flex-row justify-center h-20 w-20 rounded-full","border border-"+t.iconBorderColor])},[l.createVNode(a,{"icon-name":t.iconName,iconStyle:"fa-solid",size:"4xl",color:t.iconColor,class:"mb-3 mt-5","data-testid":"base-icon"},null,8,["icon-name","color"])],2)]),l.renderSlot(n.$slots,"modal-content",{},()=>[l.createVNode(s,{text:t.headerText,size:"2xl",weight:"bold",color:"secondary",class:"m-3","data-testid":"text-title"},null,8,["text"]),l.createVNode(s,{text:t.bodyText,size:"sm",weight:"normal",color:"primaryHighlight",class:"mb-3","data-testid":"text-title"},null,8,["text"])]),l.createElementVNode("div",Zm,[l.createVNode(c,{label:t.buttonText,size:"sm",type:"secondary",selected:!0,onClick:o.submit,color:"neutral",class:"w-full","data-testid":"base-button"},null,8,["label","onClick"])])])])])):l.createCommentVNode("",!0)}const Ba=Pe(Gm,[["render",eg]]),Sc={subpremise:"short_name",street_number:"short_name",route:"long_name",locality:"long_name",administrative_area_level_1:"short_name",administrative_area_level_2:"long_name",country:"long_name",postal_code:"short_name"},tg=["locality","administrative_area_level_3"],ng=["locality","sublocality","postal_code","country","administrative_area_level_1","administrative_area_level_2"],rg=["address_components","adr_address","alt_id","formatted_address","geometry","icon","id","name","business_status","photo","place_id","scope","type","url","utc_offset_minutes","vicinity"],ig={name:"VueGoogleAutocomplete",props:{id:{type:String,required:!0},classname:String,placeholder:{type:String,default:"Start typing"},disabled:{type:Boolean,default:!1},types:{type:String,default:"address"},fields:{type:Array,default:function(){return rg}},country:{type:[String,Array],default:null},enableGeolocation:{type:Boolean,default:!1},geolocationOptions:{type:Object,default:null}},data(){return{autocomplete:null,autocompleteText:"",geolocation:{geocoder:null,loc:null,position:null}}},watch:{autocompleteText:function(n,e){this.$emit("inputChange",{newVal:n,oldVal:e},this.id)},country:function(n,e){this.autocomplete.setComponentRestrictions({country:this.country===null?[]:this.country})}},mounted:function(){const n={};this.types&&(n.types=[this.types]),this.country&&(n.componentRestrictions={country:this.country}),this.autocomplete=new google.maps.places.Autocomplete(document.getElementById(this.id),n),this.autocomplete.setFields(this.fields),this.autocomplete.addListener("place_changed",this.onPlaceChanged)},methods:{onPlaceChanged(){let n=this.autocomplete.getPlace();if(!n.geometry){this.$emit("no-results-found",n,this.id);return}n.address_components!==void 0&&(this.$emit("placechanged",this.formatResult(n),n,this.id),this.autocompleteText=document.getElementById(this.id).value,this.onChange())},onFocus(){this.biasAutocompleteLocation(),this.$emit("focus")},onBlur(){this.$emit("blur")},onChange(){this.$emit("change",this.autocompleteText)},onKeyPress(n){this.$emit("keypress",n)},onKeyUp(n){this.$emit("keyup",n)},clear(){this.autocompleteText=""},focus(){this.$refs.autocomplete.focus()},blur(){this.$refs.autocomplete.blur()},update(n){this.autocompleteText=n},updateCoordinates(n){!n&&!(n.lat||n.lng)||(this.geolocation.geocoder||(this.geolocation.geocoder=new google.maps.Geocoder),this.geolocation.geocoder.geocode({location:n},(e,t)=>{t==="OK"?(e=this.filterGeocodeResultTypes(e),e[0]?(this.$emit("placechanged",this.formatResult(e[0]),e[0],this.id),this.update(e[0].formatted_address)):this.$emit("error","no result for provided coordinates")):this.$emit("error","error getting address from coords")}))},geolocate(){this.updateGeolocation((n,e)=>{this.updateCoordinates(n)})},updateGeolocation(n=null){if(navigator.geolocation){let e={};this.geolocationOptions&&Object.assign(e,this.geolocationOptions),navigator.geolocation.getCurrentPosition(t=>{let r={lat:t.coords.latitude,lng:t.coords.longitude};this.geolocation.loc=r,this.geolocation.position=t,n&&n(r,t)},t=>{this.$emit("error","Cannot get Coordinates from navigator",t)},e)}},biasAutocompleteLocation(){this.enableGeolocation&&this.updateGeolocation((n,e)=>{let t=new google.maps.Circle({center:n,radius:e.coords.accuracy});this.autocomplete.setBounds(t.getBounds())})},formatResult(n){let e={};for(let t=0;t<n.address_components.length;t++){let r=n.address_components[t].types[0];if(Sc[r]){let i=n.address_components[t][Sc[r]];e[r]=i}}return e.latitude=n.geometry.location.lat(),e.longitude=n.geometry.location.lng(),e},filterGeocodeResultTypes(n){if(!n||!this.types)return n;let e=[],t=[this.types];t.includes("(cities)")&&(t=t.concat(tg)),t.includes("(regions)")&&(t=t.concat(ng));for(let r of n)for(let i of r.types)if(t.includes(i)){e.push(r);break}return e}}},og=["id","placeholder","disabled"];function ag(n,e,t,r,i,o){return l.withDirectives((l.openBlock(),l.createElementBlock("input",{ref:"autocomplete",type:"text",class:l.normalizeClass(t.classname),id:t.id,placeholder:t.placeholder,disabled:t.disabled,"onUpdate:modelValue":e[0]||(e[0]=a=>i.autocompleteText=a),onFocus:e[1]||(e[1]=a=>o.onFocus()),onBlur:e[2]||(e[2]=a=>o.onBlur()),onChange:e[3]||(e[3]=(...a)=>o.onChange&&o.onChange(...a)),onKeypress:e[4]||(e[4]=(...a)=>o.onKeyPress&&o.onKeyPress(...a)),onKeyup:e[5]||(e[5]=(...a)=>o.onKeyUp&&o.onKeyUp(...a))},null,42,og)),[[l.vModelText,i.autocompleteText]])}const sg={components:{VueGoogleAutocomplete:Pe(ig,[["render",ag]])},props:{invalid:{type:Boolean,default:!1}},data(){return{address:"",coordinates:""}},methods:{getAddressData(n){const e=`${n.street_number} ${n.route}`,t=n.locality,r=n.administrative_area_level_1;this.address=`${e}, ${t}, ${r}`,this.coordinates=`${n.latitude},${n.longitude}`;const i={address:this.address,coordinates:this.coordinates};this.$emit("update:address",i)}}};function lg(n,e,t,r,i,o){const a=l.resolveComponent("vue-google-autocomplete");return l.openBlock(),l.createBlock(a,{class:l.normalizeClass(["border rounded-lg text-secondary text-sm p-2 w-full appearance-none focus:outline-none",t.invalid?"border-alarm":"border-dropdownSelect"]),id:"map",ref:"address",modelValue:i.address,"onUpdate:modelValue":e[0]||(e[0]=s=>i.address=s),placeholder:"Venue Address",onPlacechanged:o.getAddressData},null,8,["class","modelValue","onPlacechanged"])}const Pa=Pe(sg,[["render",lg]]);function $t(n){"@babel/helpers - typeof";return $t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$t(n)}function he(n){if(n===null||n===!0||n===!1)return NaN;var e=Number(n);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function le(n,e){if(e.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+e.length+" present")}function ue(n){le(1,arguments);var e=Object.prototype.toString.call(n);return n instanceof Date||$t(n)==="object"&&e==="[object Date]"?new Date(n.getTime()):typeof n=="number"||e==="[object Number]"?new Date(n):((typeof n=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Dn(n,e){le(2,arguments);var t=ue(n),r=he(e);return isNaN(r)?new Date(NaN):(r&&t.setDate(t.getDate()+r),t)}function Kt(n,e){le(2,arguments);var t=ue(n),r=he(e);if(isNaN(r))return new Date(NaN);if(!r)return t;var i=t.getDate(),o=new Date(t.getTime());o.setMonth(t.getMonth()+r+1,0);var a=o.getDate();return i>=a?o:(t.setFullYear(o.getFullYear(),o.getMonth(),i),t)}function Dc(n,e){if(le(2,arguments),!e||$t(e)!=="object")return new Date(NaN);var t=e.years?he(e.years):0,r=e.months?he(e.months):0,i=e.weeks?he(e.weeks):0,o=e.days?he(e.days):0,a=e.hours?he(e.hours):0,s=e.minutes?he(e.minutes):0,c=e.seconds?he(e.seconds):0,d=ue(n),u=r||t?Kt(d,r+t*12):d,p=o||i?Dn(u,o+i*7):u,f=s+a*60,h=c+f*60,m=h*1e3,y=new Date(p.getTime()+m);return y}function cg(n,e){le(2,arguments);var t=ue(n).getTime(),r=he(e);return new Date(t+r)}var dg={};function cn(){return dg}function fr(n,e){var t,r,i,o,a,s,c,d;le(1,arguments);var u=cn(),p=he((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=ue(n),h=f.getDay(),m=(h<p?7:0)+h-p;return f.setDate(f.getDate()-m),f.setHours(0,0,0,0),f}function ko(n){return le(1,arguments),fr(n,{weekStartsOn:1})}function ug(n){le(1,arguments);var e=ue(n),t=e.getFullYear(),r=new Date(0);r.setFullYear(t+1,0,4),r.setHours(0,0,0,0);var i=ko(r),o=new Date(0);o.setFullYear(t,0,4),o.setHours(0,0,0,0);var a=ko(o);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}function pg(n){le(1,arguments);var e=ug(n),t=new Date(0);t.setFullYear(e,0,4),t.setHours(0,0,0,0);var r=ko(t);return r}function xo(n){var e=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return e.setUTCFullYear(n.getFullYear()),n.getTime()-e.getTime()}function Ac(n){le(1,arguments);var e=ue(n);return e.setHours(0,0,0,0),e}var fg=864e5;function hg(n,e){le(2,arguments);var t=Ac(n),r=Ac(e),i=t.getTime()-xo(t),o=r.getTime()-xo(r);return Math.round((i-o)/fg)}function mg(n,e){le(2,arguments);var t=he(e),r=t*3;return Kt(n,r)}function Ia(n,e){le(2,arguments);var t=he(e);return Kt(n,t*12)}var Ra=6e4,Va=36e5,gg=1e3;function Ec(n){return le(1,arguments),n instanceof Date||$t(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Si(n){if(le(1,arguments),!Ec(n)&&typeof n!="number")return!1;var e=ue(n);return!isNaN(Number(e))}function Nc(n){le(1,arguments);var e=ue(n),t=Math.floor(e.getMonth()/3)+1;return t}function Oc(n,e){var t;le(1,arguments);var r=n||{},i=ue(r.start),o=ue(r.end),a=o.getTime();if(!(i.getTime()<=a))throw new RangeError("Invalid interval");var s=[],c=i;c.setHours(0,0,0,0);var d=Number((t=e==null?void 0:e.step)!==null&&t!==void 0?t:1);if(d<1||isNaN(d))throw new RangeError("`options.step` must be a number greater than 1");for(;c.getTime()<=a;)s.push(ue(c)),c.setDate(c.getDate()+d),c.setHours(0,0,0,0);return s}function Di(n){le(1,arguments);var e=ue(n),t=e.getMonth(),r=t-t%3;return e.setMonth(r,1),e.setHours(0,0,0,0),e}function yg(n){le(1,arguments);var e=n||{},t=ue(e.start),r=ue(e.end),i=r.getTime();if(!(t.getTime()<=i))throw new RangeError("Invalid interval");var o=Di(t),a=Di(r);i=a.getTime();for(var s=[],c=o;c.getTime()<=i;)s.push(ue(c)),c=mg(c,1);return s}function vg(n){le(1,arguments);var e=ue(n),t=e.getFullYear();return e.setFullYear(t+1,0,0),e.setHours(23,59,59,999),e}function bg(n){le(1,arguments);var e=ue(n),t=new Date(0);return t.setFullYear(e.getFullYear(),0,1),t.setHours(0,0,0,0),t}function wg(n,e){var t,r,i,o,a,s,c,d;le(1,arguments);var u=cn(),p=he((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=ue(n),h=f.getDay(),m=(h<p?-7:0)+6-(h-p);return f.setDate(f.getDate()+m),f.setHours(23,59,59,999),f}function _c(n){le(1,arguments);var e=ue(n),t=e.getMonth(),r=t-t%3+3;return e.setMonth(r,0),e.setHours(23,59,59,999),e}function Bc(n,e){le(2,arguments);var t=he(e);return cg(n,-t)}var kg=864e5;function xg(n){le(1,arguments);var e=ue(n),t=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=t-r;return Math.floor(i/kg)+1}function Fr(n){le(1,arguments);var e=1,t=ue(n),r=t.getUTCDay(),i=(r<e?7:0)+r-e;return t.setUTCDate(t.getUTCDate()-i),t.setUTCHours(0,0,0,0),t}function Pc(n){le(1,arguments);var e=ue(n),t=e.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(t+1,0,4),r.setUTCHours(0,0,0,0);var i=Fr(r),o=new Date(0);o.setUTCFullYear(t,0,4),o.setUTCHours(0,0,0,0);var a=Fr(o);return e.getTime()>=i.getTime()?t+1:e.getTime()>=a.getTime()?t:t-1}function Cg(n){le(1,arguments);var e=Pc(n),t=new Date(0);t.setUTCFullYear(e,0,4),t.setUTCHours(0,0,0,0);var r=Fr(t);return r}var Tg=6048e5;function Ic(n){le(1,arguments);var e=ue(n),t=Fr(e).getTime()-Cg(e).getTime();return Math.round(t/Tg)+1}function hr(n,e){var t,r,i,o,a,s,c,d;le(1,arguments);var u=cn(),p=he((t=(r=(i=(o=e==null?void 0:e.weekStartsOn)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.weekStartsOn)!==null&&t!==void 0?t:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=ue(n),h=f.getUTCDay(),m=(h<p?7:0)+h-p;return f.setUTCDate(f.getUTCDate()-m),f.setUTCHours(0,0,0,0),f}function La(n,e){var t,r,i,o,a,s,c,d;le(1,arguments);var u=ue(n),p=u.getUTCFullYear(),f=cn(),h=he((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:f.firstWeekContainsDate)!==null&&r!==void 0?r:(c=f.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setUTCFullYear(p+1,0,h),m.setUTCHours(0,0,0,0);var y=hr(m,e),w=new Date(0);w.setUTCFullYear(p,0,h),w.setUTCHours(0,0,0,0);var x=hr(w,e);return u.getTime()>=y.getTime()?p+1:u.getTime()>=x.getTime()?p:p-1}function Mg(n,e){var t,r,i,o,a,s,c,d;le(1,arguments);var u=cn(),p=he((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),f=La(n,e),h=new Date(0);h.setUTCFullYear(f,0,p),h.setUTCHours(0,0,0,0);var m=hr(h,e);return m}var Sg=6048e5;function Rc(n,e){le(1,arguments);var t=ue(n),r=hr(t,e).getTime()-Mg(t,e).getTime();return Math.round(r/Sg)+1}function Oe(n,e){for(var t=n<0?"-":"",r=Math.abs(n).toString();r.length<e;)r="0"+r;return t+r}var Dg={y:function(e,t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return Oe(t==="yy"?i%100:i,t.length)},M:function(e,t){var r=e.getUTCMonth();return t==="M"?String(r+1):Oe(r+1,2)},d:function(e,t){return Oe(e.getUTCDate(),t.length)},a:function(e,t){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(e,t){return Oe(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Oe(e.getUTCHours(),t.length)},m:function(e,t){return Oe(e.getUTCMinutes(),t.length)},s:function(e,t){return Oe(e.getUTCSeconds(),t.length)},S:function(e,t){var r=t.length,i=e.getUTCMilliseconds(),o=Math.floor(i*Math.pow(10,r-3));return Oe(o,t.length)}};const Ln=Dg;var zr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ag={G:function(e,t,r){var i=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){var i=e.getUTCFullYear(),o=i>0?i:1-i;return r.ordinalNumber(o,{unit:"year"})}return Ln.y(e,t)},Y:function(e,t,r,i){var o=La(e,i),a=o>0?o:1-o;if(t==="YY"){var s=a%100;return Oe(s,2)}return t==="Yo"?r.ordinalNumber(a,{unit:"year"}):Oe(a,t.length)},R:function(e,t){var r=Pc(e);return Oe(r,t.length)},u:function(e,t){var r=e.getUTCFullYear();return Oe(r,t.length)},Q:function(e,t,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Oe(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,r){var i=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Oe(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,r){var i=e.getUTCMonth();switch(t){case"M":case"MM":return Ln.M(e,t);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,r){var i=e.getUTCMonth();switch(t){case"L":return String(i+1);case"LL":return Oe(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,r,i){var o=Rc(e,i);return t==="wo"?r.ordinalNumber(o,{unit:"week"}):Oe(o,t.length)},I:function(e,t,r){var i=Ic(e);return t==="Io"?r.ordinalNumber(i,{unit:"week"}):Oe(i,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):Ln.d(e,t)},D:function(e,t,r){var i=xg(e);return t==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Oe(i,t.length)},E:function(e,t,r){var i=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Oe(a,2);case"eo":return r.ordinalNumber(a,{unit:"day"});case"eee":return r.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(o,{width:"short",context:"formatting"});case"eeee":default:return r.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,r,i){var o=e.getUTCDay(),a=(o-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Oe(a,t.length);case"co":return r.ordinalNumber(a,{unit:"day"});case"ccc":return r.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(o,{width:"narrow",context:"standalone"});case"cccccc":return r.day(o,{width:"short",context:"standalone"});case"cccc":default:return r.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,r){var i=e.getUTCDay(),o=i===0?7:i;switch(t){case"i":return String(o);case"ii":return Oe(o,t.length);case"io":return r.ordinalNumber(o,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,r){var i=e.getUTCHours(),o=i/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,r){var i=e.getUTCHours(),o;switch(i===12?o=zr.noon:i===0?o=zr.midnight:o=i/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,r){var i=e.getUTCHours(),o;switch(i>=17?o=zr.evening:i>=12?o=zr.afternoon:i>=4?o=zr.morning:o=zr.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){var i=e.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return Ln.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Ln.H(e,t)},K:function(e,t,r){var i=e.getUTCHours()%12;return t==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Oe(i,t.length)},k:function(e,t,r){var i=e.getUTCHours();return i===0&&(i=24),t==="ko"?r.ordinalNumber(i,{unit:"hour"}):Oe(i,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Ln.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Ln.s(e,t)},S:function(e,t){return Ln.S(e,t)},X:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return Lc(a);case"XXXX":case"XX":return mr(a);case"XXXXX":case"XXX":default:return mr(a,":")}},x:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"x":return Lc(a);case"xxxx":case"xx":return mr(a);case"xxxxx":case"xxx":default:return mr(a,":")}},O:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vc(a,":");case"OOOO":default:return"GMT"+mr(a,":")}},z:function(e,t,r,i){var o=i._originalDate||e,a=o.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vc(a,":");case"zzzz":default:return"GMT"+mr(a,":")}},t:function(e,t,r,i){var o=i._originalDate||e,a=Math.floor(o.getTime()/1e3);return Oe(a,t.length)},T:function(e,t,r,i){var o=i._originalDate||e,a=o.getTime();return Oe(a,t.length)}};function Vc(n,e){var t=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),o=r%60;if(o===0)return t+String(i);var a=e||"";return t+String(i)+a+Oe(o,2)}function Lc(n,e){if(n%60===0){var t=n>0?"-":"+";return t+Oe(Math.abs(n)/60,2)}return mr(n,e)}function mr(n,e){var t=e||"",r=n>0?"-":"+",i=Math.abs(n),o=Oe(Math.floor(i/60),2),a=Oe(i%60,2);return r+o+t+a}var $c=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Fc=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Eg=function(e,t){var r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return $c(e,t);var a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",$c(i,t)).replace("{{time}}",Fc(o,t))},$a={p:Fc,P:Eg},Ng=["D","DD"],Og=["YY","YYYY"];function zc(n){return Ng.indexOf(n)!==-1}function Hc(n){return Og.indexOf(n)!==-1}function Co(n,e,t){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(t,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var _g={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Bg=function(e,t,r){var i,o=_g[e];return typeof o=="string"?i=o:t===1?i=o.one:i=o.other.replace("{{count}}",t.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const Pg=Bg;function Fa(n){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.width?String(e.width):n.defaultWidth,r=n.formats[t]||n.formats[n.defaultWidth];return r}}var Ig={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Rg={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Vg={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Lg={date:Fa({formats:Ig,defaultWidth:"full"}),time:Fa({formats:Rg,defaultWidth:"full"}),dateTime:Fa({formats:Vg,defaultWidth:"full"})};const $g=Lg;var Fg={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},zg=function(e,t,r,i){return Fg[e]};const Hg=zg;function Ai(n){return function(e,t){var r=t!=null&&t.context?String(t.context):"standalone",i;if(r==="formatting"&&n.formattingValues){var o=n.defaultFormattingWidth||n.defaultWidth,a=t!=null&&t.width?String(t.width):o;i=n.formattingValues[a]||n.formattingValues[o]}else{var s=n.defaultWidth,c=t!=null&&t.width?String(t.width):n.defaultWidth;i=n.values[c]||n.values[s]}var d=n.argumentCallback?n.argumentCallback(e):e;return i[d]}}var Yg={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},jg={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ug={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Wg={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},qg={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Kg={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Gg=function(e,t){var r=Number(e),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Jg={ordinalNumber:Gg,era:Ai({values:Yg,defaultWidth:"wide"}),quarter:Ai({values:jg,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Ai({values:Ug,defaultWidth:"wide"}),day:Ai({values:Wg,defaultWidth:"wide"}),dayPeriod:Ai({values:qg,defaultWidth:"wide",formattingValues:Kg,defaultFormattingWidth:"wide"})};const Qg=Jg;function Ei(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.width,i=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],o=e.match(i);if(!o)return null;var a=o[0],s=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(s)?Zg(s,function(p){return p.test(a)}):Xg(s,function(p){return p.test(a)}),d;d=n.valueCallback?n.valueCallback(c):c,d=t.valueCallback?t.valueCallback(d):d;var u=e.slice(a.length);return{value:d,rest:u}}}function Xg(n,e){for(var t in n)if(n.hasOwnProperty(t)&&e(n[t]))return t}function Zg(n,e){for(var t=0;t<n.length;t++)if(e(n[t]))return t}function ey(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.match(n.matchPattern);if(!r)return null;var i=r[0],o=e.match(n.parsePattern);if(!o)return null;var a=n.valueCallback?n.valueCallback(o[0]):o[0];a=t.valueCallback?t.valueCallback(a):a;var s=e.slice(i.length);return{value:a,rest:s}}}var ty=/^(\d+)(th|st|nd|rd)?/i,ny=/\d+/i,ry={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},iy={any:[/^b/i,/^(a|c)/i]},oy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ay={any:[/1/i,/2/i,/3/i,/4/i]},sy={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},ly={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},cy={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},dy={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},uy={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},py={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fy={ordinalNumber:ey({matchPattern:ty,parsePattern:ny,valueCallback:function(e){return parseInt(e,10)}}),era:Ei({matchPatterns:ry,defaultMatchWidth:"wide",parsePatterns:iy,defaultParseWidth:"any"}),quarter:Ei({matchPatterns:oy,defaultMatchWidth:"wide",parsePatterns:ay,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Ei({matchPatterns:sy,defaultMatchWidth:"wide",parsePatterns:ly,defaultParseWidth:"any"}),day:Ei({matchPatterns:cy,defaultMatchWidth:"wide",parsePatterns:dy,defaultParseWidth:"any"}),dayPeriod:Ei({matchPatterns:uy,defaultMatchWidth:"any",parsePatterns:py,defaultParseWidth:"any"})},hy={code:"en-US",formatDistance:Pg,formatLong:$g,formatRelative:Hg,localize:Qg,match:fy,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Yc=hy;var my=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,yy=/^'([^]*?)'?$/,vy=/''/g,by=/[a-zA-Z]/;function $n(n,e,t){var r,i,o,a,s,c,d,u,p,f,h,m,y,w,x,C,N,v;le(2,arguments);var O=String(e),k=cn(),E=(r=(i=t==null?void 0:t.locale)!==null&&i!==void 0?i:k.locale)!==null&&r!==void 0?r:Yc,W=he((o=(a=(s=(c=t==null?void 0:t.firstWeekContainsDate)!==null&&c!==void 0?c:t==null||(d=t.locale)===null||d===void 0||(u=d.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&s!==void 0?s:k.firstWeekContainsDate)!==null&&a!==void 0?a:(p=k.locale)===null||p===void 0||(f=p.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&o!==void 0?o:1);if(!(W>=1&&W<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=he((h=(m=(y=(w=t==null?void 0:t.weekStartsOn)!==null&&w!==void 0?w:t==null||(x=t.locale)===null||x===void 0||(C=x.options)===null||C===void 0?void 0:C.weekStartsOn)!==null&&y!==void 0?y:k.weekStartsOn)!==null&&m!==void 0?m:(N=k.locale)===null||N===void 0||(v=N.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&h!==void 0?h:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!E.localize)throw new RangeError("locale must contain localize property");if(!E.formatLong)throw new RangeError("locale must contain formatLong property");var T=ue(n);if(!Si(T))throw new RangeError("Invalid time value");var _=xo(T),z=Bc(T,_),q={firstWeekContainsDate:W,weekStartsOn:P,locale:E,_originalDate:T},L=O.match(gy).map(function(S){var R=S[0];if(R==="p"||R==="P"){var V=$a[R];return V(S,E.formatLong)}return S}).join("").match(my).map(function(S){if(S==="''")return"'";var R=S[0];if(R==="'")return wy(S);var V=Ag[R];if(V)return!(t!=null&&t.useAdditionalWeekYearTokens)&&Hc(S)&&Co(S,e,String(n)),!(t!=null&&t.useAdditionalDayOfYearTokens)&&zc(S)&&Co(S,e,String(n)),V(z,S,E.localize,q);if(R.match(by))throw new RangeError("Format string contains an unescaped latin alphabet character `"+R+"`");return S}).join("");return L}function wy(n){var e=n.match(yy);return e?e[1].replace(vy,"'"):n}function ky(n,e){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t]);return n}function xy(n){le(1,arguments);var e=ue(n),t=e.getDay();return t}function Cy(n){le(1,arguments);var e=ue(n),t=e.getFullYear(),r=e.getMonth(),i=new Date(0);return i.setFullYear(t,r+1,0),i.setHours(0,0,0,0),i.getDate()}function Gt(n){le(1,arguments);var e=ue(n),t=e.getHours();return t}var Ty=6048e5;function My(n){le(1,arguments);var e=ue(n),t=ko(e).getTime()-pg(e).getTime();return Math.round(t/Ty)+1}function dn(n){le(1,arguments);var e=ue(n),t=e.getMinutes();return t}function Se(n){le(1,arguments);var e=ue(n),t=e.getMonth();return t}function Hr(n){le(1,arguments);var e=ue(n),t=e.getSeconds();return t}function Sy(n,e){var t,r,i,o,a,s,c,d;le(1,arguments);var u=ue(n),p=u.getFullYear(),f=cn(),h=he((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:f.firstWeekContainsDate)!==null&&r!==void 0?r:(c=f.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var m=new Date(0);m.setFullYear(p+1,0,h),m.setHours(0,0,0,0);var y=fr(m,e),w=new Date(0);w.setFullYear(p,0,h),w.setHours(0,0,0,0);var x=fr(w,e);return u.getTime()>=y.getTime()?p+1:u.getTime()>=x.getTime()?p:p-1}function Dy(n,e){var t,r,i,o,a,s,c,d;le(1,arguments);var u=cn(),p=he((t=(r=(i=(o=e==null?void 0:e.firstWeekContainsDate)!==null&&o!==void 0?o:e==null||(a=e.locale)===null||a===void 0||(s=a.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(c=u.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&t!==void 0?t:1),f=Sy(n,e),h=new Date(0);h.setFullYear(f,0,p),h.setHours(0,0,0,0);var m=fr(h,e);return m}var Ay=6048e5;function Ey(n,e){le(1,arguments);var t=ue(n),r=fr(t,e).getTime()-Dy(t,e).getTime();return Math.round(r/Ay)+1}function we(n){return le(1,arguments),ue(n).getFullYear()}function Ni(n,e){le(2,arguments);var t=ue(n),r=ue(e);return t.getTime()>r.getTime()}function Oi(n,e){le(2,arguments);var t=ue(n),r=ue(e);return t.getTime()<r.getTime()}function Yr(n,e){le(2,arguments);var t=ue(n),r=ue(e);return t.getTime()===r.getTime()}function jc(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function Uc(n,e){if(n){if(typeof n=="string")return jc(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return jc(n,e)}}function Wc(n,e){var t=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=Uc(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(d){throw d},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,a=!1,s;return{s:function(){t=t.call(n)},n:function(){var d=t.next();return o=d.done,d},e:function(d){a=!0,s=d},f:function(){try{!o&&t.return!=null&&t.return()}finally{if(a)throw s}}}}function se(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function za(n,e){return za=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},za(n,e)}function De(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&za(n,e)}function To(n){return To=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},To(n)}function qc(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qc=function(){return!!n})()}function Ny(n,e){if(e&&($t(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return se(n)}function Ae(n){var e=qc();return function(){var r=To(n),i;if(e){var o=To(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return Ny(this,i)}}function Ce(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Oy(n,e){if($t(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if($t(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Kc(n){var e=Oy(n,"string");return $t(e)=="symbol"?e:String(e)}function Gc(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Kc(r.key),r)}}function Te(n,e,t){return e&&Gc(n.prototype,e),t&&Gc(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function ie(n,e,t){return e=Kc(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var _y=10,Jc=function(){function n(){Ce(this,n),ie(this,"priority",void 0),ie(this,"subPriority",0)}return Te(n,[{key:"validate",value:function(t,r){return!0}}]),n}(),By=function(n){De(t,n);var e=Ae(t);function t(r,i,o,a,s){var c;return Ce(this,t),c=e.call(this),c.value=r,c.validateValue=i,c.setValue=o,c.priority=a,s&&(c.subPriority=s),c}return Te(t,[{key:"validate",value:function(i,o){return this.validateValue(i,this.value,o)}},{key:"set",value:function(i,o,a){return this.setValue(i,o,this.value,a)}}]),t}(Jc),Py=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",_y),ie(se(r),"subPriority",-1),r}return Te(t,[{key:"set",value:function(i,o){if(o.timestampIsSet)return i;var a=new Date(0);return a.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),a.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),a}}]),t}(Jc),Ee=function(){function n(){Ce(this,n),ie(this,"incompatibleTokens",void 0),ie(this,"priority",void 0),ie(this,"subPriority",void 0)}return Te(n,[{key:"run",value:function(t,r,i,o){var a=this.parse(t,r,i,o);return a?{setter:new By(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}},{key:"validate",value:function(t,r,i){return!0}}]),n}(),Iy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",140),ie(se(r),"incompatibleTokens",["R","u","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"G":case"GG":case"GGG":return a.era(i,{width:"abbreviated"})||a.era(i,{width:"narrow"});case"GGGGG":return a.era(i,{width:"narrow"});case"GGGG":default:return a.era(i,{width:"wide"})||a.era(i,{width:"abbreviated"})||a.era(i,{width:"narrow"})}}},{key:"set",value:function(i,o,a){return o.era=a,i.setUTCFullYear(a,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(Ee),je={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},un={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function Ue(n,e){return n&&{value:e(n.value),rest:n.rest}}function ze(n,e){var t=e.match(n);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function pn(n,e){var t=e.match(n);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};var r=t[1]==="+"?1:-1,i=t[2]?parseInt(t[2],10):0,o=t[3]?parseInt(t[3],10):0,a=t[5]?parseInt(t[5],10):0;return{value:r*(i*Va+o*Ra+a*gg),rest:e.slice(t[0].length)}}function Qc(n){return ze(je.anyDigitsSigned,n)}function He(n,e){switch(n){case 1:return ze(je.singleDigit,e);case 2:return ze(je.twoDigits,e);case 3:return ze(je.threeDigits,e);case 4:return ze(je.fourDigits,e);default:return ze(new RegExp("^\\d{1,"+n+"}"),e)}}function Mo(n,e){switch(n){case 1:return ze(je.singleDigitSigned,e);case 2:return ze(je.twoDigitsSigned,e);case 3:return ze(je.threeDigitsSigned,e);case 4:return ze(je.fourDigitsSigned,e);default:return ze(new RegExp("^-?\\d{1,"+n+"}"),e)}}function Ha(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Xc(n,e){var t=e>0,r=t?e:1-e,i;if(r<=50)i=n||100;else{var o=r+50,a=Math.floor(o/100)*100,s=n>=o%100;i=n+a-(s?100:0)}return t?i:1-i}function Zc(n){return n%400===0||n%4===0&&n%100!==0}var Ry=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",130),ie(se(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){var s=function(d){return{year:d,isTwoDigitYear:o==="yy"}};switch(o){case"y":return Ue(He(4,i),s);case"yo":return Ue(a.ordinalNumber(i,{unit:"year"}),s);default:return Ue(He(o.length,i),s)}}},{key:"validate",value:function(i,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(i,o,a){var s=i.getUTCFullYear();if(a.isTwoDigitYear){var c=Xc(a.year,s);return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}var d=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(d,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(Ee),Vy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",130),ie(se(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){var s=function(d){return{year:d,isTwoDigitYear:o==="YY"}};switch(o){case"Y":return Ue(He(4,i),s);case"Yo":return Ue(a.ordinalNumber(i,{unit:"year"}),s);default:return Ue(He(o.length,i),s)}}},{key:"validate",value:function(i,o){return o.isTwoDigitYear||o.year>0}},{key:"set",value:function(i,o,a,s){var c=La(i,s);if(a.isTwoDigitYear){var d=Xc(a.year,c);return i.setUTCFullYear(d,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),hr(i,s)}var u=!("era"in o)||o.era===1?a.year:1-a.year;return i.setUTCFullYear(u,0,s.firstWeekContainsDate),i.setUTCHours(0,0,0,0),hr(i,s)}}]),t}(Ee),Ly=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",130),ie(se(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o){return Mo(o==="R"?4:o.length,i)}},{key:"set",value:function(i,o,a){var s=new Date(0);return s.setUTCFullYear(a,0,4),s.setUTCHours(0,0,0,0),Fr(s)}}]),t}(Ee),$y=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",130),ie(se(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o){return Mo(o==="u"?4:o.length,i)}},{key:"set",value:function(i,o,a){return i.setUTCFullYear(a,0,1),i.setUTCHours(0,0,0,0),i}}]),t}(Ee),Fy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",120),ie(se(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"Q":case"QQ":return He(o.length,i);case"Qo":return a.ordinalNumber(i,{unit:"quarter"});case"QQQ":return a.quarter(i,{width:"abbreviated",context:"formatting"})||a.quarter(i,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(i,{width:"wide",context:"formatting"})||a.quarter(i,{width:"abbreviated",context:"formatting"})||a.quarter(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),t}(Ee),zy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",120),ie(se(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"q":case"qq":return He(o.length,i);case"qo":return a.ordinalNumber(i,{unit:"quarter"});case"qqq":return a.quarter(i,{width:"abbreviated",context:"standalone"})||a.quarter(i,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(i,{width:"wide",context:"standalone"})||a.quarter(i,{width:"abbreviated",context:"standalone"})||a.quarter(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=1&&o<=4}},{key:"set",value:function(i,o,a){return i.setUTCMonth((a-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),t}(Ee),Hy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),ie(se(r),"priority",110),r}return Te(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d-1};switch(o){case"M":return Ue(ze(je.month,i),s);case"MM":return Ue(He(2,i),s);case"Mo":return Ue(a.ordinalNumber(i,{unit:"month"}),s);case"MMM":return a.month(i,{width:"abbreviated",context:"formatting"})||a.month(i,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(i,{width:"wide",context:"formatting"})||a.month(i,{width:"abbreviated",context:"formatting"})||a.month(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),t}(Ee),Yy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",110),ie(se(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d-1};switch(o){case"L":return Ue(ze(je.month,i),s);case"LL":return Ue(He(2,i),s);case"Lo":return Ue(a.ordinalNumber(i,{unit:"month"}),s);case"LLL":return a.month(i,{width:"abbreviated",context:"standalone"})||a.month(i,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(i,{width:"wide",context:"standalone"})||a.month(i,{width:"abbreviated",context:"standalone"})||a.month(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){return i.setUTCMonth(a,1),i.setUTCHours(0,0,0,0),i}}]),t}(Ee);function jy(n,e,t){le(2,arguments);var r=ue(n),i=he(e),o=Rc(r,t)-i;return r.setUTCDate(r.getUTCDate()-o*7),r}var Uy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",100),ie(se(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"w":return ze(je.week,i);case"wo":return a.ordinalNumber(i,{unit:"week"});default:return He(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=53}},{key:"set",value:function(i,o,a,s){return hr(jy(i,a,s),s)}}]),t}(Ee);function Wy(n,e){le(2,arguments);var t=ue(n),r=he(e),i=Ic(t)-r;return t.setUTCDate(t.getUTCDate()-i*7),t}var qy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",100),ie(se(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"I":return ze(je.week,i);case"Io":return a.ordinalNumber(i,{unit:"week"});default:return He(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=53}},{key:"set",value:function(i,o,a){return Fr(Wy(i,a))}}]),t}(Ee),Ky=[31,28,31,30,31,30,31,31,30,31,30,31],Gy=[31,29,31,30,31,30,31,31,30,31,30,31],Jy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",90),ie(se(r),"subPriority",1),ie(se(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"d":return ze(je.date,i);case"do":return a.ordinalNumber(i,{unit:"date"});default:return He(o.length,i)}}},{key:"validate",value:function(i,o){var a=i.getUTCFullYear(),s=Zc(a),c=i.getUTCMonth();return s?o>=1&&o<=Gy[c]:o>=1&&o<=Ky[c]}},{key:"set",value:function(i,o,a){return i.setUTCDate(a),i.setUTCHours(0,0,0,0),i}}]),t}(Ee),Qy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",90),ie(se(r),"subpriority",1),ie(se(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"D":case"DD":return ze(je.dayOfYear,i);case"Do":return a.ordinalNumber(i,{unit:"date"});default:return He(o.length,i)}}},{key:"validate",value:function(i,o){var a=i.getUTCFullYear(),s=Zc(a);return s?o>=1&&o<=366:o>=1&&o<=365}},{key:"set",value:function(i,o,a){return i.setUTCMonth(0,a),i.setUTCHours(0,0,0,0),i}}]),t}(Ee);function Ya(n,e,t){var r,i,o,a,s,c,d,u;le(2,arguments);var p=cn(),f=he((r=(i=(o=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(c=s.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&o!==void 0?o:p.weekStartsOn)!==null&&i!==void 0?i:(d=p.locale)===null||d===void 0||(u=d.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=ue(n),m=he(e),y=h.getUTCDay(),w=m%7,x=(w+7)%7,C=(x<f?7:0)+m-y;return h.setUTCDate(h.getUTCDate()+C),h}var Xy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",90),ie(se(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"E":case"EE":case"EEE":return a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=Ya(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(Ee),Zy=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",90),ie(se(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a,s){var c=function(u){var p=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+p};switch(o){case"e":case"ee":return Ue(He(o.length,i),c);case"eo":return Ue(a.ordinalNumber(i,{unit:"day"}),c);case"eee":return a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"eeeee":return a.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=Ya(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(Ee),e0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",90),ie(se(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a,s){var c=function(u){var p=Math.floor((u-1)/7)*7;return(u+s.weekStartsOn+6)%7+p};switch(o){case"c":case"cc":return Ue(He(o.length,i),c);case"co":return Ue(a.ordinalNumber(i,{unit:"day"}),c);case"ccc":return a.day(i,{width:"abbreviated",context:"standalone"})||a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"});case"ccccc":return a.day(i,{width:"narrow",context:"standalone"});case"cccccc":return a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(i,{width:"wide",context:"standalone"})||a.day(i,{width:"abbreviated",context:"standalone"})||a.day(i,{width:"short",context:"standalone"})||a.day(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,o){return o>=0&&o<=6}},{key:"set",value:function(i,o,a,s){return i=Ya(i,a,s),i.setUTCHours(0,0,0,0),i}}]),t}(Ee);function t0(n,e){le(2,arguments);var t=he(e);t%7===0&&(t=t-7);var r=1,i=ue(n),o=i.getUTCDay(),a=t%7,s=(a+7)%7,c=(s<r?7:0)+t-o;return i.setUTCDate(i.getUTCDate()+c),i}var n0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",90),ie(se(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){var s=function(d){return d===0?7:d};switch(o){case"i":case"ii":return He(o.length,i);case"io":return a.ordinalNumber(i,{unit:"day"});case"iii":return Ue(a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s);case"iiiii":return Ue(a.day(i,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Ue(a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s);case"iiii":default:return Ue(a.day(i,{width:"wide",context:"formatting"})||a.day(i,{width:"abbreviated",context:"formatting"})||a.day(i,{width:"short",context:"formatting"})||a.day(i,{width:"narrow",context:"formatting"}),s)}}},{key:"validate",value:function(i,o){return o>=1&&o<=7}},{key:"set",value:function(i,o,a){return i=t0(i,a),i.setUTCHours(0,0,0,0),i}}]),t}(Ee),r0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",80),ie(se(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"a":case"aa":case"aaa":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Ha(a),0,0,0),i}}]),t}(Ee),i0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",80),ie(se(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"b":case"bb":case"bbb":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Ha(a),0,0,0),i}}]),t}(Ee),o0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",80),ie(se(r),"incompatibleTokens",["a","b","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"B":case"BB":case"BBB":return a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(i,{width:"wide",context:"formatting"})||a.dayPeriod(i,{width:"abbreviated",context:"formatting"})||a.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,o,a){return i.setUTCHours(Ha(a),0,0,0),i}}]),t}(Ee),a0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",70),ie(se(r),"incompatibleTokens",["H","K","k","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"h":return ze(je.hour12h,i);case"ho":return a.ordinalNumber(i,{unit:"hour"});default:return He(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=12}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):!s&&a===12?i.setUTCHours(0,0,0,0):i.setUTCHours(a,0,0,0),i}}]),t}(Ee),s0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",70),ie(se(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"H":return ze(je.hour23h,i);case"Ho":return a.ordinalNumber(i,{unit:"hour"});default:return He(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=23}},{key:"set",value:function(i,o,a){return i.setUTCHours(a,0,0,0),i}}]),t}(Ee),l0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",70),ie(se(r),"incompatibleTokens",["h","H","k","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"K":return ze(je.hour11h,i);case"Ko":return a.ordinalNumber(i,{unit:"hour"});default:return He(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=11}},{key:"set",value:function(i,o,a){var s=i.getUTCHours()>=12;return s&&a<12?i.setUTCHours(a+12,0,0,0):i.setUTCHours(a,0,0,0),i}}]),t}(Ee),c0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",70),ie(se(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"k":return ze(je.hour24h,i);case"ko":return a.ordinalNumber(i,{unit:"hour"});default:return He(o.length,i)}}},{key:"validate",value:function(i,o){return o>=1&&o<=24}},{key:"set",value:function(i,o,a){var s=a<=24?a%24:a;return i.setUTCHours(s,0,0,0),i}}]),t}(Ee),d0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",60),ie(se(r),"incompatibleTokens",["t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"m":return ze(je.minute,i);case"mo":return a.ordinalNumber(i,{unit:"minute"});default:return He(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCMinutes(a,0,0),i}}]),t}(Ee),u0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",50),ie(se(r),"incompatibleTokens",["t","T"]),r}return Te(t,[{key:"parse",value:function(i,o,a){switch(o){case"s":return ze(je.second,i);case"so":return a.ordinalNumber(i,{unit:"second"});default:return He(o.length,i)}}},{key:"validate",value:function(i,o){return o>=0&&o<=59}},{key:"set",value:function(i,o,a){return i.setUTCSeconds(a,0),i}}]),t}(Ee),p0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",30),ie(se(r),"incompatibleTokens",["t","T"]),r}return Te(t,[{key:"parse",value:function(i,o){var a=function(c){return Math.floor(c*Math.pow(10,-o.length+3))};return Ue(He(o.length,i),a)}},{key:"set",value:function(i,o,a){return i.setUTCMilliseconds(a),i}}]),t}(Ee),f0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",10),ie(se(r),"incompatibleTokens",["t","T","x"]),r}return Te(t,[{key:"parse",value:function(i,o){switch(o){case"X":return pn(un.basicOptionalMinutes,i);case"XX":return pn(un.basic,i);case"XXXX":return pn(un.basicOptionalSeconds,i);case"XXXXX":return pn(un.extendedOptionalSeconds,i);case"XXX":default:return pn(un.extended,i)}}},{key:"set",value:function(i,o,a){return o.timestampIsSet?i:new Date(i.getTime()-a)}}]),t}(Ee),h0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",10),ie(se(r),"incompatibleTokens",["t","T","X"]),r}return Te(t,[{key:"parse",value:function(i,o){switch(o){case"x":return pn(un.basicOptionalMinutes,i);case"xx":return pn(un.basic,i);case"xxxx":return pn(un.basicOptionalSeconds,i);case"xxxxx":return pn(un.extendedOptionalSeconds,i);case"xxx":default:return pn(un.extended,i)}}},{key:"set",value:function(i,o,a){return o.timestampIsSet?i:new Date(i.getTime()-a)}}]),t}(Ee),m0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",40),ie(se(r),"incompatibleTokens","*"),r}return Te(t,[{key:"parse",value:function(i){return Qc(i)}},{key:"set",value:function(i,o,a){return[new Date(a*1e3),{timestampIsSet:!0}]}}]),t}(Ee),g0=function(n){De(t,n);var e=Ae(t);function t(){var r;Ce(this,t);for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r=e.call.apply(e,[this].concat(o)),ie(se(r),"priority",20),ie(se(r),"incompatibleTokens","*"),r}return Te(t,[{key:"parse",value:function(i){return Qc(i)}},{key:"set",value:function(i,o,a){return[new Date(a),{timestampIsSet:!0}]}}]),t}(Ee),y0={G:new Iy,y:new Ry,Y:new Vy,R:new Ly,u:new $y,Q:new Fy,q:new zy,M:new Hy,L:new Yy,w:new Uy,I:new qy,d:new Jy,D:new Qy,E:new Xy,e:new Zy,c:new e0,i:new n0,a:new r0,b:new i0,B:new o0,h:new a0,H:new s0,K:new l0,k:new c0,m:new d0,s:new u0,S:new p0,X:new f0,x:new h0,t:new m0,T:new g0},v0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,b0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,w0=/^'([^]*?)'?$/,k0=/''/g,x0=/\S/,C0=/[a-zA-Z]/;function ja(n,e,t,r){var i,o,a,s,c,d,u,p,f,h,m,y,w,x,C,N,v,O;le(3,arguments);var k=String(n),E=String(e),W=cn(),P=(i=(o=r==null?void 0:r.locale)!==null&&o!==void 0?o:W.locale)!==null&&i!==void 0?i:Yc;if(!P.match)throw new RangeError("locale must contain match property");var T=he((a=(s=(c=(d=r==null?void 0:r.firstWeekContainsDate)!==null&&d!==void 0?d:r==null||(u=r.locale)===null||u===void 0||(p=u.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&c!==void 0?c:W.firstWeekContainsDate)!==null&&s!==void 0?s:(f=W.locale)===null||f===void 0||(h=f.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(T>=1&&T<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var _=he((m=(y=(w=(x=r==null?void 0:r.weekStartsOn)!==null&&x!==void 0?x:r==null||(C=r.locale)===null||C===void 0||(N=C.options)===null||N===void 0?void 0:N.weekStartsOn)!==null&&w!==void 0?w:W.weekStartsOn)!==null&&y!==void 0?y:(v=W.locale)===null||v===void 0||(O=v.options)===null||O===void 0?void 0:O.weekStartsOn)!==null&&m!==void 0?m:0);if(!(_>=0&&_<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(E==="")return k===""?ue(t):new Date(NaN);var z={firstWeekContainsDate:T,weekStartsOn:_,locale:P},q=[new Py],L=E.match(b0).map(function(te){var K=te[0];if(K in $a){var ce=$a[K];return ce(te,P.formatLong)}return te}).join("").match(v0),S=[],R=Wc(L),V;try{var j=function(){var K=V.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&Hc(K)&&Co(K,E,n),!(r!=null&&r.useAdditionalDayOfYearTokens)&&zc(K)&&Co(K,E,n);var ce=K[0],ae=y0[ce];if(ae){var U=ae.incompatibleTokens;if(Array.isArray(U)){var Z=S.find(function(ne){return U.includes(ne.token)||ne.token===ce});if(Z)throw new RangeError("The format string mustn't contain `".concat(Z.fullToken,"` and `").concat(K,"` at the same time"))}else if(ae.incompatibleTokens==="*"&&S.length>0)throw new RangeError("The format string mustn't contain `".concat(K,"` and any other token at the same time"));S.push({token:ce,fullToken:K});var me=ae.run(k,K,P.match,z);if(!me)return{v:new Date(NaN)};q.push(me.setter),k=me.rest}else{if(ce.match(C0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ce+"`");if(K==="''"?K="'":ce==="'"&&(K=T0(K)),k.indexOf(K)===0)k=k.slice(K.length);else return{v:new Date(NaN)}}};for(R.s();!(V=R.n()).done;){var b=j();if($t(b)==="object")return b.v}}catch(te){R.e(te)}finally{R.f()}if(k.length>0&&x0.test(k))return new Date(NaN);var g=q.map(function(te){return te.priority}).sort(function(te,K){return K-te}).filter(function(te,K,ce){return ce.indexOf(te)===K}).map(function(te){return q.filter(function(K){return K.priority===te}).sort(function(K,ce){return ce.subPriority-K.subPriority})}).map(function(te){return te[0]}),M=ue(t);if(isNaN(M.getTime()))return new Date(NaN);var A=Bc(M,xo(M)),$={},F=Wc(g),B;try{for(F.s();!(B=F.n()).done;){var D=B.value;if(!D.validate(A,z))return new Date(NaN);var ee=D.set(A,$,z);Array.isArray(ee)?(A=ee[0],ky($,ee[1])):A=ee}}catch(te){F.e(te)}finally{F.f()}return A}function T0(n){return n.match(w0)[1].replace(k0,"'")}function ed(n,e){le(2,arguments);var t=Di(n),r=Di(e);return t.getTime()===r.getTime()}function M0(n,e){le(2,arguments);var t=he(e);return Dn(n,-t)}function S0(n,e){var t;le(1,arguments);var r=he((t=e==null?void 0:e.additionalDigits)!==null&&t!==void 0?t:2);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=N0(n),o;if(i.date){var a=O0(i.date,r);o=_0(a.restDateString,a.year)}if(!o||isNaN(o.getTime()))return new Date(NaN);var s=o.getTime(),c=0,d;if(i.time&&(c=B0(i.time),isNaN(c)))return new Date(NaN);if(i.timezone){if(d=P0(i.timezone),isNaN(d))return new Date(NaN)}else{var u=new Date(s+c),p=new Date(0);return p.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),p.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),p}return new Date(s+c+d)}var So={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},D0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,A0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,E0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function N0(n){var e={},t=n.split(So.dateTimeDelimiter),r;if(t.length>2)return e;if(/:/.test(t[0])?r=t[0]:(e.date=t[0],r=t[1],So.timeZoneDelimiter.test(e.date)&&(e.date=n.split(So.timeZoneDelimiter)[0],r=n.substr(e.date.length,n.length))),r){var i=So.timezone.exec(r);i?(e.time=r.replace(i[1],""),e.timezone=i[1]):e.time=r}return e}function O0(n,e){var t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),r=n.match(t);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?i:o*100,restDateString:n.slice((r[1]||r[2]).length)}}function _0(n,e){if(e===null)return new Date(NaN);var t=n.match(D0);if(!t)return new Date(NaN);var r=!!t[4],i=_i(t[1]),o=_i(t[2])-1,a=_i(t[3]),s=_i(t[4]),c=_i(t[5])-1;if(r)return $0(e,s,c)?I0(e,s,c):new Date(NaN);var d=new Date(0);return!V0(e,o,a)||!L0(e,i)?new Date(NaN):(d.setUTCFullYear(e,o,Math.max(i,a)),d)}function _i(n){return n?parseInt(n):1}function B0(n){var e=n.match(A0);if(!e)return NaN;var t=Ua(e[1]),r=Ua(e[2]),i=Ua(e[3]);return F0(t,r,i)?t*Va+r*Ra+i*1e3:NaN}function Ua(n){return n&&parseFloat(n.replace(",","."))||0}function P0(n){if(n==="Z")return 0;var e=n.match(E0);if(!e)return 0;var t=e[1]==="+"?-1:1,r=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return z0(r,i)?t*(r*Va+i*Ra):NaN}function I0(n,e,t){var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,o=(e-1)*7+t+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var R0=[31,null,31,30,31,30,31,31,30,31,30,31];function td(n){return n%400===0||n%4===0&&n%100!==0}function V0(n,e,t){return e>=0&&e<=11&&t>=1&&t<=(R0[e]||(td(n)?29:28))}function L0(n,e){return e>=1&&e<=(td(n)?366:365)}function $0(n,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function F0(n,e,t){return n===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&n>=0&&n<25}function z0(n,e){return e>=0&&e<=59}function nd(n,e){le(2,arguments);var t=ue(n),r=he(e),i=t.getFullYear(),o=t.getDate(),a=new Date(0);a.setFullYear(i,r,15),a.setHours(0,0,0,0);var s=Cy(a);return t.setMonth(r,Math.min(o,s)),t}function Ie(n,e){if(le(2,arguments),$t(e)!=="object"||e===null)throw new RangeError("values parameter must be an object");var t=ue(n);return isNaN(t.getTime())?new Date(NaN):(e.year!=null&&t.setFullYear(e.year),e.month!=null&&(t=nd(t,e.month)),e.date!=null&&t.setDate(he(e.date)),e.hours!=null&&t.setHours(he(e.hours)),e.minutes!=null&&t.setMinutes(he(e.minutes)),e.seconds!=null&&t.setSeconds(he(e.seconds)),e.milliseconds!=null&&t.setMilliseconds(he(e.milliseconds)),t)}function rd(n,e){le(2,arguments);var t=ue(n),r=he(e);return t.setHours(r),t}function Wa(n,e){le(2,arguments);var t=ue(n),r=he(e);return t.setMilliseconds(r),t}function id(n,e){le(2,arguments);var t=ue(n),r=he(e);return t.setMinutes(r),t}function qa(n,e){le(2,arguments);var t=ue(n),r=he(e);return t.setSeconds(r),t}function fn(n,e){le(2,arguments);var t=ue(n),r=he(e);return isNaN(t.getTime())?new Date(NaN):(t.setFullYear(r),t)}function jr(n,e){le(2,arguments);var t=he(e);return Kt(n,-t)}function H0(n,e){if(le(2,arguments),!e||$t(e)!=="object")return new Date(NaN);var t=e.years?he(e.years):0,r=e.months?he(e.months):0,i=e.weeks?he(e.weeks):0,o=e.days?he(e.days):0,a=e.hours?he(e.hours):0,s=e.minutes?he(e.minutes):0,c=e.seconds?he(e.seconds):0,d=jr(n,r+t*12),u=M0(d,o+i*7),p=s+a*60,f=c+p*60,h=f*1e3,m=new Date(u.getTime()-h);return m}function od(n,e){le(2,arguments);var t=he(e);return Ia(n,-t)}function Ur(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),l.createElementVNode("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),l.createElementVNode("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),l.createElementVNode("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}Ur.compatConfig={MODE:3};function ad(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),l.createElementVNode("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}ad.compatConfig={MODE:3};function Ka(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}Ka.compatConfig={MODE:3};function Ga(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}Ga.compatConfig={MODE:3};function Ja(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),l.createElementVNode("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}Ja.compatConfig={MODE:3};function Qa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}Qa.compatConfig={MODE:3};function Xa(){return l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon"},[l.createElementVNode("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}Xa.compatConfig={MODE:3};function Za(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sd={exports:{}};(function(n){function e(t){return t&&t.__esModule?t:{default:t}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(sd);var Y0=sd.exports,es={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r){if(r===null||r===!0||r===!1)return NaN;var i=Number(r);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}n.exports=e.default})(es,es.exports);var j0=es.exports;const U0=Za(j0);var ts={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r){var i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return i.setUTCFullYear(r.getFullYear()),r.getTime()-i.getTime()}n.exports=e.default})(ts,ts.exports);var W0=ts.exports;const ld=Za(W0);function q0(n,e){var t=Q0(e);return t.formatToParts?G0(t,n):J0(t,n)}var K0={year:0,month:1,day:2,hour:3,minute:4,second:5};function G0(n,e){try{for(var t=n.formatToParts(e),r=[],i=0;i<t.length;i++){var o=K0[t[i].type];o>=0&&(r[o]=parseInt(t[i].value,10))}return r}catch(a){if(a instanceof RangeError)return[NaN];throw a}}function J0(n,e){var t=n.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(t);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var ns={};function Q0(n){if(!ns[n]){var e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),t=e==="06/25/2014, 00:00:00"||e==="06/25/2014 00:00:00";ns[n]=t?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return ns[n]}function rs(n,e,t,r,i,o,a){var s=new Date(0);return s.setUTCFullYear(n,e,t),s.setUTCHours(r,i,o,a),s}var cd=36e5,X0=6e4,is={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function as(n,e,t){var r,i;if(n===""||(r=is.timezoneZ.exec(n),r))return 0;var o;if(r=is.timezoneHH.exec(n),r)return o=parseInt(r[1],10),dd(o)?-(o*cd):NaN;if(r=is.timezoneHHMM.exec(n),r){o=parseInt(r[1],10);var a=parseInt(r[2],10);return dd(o,a)?(i=Math.abs(o)*cd+a*X0,o>0?-i:i):NaN}if(tv(n)){e=new Date(e||Date.now());var s=t?e:Z0(e),c=ss(s,n),d=t?c:ev(e,c,n);return-d}return NaN}function Z0(n){return rs(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function ss(n,e){var t=q0(n,e),r=rs(t[0],t[1]-1,t[2],t[3]%24,t[4],t[5],0).getTime(),i=n.getTime(),o=i%1e3;return i-=o>=0?o:1e3+o,r-i}function ev(n,e,t){var r=n.getTime(),i=r-e,o=ss(new Date(i),t);if(e===o)return e;i-=o-e;var a=ss(new Date(i),t);return o===a?o:Math.max(o,a)}function dd(n,e){return-23<=n&&n<=23&&(e==null||0<=e&&e<=59)}var ud={};function tv(n){if(ud[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),ud[n]=!0,!0}catch{return!1}}var pd=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,ls=36e5,fd=6e4,nv=2,yt={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:pd};function cs(n,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var t=e||{},r=t.additionalDigits==null?nv:U0(t.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var i=rv(n),o=iv(i.date,r),a=o.year,s=o.restDateString,c=ov(s,a);if(isNaN(c))return new Date(NaN);if(c){var d=c.getTime(),u=0,p;if(i.time&&(u=av(i.time),isNaN(u)))return new Date(NaN);if(i.timeZone||t.timeZone){if(p=as(i.timeZone||t.timeZone,new Date(d+u)),isNaN(p))return new Date(NaN)}else p=ld(new Date(d+u)),p=ld(new Date(d+u+p));return new Date(d+u+p)}else return new Date(NaN)}function rv(n){var e={},t=yt.dateTimePattern.exec(n),r;if(t?(e.date=t[1],r=t[3]):(t=yt.datePattern.exec(n),t?(e.date=t[1],r=t[2]):(e.date=null,r=n)),r){var i=yt.timeZone.exec(r);i?(e.time=r.replace(i[1],""),e.timeZone=i[1].trim()):e.time=r}return e}function iv(n,e){var t=yt.YYY[e],r=yt.YYYYY[e],i;if(i=yt.YYYY.exec(n)||r.exec(n),i){var o=i[1];return{year:parseInt(o,10),restDateString:n.slice(o.length)}}if(i=yt.YY.exec(n)||t.exec(n),i){var a=i[1];return{year:parseInt(a,10)*100,restDateString:n.slice(a.length)}}return{year:null}}function ov(n,e){if(e===null)return null;var t,r,i,o;if(n.length===0)return r=new Date(0),r.setUTCFullYear(e),r;if(t=yt.MM.exec(n),t)return r=new Date(0),i=parseInt(t[1],10)-1,gd(e,i)?(r.setUTCFullYear(e,i),r):new Date(NaN);if(t=yt.DDD.exec(n),t){r=new Date(0);var a=parseInt(t[1],10);return cv(e,a)?(r.setUTCFullYear(e,0,a),r):new Date(NaN)}if(t=yt.MMDD.exec(n),t){r=new Date(0),i=parseInt(t[1],10)-1;var s=parseInt(t[2],10);return gd(e,i,s)?(r.setUTCFullYear(e,i,s),r):new Date(NaN)}if(t=yt.Www.exec(n),t)return o=parseInt(t[1],10)-1,yd(e,o)?hd(e,o):new Date(NaN);if(t=yt.WwwD.exec(n),t){o=parseInt(t[1],10)-1;var c=parseInt(t[2],10)-1;return yd(e,o,c)?hd(e,o,c):new Date(NaN)}return null}function av(n){var e,t,r;if(e=yt.HH.exec(n),e)return t=parseFloat(e[1].replace(",",".")),ds(t)?t%24*ls:NaN;if(e=yt.HHMM.exec(n),e)return t=parseInt(e[1],10),r=parseFloat(e[2].replace(",",".")),ds(t,r)?t%24*ls+r*fd:NaN;if(e=yt.HHMMSS.exec(n),e){t=parseInt(e[1],10),r=parseInt(e[2],10);var i=parseFloat(e[3].replace(",","."));return ds(t,r,i)?t%24*ls+r*fd+i*1e3:NaN}return null}function hd(n,e,t){e=e||0,t=t||0;var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,o=e*7+t+1-i;return r.setUTCDate(r.getUTCDate()+o),r}var sv=[31,28,31,30,31,30,31,31,30,31,30,31],lv=[31,29,31,30,31,30,31,31,30,31,30,31];function md(n){return n%400===0||n%4===0&&n%100!==0}function gd(n,e,t){if(e<0||e>11)return!1;if(t!=null){if(t<1)return!1;var r=md(n);if(r&&t>lv[e]||!r&&t>sv[e])return!1}return!0}function cv(n,e){if(e<1)return!1;var t=md(n);return!(t&&e>366||!t&&e>365)}function yd(n,e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function ds(n,e,t){return!(n!=null&&(n<0||n>=25)||e!=null&&(e<0||e>=60)||t!=null&&(t<0||t>=60))}var us={exports:{}},ps={exports:{}};(function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=t;function t(r,i){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o]);return r}n.exports=e.default})(ps,ps.exports);var dv=ps.exports;(function(n,e){var t=Y0.default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var r=t(dv);function i(o){return(0,r.default)({},o)}n.exports=e.default})(us,us.exports);var uv=us.exports;const pv=Za(uv);function fv(n,e,t){var r=cs(n,t),i=as(e,r,!0),o=new Date(r.getTime()-i),a=new Date(0);return a.setFullYear(o.getUTCFullYear(),o.getUTCMonth(),o.getUTCDate()),a.setHours(o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds()),a}function hv(n,e,t){if(typeof n=="string"&&!n.match(pd)){var r=pv(t);return r.timeZone=e,cs(n,r)}var i=cs(n,t),o=rs(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()).getTime(),a=as(e,new Date(o));return new Date(o+a)}function vd(n){return e=>new Intl.DateTimeFormat(n,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${e}T00:00:00+00:00`)).slice(0,2)}function mv(n){return e=>$n(new Date(`2017-01-0${e}T00:00:00+00:00`),"EEEEEE",{locale:n})}const gv=(n,e,t)=>{const r=[1,2,3,4,5,6,7];let i;if(n!==null)try{i=r.map(mv(n))}catch{i=r.map(vd(e))}else i=r.map(vd(e));const o=i.slice(0,t),a=i.slice(t+1,i.length);return[i[t]].concat(...a).concat(...o)},fs=(n,e)=>{const t=[];for(let r=+n[0];r<=+n[1];r++)t.push({value:+r,text:`${r}`});return e?t.reverse():t},bd=(n,e,t)=>{const r=[1,2,3,4,5,6,7,8,9,10,11,12].map(o=>{const a=o<10?`0${o}`:o;return new Date(`2017-${a}-01T00:00:00+00:00`)});if(n!==null)try{const o=t==="long"?"MMMM":"MMM";return r.map((a,s)=>{const c=$n(a,o,{locale:n});return{text:c.charAt(0).toUpperCase()+c.substring(1),value:s}})}catch{}const i=new Intl.DateTimeFormat(e,{month:t,timeZone:"UTC"});return r.map((o,a)=>{const s=i.format(o);return{text:s.charAt(0).toUpperCase()+s.substring(1),value:a}})},yv=n=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][n],Je=n=>{const e=l.unref(n);return e!=null&&e.$el?e==null?void 0:e.$el:e},vv=n=>Object.assign({type:"dot"},n),wd=n=>Array.isArray(n)?!!n[0]&&!!n[1]:!1,Do={prop:n=>`"${n}" prop must be enabled!`,dateArr:n=>`You need to use array as "model-value" binding in order to support "${n}"`},Ze=n=>n,kd=n=>n===0?n:!n||isNaN(+n)?null:+n,xd=n=>n===null,bv=n=>{if(n)return[...n.querySelectorAll("input, button, select, textarea, a[href]")][0]},wv=n=>{const e=[],t=r=>r.filter(i=>i);for(let r=0;r<n.length;r+=3){const i=[n[r],n[r+1],n[r+2]];e.push(t(i))}return e},Bi=(n,e,t)=>{const r=t!=null,i=e!=null;if(!r&&!i)return!1;const o=+t,a=+e;return r&&i?+n>o||+n<a:r?+n>o:i?+n<a:!1},Wr=(n,e)=>wv(n).map(t=>t.map(r=>{const{active:i,disabled:o,isBetween:a,highlighted:s}=e(r);return{...r,active:i,disabled:o,className:{dp__overlay_cell_active:i,dp__overlay_cell:!i,dp__overlay_cell_disabled:o,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:o&&i,dp__cell_in_between:a,"dp--highlighted":s}}})),Fn=(n,e,t=!1)=>{n&&e.allowStopPropagation&&(t&&n.stopImmediatePropagation(),n.stopPropagation())},kv=()=>["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", ");function xv(n,e){let t=[...document.querySelectorAll(kv())];t=t.filter(i=>!n.contains(i)||i.hasAttribute("data-datepicker-instance"));const r=t.indexOf(n);if(r>=0&&(e?r-1>=0:r+1<=t.length))return t[r+(e?-1:1)]}const Cv=(n,e)=>{let t;return function(...r){clearTimeout(t),t=setTimeout(()=>{n(...r)},e)}},Cd=(n,e,t,r,i)=>{const o=ja(n,e.slice(0,n.length),new Date);return Si(o)&&Ec(o)?r||i?o:Ie(o,{hours:+t.hours,minutes:+(t==null?void 0:t.minutes),seconds:+(t==null?void 0:t.seconds),milliseconds:0}):null},Tv=(n,e,t,r,i)=>{const o=Array.isArray(t)?t[0]:t;if(typeof e=="string")return Cd(n,e,o,r,i);if(Array.isArray(e)){let a=null;for(const s of e)if(a=Cd(n,s,o,r,i),a)break;return a}return typeof e=="function"?e(n):null},G=n=>n?new Date(n):new Date,Mv=(n,e,t)=>{if(e){const i=(n.getMonth()+1).toString().padStart(2,"0"),o=n.getDate().toString().padStart(2,"0"),a=n.getHours().toString().padStart(2,"0"),s=n.getMinutes().toString().padStart(2,"0"),c=t?n.getSeconds().toString().padStart(2,"0"):"00";return`${n.getFullYear()}-${i}-${o}T${a}:${s}:${c}.000Z`}const r=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds());return new Date(r).toISOString()},dt=n=>{let e=G(JSON.parse(JSON.stringify(n)));return e=rd(e,0),e=id(e,0),e=qa(e,0),e=Wa(e,0),e},zn=(n,e,t,r)=>{let i=n?G(n):G();return(e||e===0)&&(i=rd(i,+e)),(t||t===0)&&(i=id(i,+t)),(r||r===0)&&(i=qa(i,+r)),Wa(i,0)},ot=(n,e)=>!n||!e?!1:Oi(dt(n),dt(e)),Ne=(n,e)=>!n||!e?!1:Yr(dt(n),dt(e)),ut=(n,e)=>!n||!e?!1:Ni(dt(n),dt(e)),Ao=(n,e,t)=>n!=null&&n[0]&&n!=null&&n[1]?ut(t,n[0])&&ot(t,n[1]):n!=null&&n[0]&&e?ut(t,n[0])&&ot(t,e)||ot(t,n[0])&&ut(t,e):!1,Jt=n=>{const e=Ie(new Date(n),{date:1});return dt(e)},hs=(n,e,t)=>e&&(t||t===0)?Object.fromEntries(["hours","minutes","seconds"].map(r=>r===e?[r,t]:[r,isNaN(+n[r])?void 0:+n[r]])):{hours:isNaN(+n.hours)?void 0:+n.hours,minutes:isNaN(+n.minutes)?void 0:+n.minutes,seconds:isNaN(+n.seconds)?void 0:+n.seconds},gr=n=>({hours:Gt(n),minutes:dn(n),seconds:Hr(n)}),Td=(n,e)=>{if(e){const t=we(G(e));if(t>n)return 12;if(t===n)return Se(G(e))}},Md=(n,e)=>{if(e){const t=we(G(e));return t<n?-1:t===n?Se(G(e)):void 0}},qr=n=>{if(n)return we(G(n))},Qt=(n,e)=>e?fv(n,e):n,Sd=(n,e)=>e?hv(n,e):n,Sv=n=>n instanceof Date?n:S0(n),Dd=(n,e)=>{const t=ut(n,e)?e:n,r=ut(e,n)?e:n;return Oc({start:t,end:r})},Dv=n=>{const e=Kt(n,1);return{month:Se(e),year:we(e)}},Eo=(n,e,t)=>{const r=fr(Qt(n,e),{weekStartsOn:+t}),i=wg(Qt(n,e),{weekStartsOn:+t});return[r,i]},Ad=(n,e)=>{const t={hours:Gt(G()),minutes:dn(G()),seconds:e?Hr(G()):0};return Object.assign(t,n)},Hn=(n,e,t)=>[Ie(G(n),{date:1}),Ie(G(),{month:e,year:t,date:1})],An=(n,e,t)=>{let r=n?G(n):G();return(e||e===0)&&(r=nd(r,e)),t&&(r=fn(r,t)),r},Ed=(n,e,t,r,i)=>{if(!r||i&&!e||!i&&!t)return!1;const o=i?Kt(n,1):jr(n,1),a=[Se(o),we(o)];return i?!Ev(...a,e):!Av(...a,t)},Av=(n,e,t)=>ot(...Hn(t,n,e))||Ne(...Hn(t,n,e)),Ev=(n,e,t)=>ut(...Hn(t,n,e))||Ne(...Hn(t,n,e)),Nd=(n,e,t,r,i,o,a)=>{if(typeof e=="function"&&!a)return e(n);const s=t?{locale:t}:void 0;return Array.isArray(n)?`${$n(n[0],o,s)}${i&&!n[1]?"":r}${n[1]?$n(n[1],o,s):""}`:$n(n,o,s)},Kr=n=>{if(n)return null;throw new Error(Do.prop("partial-range"))},No=(n,e)=>{if(e)return n();throw new Error(Do.prop("range"))},ms=n=>Array.isArray(n)?Si(n[0])&&(n[1]?Si(n[1]):!0):n?Si(n):!1,Nv=(n,e)=>Ie(e??G(),{hours:+n.hours||0,minutes:+n.minutes||0,seconds:+n.seconds||0}),gs=(n,e,t,r)=>{if(!n)return!0;if(r){const i=t==="max"?Oi(n,e):Ni(n,e),o={seconds:0,milliseconds:0};return i||Yr(Ie(n,o),Ie(e,o))}return t==="max"?n.getTime()<=e.getTime():n.getTime()>=e.getTime()},ys=(n,e,t)=>n?Nv(n,e):G(t??e),Od=(n,e,t,r,i)=>{if(Array.isArray(r)){const a=ys(n,r[0],e),s=ys(n,r[1],e);return gs(r[0],a,t,!!e)&&gs(r[1],s,t,!!e)&&i}const o=ys(n,r,e);return gs(r,o,t,!!e)&&i},vs=n=>Ie(G(),gr(n)),Ov=(n,e)=>Array.isArray(n)?n.map(t=>G(t)).filter(t=>we(G(t))===e).map(t=>Se(t)):[],_d=(n,e,t)=>typeof n=="function"?n({month:e,year:t}):!!n.months.find(r=>r.month===e&&r.year===t),bs=(n,e)=>typeof n=="function"?n(e):n.years.includes(e),Pi=l.reactive({menuFocused:!1,shiftKeyInMenu:!1}),Bd=()=>{const n=t=>{Pi.menuFocused=t},e=t=>{Pi.shiftKeyInMenu!==t&&(Pi.shiftKeyInMenu=t)};return{control:l.computed(()=>({shiftKeyInMenu:Pi.shiftKeyInMenu,menuFocused:Pi.menuFocused})),setMenuFocused:n,setShiftKey:e}},Re=l.reactive({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),ws=l.ref(null),Oo=l.ref(!1),ks=l.ref(!1),xs=l.ref(!1),Cs=l.ref(!1),vt=l.ref(0),at=l.ref(0),Yn=()=>{const n=l.computed(()=>Oo.value?[...Re.selectionGrid,Re.actionRow].filter(p=>p.length):ks.value?[...Re.timePicker[0],...Re.timePicker[1],Cs.value?[]:[ws.value],Re.actionRow].filter(p=>p.length):xs.value?[...Re.monthPicker,Re.actionRow]:[Re.monthYear,...Re.calendar,Re.time,Re.actionRow].filter(p=>p.length)),e=p=>{vt.value=p?vt.value+1:vt.value-1;let f=null;n.value[at.value]&&(f=n.value[at.value][vt.value]),f||(vt.value=p?vt.value-1:vt.value+1)},t=p=>{at.value===0&&!p||at.value===n.value.length&&p||(at.value=p?at.value+1:at.value-1,n.value[at.value]?n.value[at.value]&&!n.value[at.value][vt.value]&&vt.value!==0&&(vt.value=n.value[at.value].length-1):at.value=p?at.value-1:at.value+1)},r=p=>{let f=null;n.value[at.value]&&(f=n.value[at.value][vt.value]),f?f.focus({preventScroll:!Oo.value}):vt.value=p?vt.value-1:vt.value+1},i=()=>{e(!0),r(!0)},o=()=>{e(!1),r(!1)},a=()=>{t(!1),r(!0)},s=()=>{t(!0),r(!0)},c=(p,f)=>{Re[f]=p},d=(p,f)=>{Re[f]=p},u=()=>{vt.value=0,at.value=0};return{buildMatrix:c,buildMultiLevelMatrix:d,setTimePickerBackRef:p=>{ws.value=p},setSelectionGrid:p=>{Oo.value=p,u(),p||(Re.selectionGrid=[])},setTimePicker:(p,f=!1)=>{ks.value=p,Cs.value=f,u(),p||(Re.timePicker[0]=[],Re.timePicker[1]=[])},setTimePickerElements:(p,f=0)=>{Re.timePicker[f]=p},arrowRight:i,arrowLeft:o,arrowUp:a,arrowDown:s,clearArrowNav:()=>{Re.monthYear=[],Re.calendar=[],Re.time=[],Re.actionRow=[],Re.selectionGrid=[],Re.timePicker[0]=[],Re.timePicker[1]=[],Oo.value=!1,ks.value=!1,Cs.value=!1,xs.value=!1,u(),ws.value=null},setMonthPicker:p=>{xs.value=p,u()},refSets:Re}},Pd=n=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...n??{}}),_v=n=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",calendarWrap:"Calendar wrapper",calendarDays:"Calendar days",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:e=>`Increment ${e}`,decrementValue:e=>`Decrement ${e}`,openTpOverlay:e=>`Open ${e} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:()=>"",...n??{}}),Id=n=>n?typeof n=="boolean"?n?2:0:+n>=2?+n:2:0,Bv=n=>{const e=typeof n=="object"&&n,t={static:!0,solo:!1};if(!n)return{...t,count:Id(!1)};const r=e?n:{},i=e?r.count??!0:n,o=Id(i);return Object.assign(t,r,{count:o})},Pv=(n,e,t)=>n||(typeof t=="string"?t:e),Iv=n=>typeof n=="boolean"?n?Pd({}):!1:Pd(n),Rv=n=>{const e={enterSubmit:!0,tabSubmit:!0,openMenu:!0,selectOnFocus:!1,rangeSeparator:" - "};return typeof n=="object"?{...e,...n??{},enabled:!0}:{...e,enabled:n}},Vv=n=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...n??{}}),Lv=n=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...n??{}}),$v=n=>{const e={input:!1};return typeof n=="object"?{...e,...n??{},enabled:!0}:{enabled:n,...e}},Fv=n=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,...n??{}}),zv=(n,e,t)=>{const r={dates:Array.isArray(n)?n.map(i=>G(i)):[],years:[],months:[],quarters:[],weeks:[],weekdays:e,options:{highlightDisabled:t}};return typeof n=="function"?n:{...r,...n??{}}},Hv=n=>typeof n=="object"?{type:n.type,hideOnOffsetDates:n.hideOnOffsetDates??!1}:{type:n,hideOnOffsetDates:!1},We=n=>{const e=()=>{const x=n.enableSeconds?":ss":"";return n.is24?`HH:mm${x}`:`hh:mm${x} aa`},t=()=>n.format?n.format:n.monthPicker?"MM/yyyy":n.timePicker?e():n.weekPicker?"MM/dd/yyyy":n.yearPicker?"yyyy":n.quarterPicker?"QQQ/yyyy":n.enableTimePicker?`MM/dd/yyyy, ${e()}`:"MM/dd/yyyy",r=x=>Ad(x,n.enableSeconds),i=()=>n.range?n.startTime&&Array.isArray(n.startTime)?[r(n.startTime[0]),r(n.startTime[1])]:null:n.startTime&&!Array.isArray(n.startTime)?r(n.startTime):null,o=l.computed(()=>Bv(n.multiCalendars)),a=l.computed(()=>i()),s=l.computed(()=>_v(n.ariaLabels)),c=l.computed(()=>Vv(n.filters)),d=l.computed(()=>Iv(n.transitions)),u=l.computed(()=>Lv(n.actionRow)),p=l.computed(()=>Pv(n.previewFormat,n.format,t())),f=l.computed(()=>Rv(n.textInput)),h=l.computed(()=>$v(n.inline)),m=l.computed(()=>Fv(n.config)),y=l.computed(()=>zv(n.highlight,n.highlightWeekDays,n.highlightDisabledDays)),w=l.computed(()=>Hv(n.weekNumbers));return{defaultedTransitions:d,defaultedMultiCalendars:o,defaultedStartTime:a,defaultedAriaLabels:s,defaultedFilters:c,defaultedActionRow:u,defaultedPreviewFormat:p,defaultedTextInput:f,defaultedInline:h,defaultedConfig:m,defaultedHighlight:y,defaultedWeekNumbers:w,getDefaultPattern:t,getDefaultStartTime:i}},Yv=(n,e,t)=>{const r=l.ref(),{defaultedTextInput:i,getDefaultPattern:o}=We(e),a=l.ref(""),s=l.toRef(e,"format");l.watch(r,()=>{n("internal-model-change",r.value)}),l.watch(s,()=>{L()});const c=g=>Sd(g,e.timezone),d=g=>Qt(g,e.timezone),u=(g,M,A=!1)=>Nd(g,e.format,e.formatLocale,i.value.rangeSeparator,e.modelAuto,M??o(),A),p=g=>g?e.modelType?R(g):{hours:Gt(g),minutes:dn(g),seconds:e.enableSeconds?Hr(g):0}:null,f=g=>e.modelType?R(g):{month:Se(g),year:we(g)},h=g=>Array.isArray(g)?e.multiDates?g.map(M=>m(M,fn(G(),M))):No(()=>[fn(G(),g[0]),g[1]?fn(G(),g[1]):Kr(e.partialRange)],e.range):fn(G(),+g),m=(g,M)=>(typeof g=="string"||typeof g=="number")&&e.modelType?S(g):M,y=g=>Array.isArray(g)?[m(g[0],zn(null,+g[0].hours,+g[0].minutes,g[0].seconds)),m(g[1],zn(null,+g[1].hours,+g[1].minutes,g[1].seconds))]:m(g,zn(null,g.hours,g.minutes,g.seconds)),w=g=>Array.isArray(g)?e.multiDates?g.map(M=>m(M,An(null,+M.month,+M.year))):No(()=>[m(g[0],An(null,+g[0].month,+g[0].year)),m(g[1],g[1]?An(null,+g[1].month,+g[1].year):Kr(e.partialRange))],e.range):m(g,An(null,+g.month,+g.year)),x=g=>{if(Array.isArray(g))return g.map(M=>S(M));throw new Error(Do.dateArr("multi-dates"))},C=g=>{if(Array.isArray(g))return[G(g[0]),G(g[1])];throw new Error(Do.dateArr("week-picker"))},N=g=>e.modelAuto?Array.isArray(g)?[S(g[0]),S(g[1])]:e.autoApply?[S(g)]:[S(g),null]:Array.isArray(g)?No(()=>[S(g[0]),g[1]?S(g[1]):Kr(e.partialRange)],e.range):S(g),v=()=>{Array.isArray(r.value)&&e.range&&r.value.length===1&&r.value.push(Kr(e.partialRange))},O=()=>{const g=r.value;return[R(g[0]),g[1]?R(g[1]):Kr(e.partialRange)]},k=()=>r.value[1]?O():R(Ze(r.value[0])),E=()=>(r.value||[]).map(g=>R(g)),W=()=>(v(),e.modelAuto?k():e.multiDates?E():Array.isArray(r.value)?No(()=>O(),e.range):R(Ze(r.value))),P=g=>!g||Array.isArray(g)&&!g.length?null:e.timePicker?y(Ze(g)):e.monthPicker?w(Ze(g)):e.yearPicker?h(Ze(g)):e.multiDates?x(Ze(g)):e.weekPicker?C(Ze(g)):N(Ze(g)),T=g=>{const M=P(g);ms(Ze(M))?(r.value=Ze(M),L()):(r.value=null,a.value="")},_=()=>{const g=M=>$n(M,i.value.format);return`${g(r.value[0])} ${i.value.rangeSeparator} ${r.value[1]?g(r.value[1]):""}`},z=()=>t.value&&r.value?Array.isArray(r.value)?_():$n(r.value,i.value.format):u(r.value),q=()=>r.value?e.multiDates?r.value.map(g=>u(g)).join("; "):i.value.enabled&&typeof i.value.format=="string"?z():u(r.value):"",L=()=>{!e.format||typeof e.format=="string"||i.value.enabled&&typeof i.value.format=="string"?a.value=q():a.value=e.format(r.value)},S=g=>{if(e.utc){const M=new Date(g);return e.utc==="preserve"?new Date(M.getTime()+M.getTimezoneOffset()*6e4):M}return e.modelType?e.modelType==="date"||e.modelType==="timestamp"?d(new Date(g)):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?ja(g,o(),new Date):d(ja(g,e.modelType,new Date)):d(new Date(g))},R=g=>g?e.utc?Mv(g,e.utc==="preserve",e.enableSeconds):e.modelType?e.modelType==="timestamp"?+c(g):e.modelType==="format"&&(typeof e.format=="string"||!e.format)?u(c(g)):u(c(g),e.modelType,!0):c(g):"",V=(g,M=!1)=>{if(n("update:model-value",g),e.emitTimezone&&M){const A=Array.isArray(g)?g.map($=>Qt(Ze($)),e.emitTimezone):Qt(Ze(g),e.emitTimezone);n("update:model-timezone-value",A)}},j=g=>Array.isArray(r.value)?e.multiDates?r.value.map(M=>g(M)):[g(r.value[0]),r.value[1]?g(r.value[1]):Kr(e.partialRange)]:g(Ze(r.value)),b=g=>V(Ze(j(g)));return{inputValue:a,internalModelValue:r,checkBeforeEmit:()=>r.value?e.range?e.partialRange?r.value.length>=1:r.value.length===2:!!r.value:!1,parseExternalModelValue:T,formatInputValue:L,emitModelValue:()=>(L(),e.monthPicker?b(f):e.timePicker?b(p):e.yearPicker?b(we):e.weekPicker?V(r.value.map(g=>R(g)),!0):V(W(),!0))}},jv=(n,e)=>{const{defaultedFilters:t}=We(n),{validateMonthYearInRange:r}=br(n),i=(d,u)=>{let p=d;return t.value.months.includes(Se(p))?(p=u?Kt(d,1):jr(d,1),i(p,u)):p},o=(d,u)=>{let p=d;return t.value.years.includes(we(p))?(p=u?Ia(d,1):od(d,1),o(p,u)):p},a=(d,u=!1)=>{const p=Ie(new Date,{month:n.month,year:n.year});let f=d?Kt(p,1):jr(p,1);n.disableYearSelect&&(f=fn(f,n.year));let h=Se(f),m=we(f);t.value.months.includes(h)&&(f=i(f,d),h=Se(f),m=we(f)),t.value.years.includes(m)&&(f=o(f,d),m=we(f)),r(h,m,d,n.preventMinMaxNavigation)&&s(h,m,u)},s=(d,u,p)=>{e("update-month-year",{month:d,year:u,fromNav:p})},c=l.computed(()=>d=>Ed(Ie(new Date,{month:n.month,year:n.year}),n.maxDate,n.minDate,n.preventMinMaxNavigation,d));return{handleMonthYearChange:a,isDisabled:c,updateMonthYear:s}};var Gr=(n=>(n.center="center",n.left="left",n.right="right",n))(Gr||{}),Xt=(n=>(n.month="month",n.year="year",n))(Xt||{}),yr=(n=>(n.top="top",n.bottom="bottom",n))(yr||{}),vr=(n=>(n.header="header",n.calendar="calendar",n.timePicker="timePicker",n))(vr||{}),hn=(n=>(n.month="month",n.year="year",n.calendar="calendar",n.time="time",n.minutes="minutes",n.hours="hours",n.seconds="seconds",n))(hn||{});const Uv=({menuRef:n,menuRefInner:e,inputRef:t,pickerWrapperRef:r,inline:i,emit:o,props:a,slots:s})=>{const c=l.ref({}),d=l.ref(!1),u=l.ref({top:"0",left:"0"}),p=l.ref(!1),f=l.toRef(a,"teleportCenter");l.watch(f,()=>{u.value=JSON.parse(JSON.stringify({})),v()});const h=S=>{if(a.teleport){const R=S.getBoundingClientRect();return{left:R.left+window.scrollX,top:R.top+window.scrollY}}return{top:0,left:0}},m=(S,R)=>{u.value.left=`${S+R-c.value.width}px`},y=S=>{u.value.left=`${S}px`},w=(S,R)=>{a.position===Gr.left&&y(S),a.position===Gr.right&&m(S,R),a.position===Gr.center&&(u.value.left=`${S+R/2-c.value.width/2}px`)},x=S=>{const{width:R,height:V}=S.getBoundingClientRect(),{top:j,left:b}=a.altPosition?a.altPosition(S):h(S);return{top:+j,left:+b,width:R,height:V}},C=()=>{u.value.left="50%",u.value.top="50%",u.value.transform="translate(-50%, -50%)",u.value.position="fixed",delete u.value.opacity},N=()=>{const S=Je(t),{top:R,left:V,transform:j}=a.altPosition(S);u.value={top:`${R}px`,left:`${V}px`,transform:j??""}},v=(S=!0)=>{var R;if(!i.value.enabled){if(f.value)return C();if(a.altPosition!==null)return N();if(S){const V=a.teleport?(R=e.value)==null?void 0:R.$el:n.value;V&&(c.value=V.getBoundingClientRect()),o("recalculate-position")}return _()}},O=({inputEl:S,left:R,width:V})=>{window.screen.width>768&&!d.value&&w(R,V),W(S)},k=S=>{const{top:R,left:V,height:j,width:b}=x(S);u.value.top=`${j+R+ +a.offset}px`,p.value=!1,d.value||(u.value.left=`${V+b/2-c.value.width/2}px`),O({inputEl:S,left:V,width:b})},E=S=>{const{top:R,left:V,width:j}=x(S);u.value.top=`${R-+a.offset-c.value.height}px`,p.value=!0,O({inputEl:S,left:V,width:j})},W=S=>{if(a.autoPosition){const{left:R,width:V}=x(S),{left:j,right:b}=c.value;if(!d.value){if(Math.abs(j)!==Math.abs(b)){if(j<=0)return d.value=!0,y(R);if(b>=document.documentElement.clientWidth)return d.value=!0,m(R,V)}return w(R,V)}}},P=()=>{const S=Je(t);if(S){const{height:R}=c.value,{top:V,height:j}=S.getBoundingClientRect(),b=window.innerHeight-V-j,g=V;return R<=b?yr.bottom:R>b&&R<=g?yr.top:b>=g?yr.bottom:yr.top}return yr.bottom},T=S=>P()===yr.bottom?k(S):E(S),_=()=>{const S=Je(t);if(S)return a.autoPosition?T(S):k(S)},z=function(S){if(S){const R=S.scrollHeight>S.clientHeight,V=window.getComputedStyle(S).overflowY.indexOf("hidden")!==-1;return R&&!V}return!0},q=function(S){return!S||S===document.body||S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:z(S)?S:q(S.parentNode)},L=S=>{if(S)switch(a.position){case Gr.left:return{left:0,transform:"translateX(0)"};case Gr.right:return{left:`${S.width}px`,transform:"translateX(-100%)"};default:return{left:`${S.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:p,menuStyle:u,xCorrect:d,setMenuPosition:v,getScrollableParent:q,shadowRender:(S,R)=>{var V,j,b;const g=document.createElement("div"),M=(V=Je(t))==null?void 0:V.getBoundingClientRect();g.setAttribute("id","dp--temp-container");const A=(j=r.value)!=null&&j.clientWidth?r.value:document.body;A.append(g);const $=L(M),F=l.h(S,{...R,shadow:!0,style:{opacity:0,position:"absolute",...$}},Object.fromEntries(Object.keys(s).filter(B=>["right-sidebar","left-sidebar"].includes(B)).map(B=>[B,s[B]])));l.render(F,g),c.value=(b=F.el)==null?void 0:b.getBoundingClientRect(),l.render(null,g),A.removeChild(g)}}},jn=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]}],Wv=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],qv={all:()=>jn,monthYear:()=>jn.filter(n=>n.use.includes("month-year")),input:()=>Wv,timePicker:()=>jn.filter(n=>n.use.includes("time")),action:()=>jn.filter(n=>n.use.includes("action")),calendar:()=>jn.filter(n=>n.use.includes("calendar")),menu:()=>jn.filter(n=>n.use.includes("menu")),shared:()=>jn.filter(n=>n.use.includes("shared")),yearMode:()=>jn.filter(n=>n.use.includes("year-mode"))},Nt=(n,e,t)=>{const r=[];return qv[e]().forEach(i=>{n[i.name]&&r.push(i.name)}),t!=null&&t.length&&t.forEach(i=>{i.slot&&r.push(i.slot)}),r},Ii=n=>{const e=l.computed(()=>r=>n.value?r?n.value.open:n.value.close:""),t=l.computed(()=>r=>n.value?r?n.value.menuAppearTop:n.value.menuAppearBottom:"");return{transitionName:e,showTransition:!!n.value,menuTransition:t}},Ri=(n,e)=>{const t=G(Qt(new Date,n.timezone)),r=l.ref([{month:Se(t),year:we(t)}]),i=l.reactive({hours:n.range?[Gt(t),Gt(t)]:Gt(t),minutes:n.range?[dn(t),dn(t)]:dn(t),seconds:n.range?[0,0]:0}),o=l.computed({get:()=>n.internalModelValue,set:c=>{!n.readonly&&!n.disabled&&e("update:internal-model-value",c)}}),a=l.computed(()=>c=>r.value[c]?r.value[c].month:0),s=l.computed(()=>c=>r.value[c]?r.value[c].year:0);return{calendars:r,time:i,modelValue:o,month:a,year:s}},Kv=(n,e)=>{const{defaultedMultiCalendars:t,defaultedHighlight:r}=We(e),{isDisabled:i,matchDate:o}=br(e),a=l.ref(null),s=l.ref(G(Qt(new Date,e.timezone))),c=b=>{!b.current&&e.hideOffsetDates||(a.value=b.value)},d=()=>{a.value=null},u=b=>Array.isArray(n.value)&&e.range&&n.value[0]&&a.value?b?ut(a.value,n.value[0]):ot(a.value,n.value[0]):!0,p=(b,g)=>{const M=()=>n.value?g?n.value[0]||null:n.value[1]:null,A=n.value&&Array.isArray(n.value)?M():null;return Ne(G(b.value),A)},f=b=>{const g=Array.isArray(n.value)?n.value[0]:null;return b?!ot(a.value??null,g):!0},h=(b,g=!0)=>(e.range||e.weekPicker)&&Array.isArray(n.value)&&n.value.length===2?e.hideOffsetDates&&!b.current?!1:Ne(G(b.value),n.value[g?0:1]):e.range?p(b,g)&&f(g)||Ne(b.value,Array.isArray(n.value)?n.value[0]:null)&&u(g):!1,m=(b,g,M)=>Array.isArray(n.value)&&n.value[0]&&n.value.length===1?b?!1:M?ut(n.value[0],g.value):ot(n.value[0],g.value):!1,y=b=>!n.value||e.hideOffsetDates&&!b.current?!1:e.range?e.modelAuto&&Array.isArray(n.value)?Ne(b.value,n.value[0]?n.value[0]:s.value):!1:e.multiDates&&Array.isArray(n.value)?n.value.some(g=>Ne(g,b.value)):Ne(b.value,n.value?n.value:s.value),w=b=>{if(e.autoRange||e.weekPicker){if(a.value){if(e.hideOffsetDates&&!b.current)return!1;const g=Dn(a.value,+e.autoRange),M=Eo(G(a.value),e.timezone,e.weekStart);return e.weekPicker?Ne(M[1],G(b.value)):Ne(g,G(b.value))}return!1}return!1},x=b=>{if(e.autoRange||e.weekPicker){if(a.value){const g=Dn(a.value,+e.autoRange);if(e.hideOffsetDates&&!b.current)return!1;const M=Eo(G(a.value),e.timezone,e.weekStart);return e.weekPicker?ut(b.value,M[0])&&ot(b.value,M[1]):ut(b.value,a.value)&&ot(b.value,g)}return!1}return!1},C=b=>{if(e.autoRange||e.weekPicker){if(a.value){if(e.hideOffsetDates&&!b.current)return!1;const g=Eo(G(a.value),e.timezone,e.weekStart);return e.weekPicker?Ne(g[0],b.value):Ne(a.value,b.value)}return!1}return!1},N=b=>Ao(n.value,a.value,b.value),v=()=>e.modelAuto&&Array.isArray(e.internalModelValue)?!!e.internalModelValue[0]:!1,O=()=>e.modelAuto?wd(e.internalModelValue):!0,k=b=>{if(Array.isArray(n.value)&&n.value.length||e.weekPicker)return!1;const g=e.range?!h(b)&&!h(b,!1):!0;return!i(b.value)&&!y(b)&&!(!b.current&&e.hideOffsetDates)&&g},E=b=>e.range?e.modelAuto?v()&&y(b):!1:y(b),W=b=>{var g;return r.value?typeof r.value=="function"?r.value(b.value):o(b.value,(g=e.arrMapValues)!=null&&g.highlightedDates?e.arrMapValues.highlightedDates:r.value.dates):!1},P=b=>{const g=i(b.value);return g&&(typeof r.value=="function"?!r.value(b.value,g):!r.value.options.highlightDisabled)},T=b=>{var g;return typeof r.value=="function"?r.value(b.value):(g=r.value.weekdays)==null?void 0:g.includes(b.value.getDay())},_=b=>(e.range||e.weekPicker)&&(!(t.value.count>0)||b.current)&&O()&&!(!b.current&&e.hideOffsetDates)&&!y(b)?N(b):!1,z=b=>{const{isRangeStart:g,isRangeEnd:M}=S(b),A=e.range?g||M:!1;return{dp__cell_offset:!b.current,dp__pointer:!e.disabled&&!(!b.current&&e.hideOffsetDates)&&!i(b.value),dp__cell_disabled:i(b.value),dp__cell_highlight:!P(b)&&(W(b)||T(b))&&!E(b)&&!A&&!C(b)&&!(_(b)&&e.weekPicker)&&!M,dp__cell_highlight_active:!P(b)&&(W(b)||T(b))&&E(b),dp__today:!e.noToday&&Ne(b.value,s.value)&&b.current}},q=b=>({dp__active_date:E(b),dp__date_hover:k(b)}),L=b=>({...R(b),...V(b),dp__range_between_week:_(b)&&e.weekPicker}),S=b=>{const g=t.value.count>0?b.current&&h(b)&&O():h(b)&&O(),M=t.value.count>0?b.current&&h(b,!1)&&O():h(b,!1)&&O();return{isRangeStart:g,isRangeEnd:M}},R=b=>{const{isRangeStart:g,isRangeEnd:M}=S(b);return{dp__range_start:g,dp__range_end:M,dp__range_between:_(b)&&!e.weekPicker,dp__date_hover_start:m(k(b),b,!0),dp__date_hover_end:m(k(b),b,!1)}},V=b=>({...R(b),dp__cell_auto_range:x(b),dp__cell_auto_range_start:C(b),dp__cell_auto_range_end:w(b)}),j=b=>e.range?e.autoRange?V(b):e.modelAuto?{...q(b),...R(b)}:R(b):e.weekPicker?L(b):q(b);return{setHoverDate:c,clearHoverDate:d,getDayClassData:b=>e.hideOffsetDates&&!b.current?{}:{...z(b),...j(b),[e.dayClass?e.dayClass(b.value):""]:!0,[e.calendarCellClassName]:!!e.calendarCellClassName}}},br=n=>{const{defaultedFilters:e,defaultedHighlight:t}=We(n),r=()=>{if(n.timezone)return n.timezone;if(n.utc)return"UTC"},i=T=>{const _=dt(o(G(T))).toISOString(),[z]=_.split("T");return z},o=T=>n.utc==="preserve"?Sd(T,r()):Qt(T,r()),a=T=>{var _;const z=n.maxDate?ut(T,o(G(n.maxDate))):!1,q=n.minDate?ot(T,o(G(n.minDate))):!1,L=u(o(T),(_=n.arrMapValues)!=null&&_.disabledDates?n.arrMapValues.disabledDates:n.disabledDates),S=e.value.months.map(g=>+g).includes(Se(T)),R=n.disabledWeekDays.length?n.disabledWeekDays.some(g=>+g===xy(T)):!1,V=f(T),j=we(T),b=j<+n.yearRange[0]||j>+n.yearRange[1];return!(z||q||L||S||b||R||V)},s=(T,_)=>ot(...Hn(n.minDate,T,_))||Ne(...Hn(n.minDate,T,_)),c=(T,_)=>ut(...Hn(n.maxDate,T,_))||Ne(...Hn(n.maxDate,T,_)),d=(T,_,z)=>{let q=!1;return n.maxDate&&z&&c(T,_)&&(q=!0),n.minDate&&!z&&s(T,_)&&(q=!0),q},u=(T,_)=>T?_ instanceof Map?!!_.get(i(T)):Array.isArray(_)?_.some(z=>Ne(o(G(z)),T)):_?_(G(JSON.parse(JSON.stringify(T)))):!1:!0,p=(T,_,z,q)=>{let L=!1;return q?n.minDate&&n.maxDate?L=d(T,_,z):(n.minDate&&s(T,_)||n.maxDate&&c(T,_))&&(L=!0):L=!0,L},f=T=>{var _,z,q,L,S;return Array.isArray(n.allowedDates)&&!((_=n.allowedDates)!=null&&_.length)?!0:(z=n.arrMapValues)!=null&&z.allowedDates?!u(T,(q=n.arrMapValues)==null?void 0:q.allowedDates):(L=n.allowedDates)!=null&&L.length?!((S=n.allowedDates)!=null&&S.some(R=>Ne(dt(R),o(dt(T))))):!1},h=T=>!a(T),m=T=>n.noDisabledRange?!Oc({start:T[0],end:T[1]}).some(_=>h(_)):!0,y=(T,_,z=0)=>{if(Array.isArray(_)&&_[z]){const q=hg(T,_[z]),L=Dd(_[z],T),S=L.length===1?0:L.filter(V=>h(V)).length,R=Math.abs(q)-S;if(n.minRange&&n.maxRange)return R>=+n.minRange&&R<=+n.maxRange;if(n.minRange)return R>=+n.minRange;if(n.maxRange)return R<=+n.maxRange}return!0},w=T=>new Map(T.map(_=>[i(_),!0])),x=T=>Array.isArray(T)&&T.length>0,C=()=>{const T={disabledDates:null,allowedDates:null,highlightedDates:null};return x(n.allowedDates)&&(T.allowedDates=w(n.allowedDates)),typeof t.value!="function"&&x(t.value.dates)&&(T.highlightedDates=w(t.value.dates)),x(n.disabledDates)&&(T.disabledDates=w(n.disabledDates)),T},N=()=>!n.enableTimePicker||n.monthPicker||n.yearPicker||n.ignoreTimeValidation,v=T=>Array.isArray(T)?[T[0]?vs(T[0]):null,T[1]?vs(T[1]):null]:vs(T),O=(T,_,z)=>T.find(q=>+q.hours===Gt(_)&&q.minutes==="*"?!0:+q.minutes===dn(_)&&+q.hours===Gt(_))&&z,k=(T,_,z)=>{const[q,L]=T,[S,R]=_;return!O(q,S,z)&&!O(L,R,z)&&z},E=(T,_)=>{const z=Array.isArray(_)?_:[_];return Array.isArray(n.disabledTimes)?Array.isArray(n.disabledTimes[0])?k(n.disabledTimes,z,T):!z.some(q=>O(n.disabledTimes,q,T)):T},W=(T,_)=>{const z=Array.isArray(_)?[gr(_[0]),_[1]?gr(_[1]):void 0]:gr(_),q=!n.disabledTimes(z);return T&&q},P=(T,_)=>n.disabledTimes?Array.isArray(n.disabledTimes)?E(_,T):W(_,T):_;return{isDisabled:h,validateDate:a,validateMonthYearInRange:p,isDateRangeAllowed:m,checkMinMaxRange:y,matchDate:u,mapDatesArrToMap:C,isValidTime:T=>{let _=!0;if(!T||N())return!0;const z=!n.minDate&&!n.maxDate?v(T):T;return(n.maxTime||n.maxDate)&&(_=Od(n.maxTime,n.maxDate,"max",Ze(z),_)),(n.minTime||n.minDate)&&(_=Od(n.minTime,n.minDate,"min",Ze(z),_)),P(T,_)}}},_o=()=>{const n=l.computed(()=>(r,i)=>r==null?void 0:r.includes(i)),e=l.computed(()=>(r,i)=>r.count?r.solo?!0:i===0:!0),t=l.computed(()=>(r,i)=>r.count?r.solo?!0:i===r.count-1:!0);return{hideNavigationButtons:n,showLeftIcon:e,showRightIcon:t}},Gv=(n,e,t)=>{const r=l.ref(0),i=l.reactive({[vr.timePicker]:!n.enableTimePicker||n.timePicker||n.monthPicker,[vr.calendar]:!1,[vr.header]:!1}),o=l.computed(()=>n.monthPicker),a=p=>{var f;if((f=n.flow)!=null&&f.length){if(!p&&o.value)return u();i[p]=!0,Object.keys(i).filter(h=>!i[h]).length||u()}},s=()=>{var p;(p=n.flow)!=null&&p.length&&r.value!==-1&&(r.value+=1,e("flow-step",r.value),u())},c=()=>{r.value=-1},d=(p,f,...h)=>{n.flow[r.value]===p&&t.value&&t.value[f](...h)},u=()=>{d(hn.month,"toggleMonthPicker",!0),d(hn.year,"toggleYearPicker",!0),d(hn.calendar,"toggleTimePicker",!1,!0),d(hn.time,"toggleTimePicker",!0,!0);const p=n.flow[r.value];(p===hn.hours||p===hn.minutes||p===hn.seconds)&&d(p,"toggleTimePicker",!0,!0,p)};return{childMount:a,updateFlowStep:s,resetFlow:c,flowStep:r}},Bo={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:String,default:null},emitTimezone:{type:String,default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},menuClassName:{type:String,default:null},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},calendarCellClassName:{type:String,default:null},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},autoRange:{type:[Number,String],default:null},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},minRange:{type:[Number,String],default:null},maxRange:{type:[Number,String],default:null},multiDatesLimit:{type:[Number,String],default:null},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},disableTimeRangeValidation:{type:Boolean,default:!1},highlight:{type:[Array,Function,Object],default:null},highlightWeekDays:{type:Array,default:null},highlightDisabledDays:{type:Boolean,default:!1},teleport:{type:[String,Boolean,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},calendarClassName:{type:String,default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:Boolean,default:!1},partialRange:{type:Boolean,default:!0},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},inputClassName:{type:String,default:null},fixedStart:{type:Boolean,default:!1},fixedEnd:{type:Boolean,default:!1},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:Boolean,default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},noDisabledRange:{type:Boolean,default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},showLastInRange:{type:Boolean,default:!0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1}},Zt={...Bo,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},arrMapValues:{type:Object,default:()=>({})},noOverlayFocus:{type:Boolean,default:!1}},Jv={key:1,class:"dp__input_wrap"},Qv=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid"],Xv={key:2,class:"dp__clear_icon"},Zv=l.defineComponent({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},...Bo},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur"],setup(n,{expose:e,emit:t}){const r=t,i=n,{defaultedTextInput:o,defaultedAriaLabels:a,defaultedInline:s,defaultedConfig:c,getDefaultPattern:d,getDefaultStartTime:u}=We(i),{checkMinMaxRange:p}=br(i),f=l.ref(),h=l.ref(null),m=l.ref(!1),y=l.ref(!1),w=l.computed(()=>({dp__pointer:!i.disabled&&!i.readonly&&!o.value.enabled,dp__disabled:i.disabled,dp__input_readonly:!o.value.enabled,dp__input:!0,dp__input_icon_pad:!i.hideInputIcon,dp__input_valid:!!i.state,dp__input_invalid:i.state===!1,dp__input_focus:m.value||i.isMenuOpen,dp__input_reg:!o.value.enabled,[i.inputClassName]:!!i.inputClassName})),x=()=>{r("set-input-date",null),i.autoApply&&(r("set-empty-date"),f.value=null)},C=L=>{const S=u();return Tv(L,o.value.format??d(),S??Ad({},i.enableSeconds),i.inputValue,y.value)},N=L=>{const{rangeSeparator:S}=o.value,[R,V]=L.split(`${S}`);if(R){const j=C(R.trim()),b=V?C(V.trim()):null,g=j&&b?[j,b]:[j];p(b,g,0)&&(f.value=j?g:null)}},v=()=>{y.value=!0},O=L=>{if(i.range)N(L);else if(i.multiDates){const S=L.split(";");f.value=S.map(R=>C(R.trim())).filter(R=>R)}else f.value=C(L)},k=L=>{var S;const R=typeof L=="string"?L:(S=L.target)==null?void 0:S.value;R!==""?(o.value.openMenu&&!i.isMenuOpen&&r("open"),O(R),r("set-input-date",f.value)):x(),y.value=!1,r("update:input-value",R)},E=L=>{o.value.enabled?(O(L.target.value),o.value.enterSubmit&&ms(f.value)&&i.inputValue!==""?(r("set-input-date",f.value,!0),f.value=null):o.value.enterSubmit&&i.inputValue===""&&(f.value=null,r("clear"))):T(L)},W=L=>{o.value.enabled&&o.value.tabSubmit&&O(L.target.value),o.value.tabSubmit&&ms(f.value)&&i.inputValue!==""?(r("set-input-date",f.value,!0,!0),f.value=null):o.value.tabSubmit&&i.inputValue===""&&(f.value=null,r("clear",!0))},P=()=>{var L;m.value=!0,r("focus"),o.value.enabled&&o.value.selectOnFocus&&((L=h.value)==null||L.select())},T=L=>{L.preventDefault(),Fn(L,c.value,!0),o.value.enabled&&o.value.openMenu&&!s.value.input&&!i.isMenuOpen?r("open"):o.value.enabled||r("toggle")},_=()=>{r("real-blur"),m.value=!1,(!i.isMenuOpen||s.value.enabled&&s.value.input)&&r("blur"),i.autoApply&&o.value.enabled&&f.value&&!i.isMenuOpen&&(r("set-input-date",f.value),r("select-date"),f.value=null)},z=L=>{Fn(L,c.value,!0),r("clear")},q=L=>{if(!o.value.enabled){if(L.code==="Tab")return;L.preventDefault()}};return e({focusInput:()=>{var L;(L=h.value)==null||L.focus({preventScroll:!0})},setParsedDate:L=>{f.value=L}}),(L,S)=>{var R;return l.openBlock(),l.createElementBlock("div",{onClick:T},[L.$slots.trigger&&!L.$slots["dp-input"]&&!l.unref(s).enabled?l.renderSlot(L.$slots,"trigger",{key:0}):l.createCommentVNode("",!0),!L.$slots.trigger&&(!l.unref(s).enabled||l.unref(s).input)?(l.openBlock(),l.createElementBlock("div",Jv,[L.$slots["dp-input"]&&!L.$slots.trigger&&!l.unref(s).enabled?l.renderSlot(L.$slots,"dp-input",{key:0,value:n.inputValue,isMenuOpen:n.isMenuOpen,onInput:k,onEnter:E,onTab:W,onClear:z,onBlur:_,onKeypress:q,onPaste:v,openMenu:()=>L.$emit("open"),closeMenu:()=>L.$emit("close"),toggleMenu:()=>L.$emit("toggle")}):l.createCommentVNode("",!0),L.$slots["dp-input"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",{key:1,id:L.uid?`dp-input-${L.uid}`:void 0,ref_key:"inputRef",ref:h,name:L.name,class:l.normalizeClass(w.value),inputmode:l.unref(o).enabled?"text":"none",placeholder:L.placeholder,disabled:L.disabled,readonly:L.readonly,required:L.required,value:n.inputValue,autocomplete:L.autocomplete,"aria-label":(R=l.unref(a))==null?void 0:R.input,"aria-disabled":L.disabled||void 0,"aria-invalid":L.state===!1?!0:void 0,onInput:k,onKeydown:[l.withKeys(E,["enter"]),l.withKeys(W,["tab"]),q],onBlur:_,onFocus:P,onKeypress:q,onPaste:v},null,42,Qv)),l.createElementVNode("div",{onClick:S[2]||(S[2]=V=>r("toggle"))},[L.$slots["input-icon"]&&!L.hideInputIcon?(l.openBlock(),l.createElementBlock("span",{key:0,class:"dp__input_icon",onClick:S[0]||(S[0]=V=>r("toggle"))},[l.renderSlot(L.$slots,"input-icon")])):l.createCommentVNode("",!0),!L.$slots["input-icon"]&&!L.hideInputIcon&&!L.$slots["dp-input"]?(l.openBlock(),l.createBlock(l.unref(Ur),{key:1,class:"dp__input_icon dp__input_icons",onClick:S[1]||(S[1]=V=>r("toggle"))})):l.createCommentVNode("",!0)]),L.$slots["clear-icon"]&&n.inputValue&&L.clearable&&!L.disabled&&!L.readonly?(l.openBlock(),l.createElementBlock("span",Xv,[l.renderSlot(L.$slots,"clear-icon",{clear:z})])):l.createCommentVNode("",!0),L.clearable&&!L.$slots["clear-icon"]&&n.inputValue&&!L.disabled&&!L.readonly?(l.openBlock(),l.createBlock(l.unref(ad),{key:3,class:"dp__clear_icon dp__input_icons",onClick:S[3]||(S[3]=l.withModifiers(V=>z(V),["prevent"]))})):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])}}}),eb=["title"],tb={class:"dp__action_buttons"},nb=["disabled"],rb=l.defineComponent({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...Zt},emits:["close-picker","select-date","select-now","invalid-select"],setup(n,{emit:e}){const t=e,r=n,{defaultedActionRow:i,defaultedPreviewFormat:o,defaultedMultiCalendars:a,defaultedTextInput:s,defaultedInline:c,getDefaultPattern:d}=We(r),{isValidTime:u}=br(r),{buildMatrix:p}=Yn(),f=l.ref(null),h=l.ref(null);l.onMounted(()=>{r.arrowNavigation&&p([Je(f),Je(h)],"actionRow")});const m=l.computed(()=>r.range&&!r.partialRange&&r.internalModelValue?r.internalModelValue.length===2:!0),y=l.computed(()=>!w.value||!x.value||!m.value),w=l.computed(()=>!r.enableTimePicker||r.ignoreTimeValidation?!0:u(r.internalModelValue)),x=l.computed(()=>r.monthPicker?r.range&&Array.isArray(r.internalModelValue)?!r.internalModelValue.filter(T=>!W(T)).length:W(r.internalModelValue):!0),C=()=>{const T=o.value;return r.timePicker||r.monthPicker,T(Ze(r.internalModelValue))},N=()=>{const T=r.internalModelValue;return a.value.count>0?`${v(T[0])} - ${v(T[1])}`:[v(T[0]),v(T[1])]},v=T=>Nd(T,o.value,r.formatLocale,s.value.rangeSeparator,r.modelAuto,d()),O=l.computed(()=>!r.internalModelValue||!r.menuMount?"":typeof o.value=="string"?Array.isArray(r.internalModelValue)?r.internalModelValue.length===2&&r.internalModelValue[1]?N():r.multiDates?r.internalModelValue.map(T=>`${v(T)}`):r.modelAuto?`${v(r.internalModelValue[0])}`:`${v(r.internalModelValue[0])} -`:v(r.internalModelValue):C()),k=()=>r.multiDates?"; ":" - ",E=l.computed(()=>Array.isArray(O.value)?O.value.join(k()):O.value),W=T=>{if(!r.monthPicker)return!0;let _=!0;const z=G(Jt(T));if(r.minDate&&r.maxDate){const q=G(Jt(r.minDate)),L=G(Jt(r.maxDate));return ut(z,q)&&ot(z,L)||Ne(z,q)||Ne(z,L)}if(r.minDate){const q=G(Jt(r.minDate));_=ut(z,q)||Ne(z,q)}if(r.maxDate){const q=G(Jt(r.maxDate));_=ot(z,q)||Ne(z,q)}return _},P=()=>{w.value&&x.value&&m.value?t("select-date"):t("invalid-select")};return(T,_)=>(l.openBlock(),l.createElementBlock("div",{class:"dp__action_row",style:l.normalizeStyle(n.calendarWidth?{width:`${n.calendarWidth}px`}:{})},[T.$slots["action-row"]?l.renderSlot(T.$slots,"action-row",l.normalizeProps(l.mergeProps({key:0},{internalModelValue:T.internalModelValue,disabled:y.value,selectDate:()=>T.$emit("select-date"),closePicker:()=>T.$emit("close-picker")}))):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.unref(i).showPreview?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__selection_preview",title:E.value},[T.$slots["action-preview"]?l.renderSlot(T.$slots,"action-preview",{key:0,value:T.internalModelValue}):l.createCommentVNode("",!0),T.$slots["action-preview"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(E.value),1)],64))],8,eb)):l.createCommentVNode("",!0),l.createElementVNode("div",tb,[T.$slots["action-buttons"]?l.renderSlot(T.$slots,"action-buttons",{key:0,value:T.internalModelValue}):l.createCommentVNode("",!0),T.$slots["action-buttons"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[!l.unref(c).enabled&&l.unref(i).showCancel?(l.openBlock(),l.createElementBlock("button",{key:0,ref_key:"cancelButtonRef",ref:f,type:"button",class:"dp__action_button dp__action_cancel",onClick:_[0]||(_[0]=z=>T.$emit("close-picker")),onKeydown:[_[1]||(_[1]=l.withKeys(z=>T.$emit("close-picker"),["enter"])),_[2]||(_[2]=l.withKeys(z=>T.$emit("close-picker"),["space"]))]},l.toDisplayString(T.cancelText),545)):l.createCommentVNode("",!0),l.unref(i).showNow?(l.openBlock(),l.createElementBlock("button",{key:1,ref_key:"cancelButtonRef",ref:f,type:"button",class:"dp__action_button dp__action_cancel",onClick:_[3]||(_[3]=z=>T.$emit("select-now")),onKeydown:[_[4]||(_[4]=l.withKeys(z=>T.$emit("select-now"),["enter"])),_[5]||(_[5]=l.withKeys(z=>T.$emit("select-now"),["space"]))]},l.toDisplayString(T.nowButtonLabel),545)):l.createCommentVNode("",!0),l.unref(i).showSelect?(l.openBlock(),l.createElementBlock("button",{key:2,ref_key:"selectButtonRef",ref:h,type:"button",class:"dp__action_button dp__action_select",disabled:y.value,onKeydown:[l.withKeys(P,["enter"]),l.withKeys(P,["space"])],onClick:P},l.toDisplayString(T.selectText),41,nb)):l.createCommentVNode("",!0)],64))])],64))],4))}}),ib=["onKeydown"],ob={class:"dp__selection_grid_header"},ab=["aria-selected","aria-disabled","onClick","onKeydown","onMouseover"],sb=["aria-label"],Vi=l.defineComponent({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(n,{expose:e,emit:t}){const{setSelectionGrid:r,buildMultiLevelMatrix:i,setMonthPicker:o}=Yn(),a=t,s=n,{defaultedAriaLabels:c,defaultedTextInput:d,defaultedConfig:u}=We(s),{hideNavigationButtons:p}=_o(),f=l.ref(!1),h=l.ref(null),m=l.ref(null),y=l.ref([]),w=l.ref(),x=l.ref(null),C=l.ref(0),N=l.ref(null);l.onBeforeUpdate(()=>{h.value=null}),l.onMounted(()=>{l.nextTick().then(()=>_()),s.noOverlayFocus||O(),v(!0)}),l.onUnmounted(()=>v(!1));const v=b=>{var g;s.arrowNavigation&&((g=s.headerRefs)!=null&&g.length?o(b):r(b))},O=()=>{var b;const g=Je(m);g&&(d.value.enabled||(h.value?(b=h.value)==null||b.focus({preventScroll:!0}):g.focus({preventScroll:!0})),f.value=g.clientHeight<g.scrollHeight)},k=l.computed(()=>({dp__overlay:!0,"dp--overlay-absolute":!s.useRelative,"dp--overlay-relative":s.useRelative})),E=l.computed(()=>s.useRelative?{height:`${s.height}px`,width:"260px"}:void 0),W=l.computed(()=>({dp__overlay_col:!0})),P=l.computed(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:f.value,dp__button_bottom:s.isLast})),T=l.computed(()=>{var b,g;return{dp__overlay_container:!0,dp__container_flex:((b=s.items)==null?void 0:b.length)<=6,dp__container_block:((g=s.items)==null?void 0:g.length)>6}});l.watch(()=>s.items,()=>_(),{deep:!0});const _=()=>{l.nextTick().then(()=>{const b=Je(h),g=Je(m),M=Je(x),A=Je(N),$=M?M.getBoundingClientRect().height:0;g&&(g.getBoundingClientRect().height?C.value=g.getBoundingClientRect().height-$:C.value=u.value.modeHeight-$),b&&A&&(A.scrollTop=b.offsetTop-A.offsetTop-(C.value/2-b.getBoundingClientRect().height)-$)})},z=b=>{b.disabled||a("selected",b.value)},q=()=>{a("toggle"),a("reset-flow")},L=()=>{s.escClose&&q()},S=(b,g,M,A)=>{b&&((g.active||g.value===s.focusValue)&&(h.value=b),s.arrowNavigation&&(Array.isArray(y.value[M])?y.value[M][A]=b:y.value[M]=[b],R()))},R=()=>{var b,g;const M=(b=s.headerRefs)!=null&&b.length?[s.headerRefs].concat(y.value):y.value.concat([s.skipButtonRef?[]:[x.value]]);i(Ze(M),(g=s.headerRefs)!=null&&g.length?"monthPicker":"selectionGrid")},V=b=>{s.arrowNavigation||Fn(b,u.value,!0)},j=b=>{w.value=b,a("hover-value",b)};return e({focusGrid:O}),(b,g)=>{var M;return l.openBlock(),l.createElementBlock("div",{ref_key:"gridWrapRef",ref:m,class:l.normalizeClass(k.value),style:l.normalizeStyle(E.value),role:"dialog",tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(L,["prevent"]),["esc"]),g[0]||(g[0]=l.withKeys(l.withModifiers(A=>V(A),["prevent"]),["left"])),g[1]||(g[1]=l.withKeys(l.withModifiers(A=>V(A),["prevent"]),["up"])),g[2]||(g[2]=l.withKeys(l.withModifiers(A=>V(A),["prevent"]),["down"])),g[3]||(g[3]=l.withKeys(l.withModifiers(A=>V(A),["prevent"]),["right"]))]},[l.createElementVNode("div",{ref_key:"containerRef",ref:N,class:l.normalizeClass(T.value),role:"grid",style:l.normalizeStyle({height:`${C.value}px`})},[l.createElementVNode("div",ob,[l.renderSlot(b.$slots,"header")]),b.$slots.overlay?l.renderSlot(b.$slots,"overlay",{key:0}):(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:1},l.renderList(b.items,(A,$)=>(l.openBlock(),l.createElementBlock("div",{key:$,class:l.normalizeClass(["dp__overlay_row",{dp__flex_row:b.items.length>=3}]),role:"row"},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(A,(F,B)=>(l.openBlock(),l.createElementBlock("div",{key:F.value,ref_for:!0,ref:D=>S(D,F,$,B),role:"gridcell",class:l.normalizeClass(W.value),"aria-selected":F.active,"aria-disabled":F.disabled||void 0,tabindex:"0",onClick:D=>z(F),onKeydown:[l.withKeys(l.withModifiers(D=>z(F),["prevent"]),["enter"]),l.withKeys(l.withModifiers(D=>z(F),["prevent"]),["space"])],onMouseover:D=>j(F.value)},[l.createElementVNode("div",{class:l.normalizeClass(F.className)},[b.$slots.item?l.renderSlot(b.$slots,"item",{key:0,item:F}):l.createCommentVNode("",!0),b.$slots.item?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(F.text),1)],64))],2)],42,ab))),128))],2))),128))],6),b.$slots["button-icon"]?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:0,ref_key:"toggleButton",ref:x,type:"button","aria-label":(M=l.unref(c))==null?void 0:M.toggleOverlay,class:l.normalizeClass(P.value),tabindex:"0",onClick:q,onKeydown:[l.withKeys(q,["enter"]),l.withKeys(q,["tab"])]},[l.renderSlot(b.$slots,"button-icon")],42,sb)),[[l.vShow,!l.unref(p)(b.hideNavigation,b.type)]]):l.createCommentVNode("",!0)],46,ib)}}}),Po=l.defineComponent({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean}},setup(n){const e=n,t=l.computed(()=>e.multiCalendars>0?[...Array(e.multiCalendars).keys()]:[0]),r=l.computed(()=>({dp__instance_calendar:e.multiCalendars>0}));return(i,o)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass({dp__menu_inner:!i.stretch,"dp--menu--inner-stretched":i.stretch,dp__flex_display:i.multiCalendars>0})},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.value,(a,s)=>(l.openBlock(),l.createElementBlock("div",{key:a,class:l.normalizeClass(r.value)},[l.renderSlot(i.$slots,"default",{instance:a,index:s})],2))),128))],2))}}),lb=["aria-label","aria-disabled"],Li=l.defineComponent({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(n,{emit:e}){const t=e,r=l.ref(null);return l.onMounted(()=>t("set-ref",r)),(i,o)=>(l.openBlock(),l.createElementBlock("button",{ref_key:"elRef",ref:r,type:"button",class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":i.ariaLabel,"aria-disabled":i.disabled||void 0,onClick:o[0]||(o[0]=a=>i.$emit("activate")),onKeydown:[o[1]||(o[1]=l.withKeys(l.withModifiers(a=>i.$emit("activate"),["prevent"]),["enter"])),o[2]||(o[2]=l.withKeys(l.withModifiers(a=>i.$emit("activate"),["prevent"]),["space"]))]},[l.createElementVNode("span",{class:l.normalizeClass(["dp__inner_nav",{dp__inner_nav_disabled:i.disabled}])},[l.renderSlot(i.$slots,"default")],2)],40,lb))}}),cb={class:"dp--year-mode-picker"},db=["aria-label"],Rd=l.defineComponent({__name:"YearModePicker",props:{...Zt,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(n,{emit:e}){const t=e,r=n,{showRightIcon:i,showLeftIcon:o}=_o(),{defaultedConfig:a,defaultedMultiCalendars:s,defaultedAriaLabels:c,defaultedTransitions:d}=We(r),{showTransition:u,transitionName:p}=Ii(d),f=(y=!1,w)=>{t("toggle-year-picker",{flow:y,show:w})},h=y=>{t("year-select",y)},m=(y=!1)=>{t("handle-year",y)};return(y,w)=>{var x,C,N;return l.openBlock(),l.createElementBlock("div",cb,[l.unref(o)(l.unref(s),n.instance)?(l.openBlock(),l.createBlock(Li,{key:0,ref:"mpPrevIconRef","aria-label":(x=l.unref(c))==null?void 0:x.prevYear,disabled:n.isDisabled(!1),onActivate:w[0]||(w[0]=v=>m(!1))},{default:l.withCtx(()=>[y.$slots["arrow-left"]?l.renderSlot(y.$slots,"arrow-left",{key:0}):l.createCommentVNode("",!0),y.$slots["arrow-left"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ka),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createElementVNode("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":(C=l.unref(c))==null?void 0:C.openYearsOverlay,onClick:w[1]||(w[1]=()=>f(!1)),onKeydown:w[2]||(w[2]=l.withKeys(()=>f(!1),["enter"]))},[y.$slots.year?l.renderSlot(y.$slots,"year",{key:0,year:n.year}):l.createCommentVNode("",!0),y.$slots.year?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(n.year),1)],64))],40,db),l.unref(i)(l.unref(s),n.instance)?(l.openBlock(),l.createBlock(Li,{key:1,ref:"mpNextIconRef","aria-label":(N=l.unref(c))==null?void 0:N.nextYear,disabled:n.isDisabled(!0),onActivate:w[3]||(w[3]=v=>m(!0))},{default:l.withCtx(()=>[y.$slots["arrow-right"]?l.renderSlot(y.$slots,"arrow-right",{key:0}):l.createCommentVNode("",!0),y.$slots["arrow-right"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ga),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:l.unref(p)(n.showYearPicker),css:l.unref(u)},{default:l.withCtx(()=>[n.showYearPicker?(l.openBlock(),l.createBlock(Vi,{key:0,items:n.items,"text-input":y.textInput,"esc-close":y.escClose,config:y.config,"is-last":y.autoApply&&!l.unref(a).keepActionRow,"hide-navigation":y.hideNavigation,type:"year",onToggle:f,onSelected:w[4]||(w[4]=v=>h(v))},l.createSlots({"button-icon":l.withCtx(()=>[y.$slots["calendar-icon"]?l.renderSlot(y.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),y.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ur),{key:1}))]),_:2},[y.$slots["year-overlay-value"]?{name:"item",fn:l.withCtx(({item:v})=>[l.renderSlot(y.$slots,"year-overlay-value",{text:v.text,value:v.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last","hide-navigation"])):l.createCommentVNode("",!0)]),_:3},8,["name","css"])])}}}),Ts=(n,e,t)=>{if(e.value&&Array.isArray(e.value))if(e.value.some(r=>Ne(n,r))){const r=e.value.filter(i=>!Ne(i,n));e.value=r.length?r:null}else(t&&+t>e.value.length||!t)&&e.value.push(n);else e.value=[n]},Ms=(n,e,t)=>{let r=n.value?n.value.slice():[];return r.length===2&&r[1]!==null&&(r=[]),r.length?ot(e,r[0])?(r.unshift(e),t("range-start",r[0]),t("range-start",r[1])):(r[1]=e,t("range-end",e)):(r=[e],t("range-start",e)),n.value=r,r},Io=(n,e,t,r)=>{n[0]&&n[1]&&t&&e("auto-apply"),n[0]&&!n[1]&&r&&t&&e("auto-apply")},Vd=n=>{Array.isArray(n.value)&&n.value.length<=2&&n.range?n.modelValue.value=n.value.map(e=>Qt(G(e),n.timezone)):Array.isArray(n.value)||(n.modelValue.value=Qt(G(n.value),n.timezone))},Ld=({multiCalendars:n,highlight:e,calendars:t,modelValue:r,props:i,year:o,month:a,emit:s})=>{const c=l.computed(()=>fs(i.yearRange,i.reverseYears)),d=l.ref([!1]),u=l.computed(()=>(v,O)=>{const k=Ie(Jt(new Date),{month:a.value(v),year:o.value(v)});return Ed(k,i.maxDate,i.minDate,i.preventMinMaxNavigation,O)}),p=()=>{for(let v=0;v<n.value.count;v++)if(v===0)t.value[v]=t.value[0];else{const O=Ie(G(),t.value[v-1]);t.value[v]={month:Se(O),year:we(Ia(O,1))}}},f=v=>{if(!v)return p();const O=Ie(G(),t.value[v]);return t.value[0].year=we(od(O,n.value.count-1)),p()},h=v=>i.focusStartDate?v[0]:v[1]?v[1]:v[0],m=()=>{if(r.value){const v=Array.isArray(r.value)?h(r.value):r.value;t.value[0]={month:Se(v),year:we(v)}}};l.onMounted(()=>{m(),n.value.count&&p()});const y=(v,O)=>{t.value[O].year=v,n.value.count&&!n.value.solo&&f(O)},w=l.computed(()=>v=>Wr(c.value,O=>{const k=o.value(v)===O.value,E=Bi(O.value,qr(i.minDate),qr(i.maxDate)),W=bs(e.value,O.value);return{active:k,disabled:E,highlighted:W}})),x=(v,O)=>{y(v,O),N(O)},C=(v,O=!1)=>{if(!u.value(v,O)){const k=O?o.value(v)+1:o.value(v)-1;y(k,v)}},N=(v,O=!1,k)=>{O||s("reset-flow"),k!==void 0?d.value[v]=k:d.value[v]=!d.value[v],d.value||s("overlay-closed")};return{isDisabled:u,groupedYears:w,showYearPicker:d,selectYear:y,toggleYearPicker:N,handleYearSelect:x,handleYear:C}},ub=(n,e)=>{const{defaultedMultiCalendars:t,defaultedAriaLabels:r,defaultedTransitions:i,defaultedConfig:o,defaultedHighlight:a}=We(n),{modelValue:s,year:c,month:d,calendars:u}=Ri(n,e),p=l.computed(()=>bd(n.formatLocale,n.locale,n.monthNameFormat)),f=l.ref(null),{selectYear:h,groupedYears:m,showYearPicker:y,toggleYearPicker:w,handleYearSelect:x,handleYear:C,isDisabled:N}=Ld({modelValue:s,multiCalendars:t,highlight:a,calendars:u,year:c,month:d,props:n,emit:e});l.onMounted(()=>{n.startDate&&(s.value&&n.focusStartDate||!s.value)&&h(we(G(n.startDate)),0)});const v=V=>V?{month:Se(V),year:we(V)}:{month:null,year:null},O=()=>s.value?Array.isArray(s.value)?s.value.map(V=>v(V)):v(s.value):v(),k=(V,j)=>{const b=u.value[V],g=O();return Array.isArray(g)?g.some(M=>M.year===(b==null?void 0:b.year)&&M.month===j):(b==null?void 0:b.year)===g.year&&j===g.month},E=(V,j,b)=>{var g,M;const A=O();return Array.isArray(A)?c.value(j)===((g=A[b])==null?void 0:g.year)&&V===((M=A[b])==null?void 0:M.month):!1},W=(V,j)=>{if(n.range){const b=O();if(Array.isArray(s.value)&&Array.isArray(b)){const g=E(V,j,0)||E(V,j,1),M=An(Jt(G()),V,c.value(j));return Ao(s.value,f.value,M)&&!g}return!1}return!1},P=l.computed(()=>V=>Wr(p.value,j=>{const b=k(V,j.value),g=Bi(j.value,Td(c.value(V),n.minDate),Md(c.value(V),n.maxDate))||Ov(n.disabledDates,c.value(V)).includes(j.value),M=W(j.value,V),A=_d(a.value,j.value,c.value(V));return{active:b,disabled:g,isBetween:M,highlighted:A}})),T=(V,j)=>An(Jt(G()),V,c.value(j)),_=(V,j)=>{const b=s.value?s.value:Jt(new Date);s.value=An(b,V,c.value(j)),e("auto-apply")},z=(V,j)=>{const b=Ms(s,T(V,j),e);Io(b,e,n.autoApply,n.modelAuto)},q=(V,j)=>{Ts(T(V,j),s,n.multiDatesLimit),e("auto-apply",!0)},L=(V,j)=>(u.value[j].month=V,R(j,u.value[j].year,V),n.multiDates?q(V,j):n.range?z(V,j):_(V,j)),S=(V,j)=>{h(V,j),R(j,V,null)},R=(V,j,b)=>{let g=b;if(!g&&g!==0){const M=O();g=Array.isArray(M)?M[V].month:M.month}e("update-month-year",{instance:V,year:j,month:g})};return{groupedMonths:P,groupedYears:m,year:c,isDisabled:N,defaultedMultiCalendars:t,defaultedAriaLabels:r,defaultedTransitions:i,defaultedConfig:o,showYearPicker:y,modelValue:s,presetDate:(V,j)=>{Vd({value:V,modelValue:s,range:n.range,timezone:j?void 0:n.timezone}),e("auto-apply")},setHoverDate:(V,j)=>{f.value=T(V,j)},selectMonth:L,selectYear:S,toggleYearPicker:w,handleYearSelect:x,handleYear:C,getModelMonthYear:O}},pb=l.defineComponent({compatConfig:{MODE:3},__name:"MonthPicker",props:{...Zt},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","mount"],setup(n,{expose:e,emit:t}){const r=t,i=l.useSlots(),o=Nt(i,"yearMode"),a=n;l.onMounted(()=>{a.shadow||r("mount",null)});const{groupedMonths:s,groupedYears:c,year:d,isDisabled:u,defaultedMultiCalendars:p,defaultedConfig:f,showYearPicker:h,modelValue:m,presetDate:y,setHoverDate:w,selectMonth:x,selectYear:C,toggleYearPicker:N,handleYearSelect:v,handleYear:O,getModelMonthYear:k}=ub(a,r);return e({getSidebarProps:()=>({modelValue:m,year:d,getModelMonthYear:k,selectMonth:x,selectYear:C,handleYear:O}),presetDate:y,toggleYearPicker:E=>N(0,E)}),(E,W)=>(l.openBlock(),l.createBlock(Po,{"multi-calendars":l.unref(p).count,stretch:""},{default:l.withCtx(({instance:P})=>[E.$slots["month-year"]?l.renderSlot(E.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{year:l.unref(d),months:l.unref(s)(P),years:l.unref(c)(P),selectMonth:l.unref(x),selectYear:l.unref(C),instance:P}))):(l.openBlock(),l.createBlock(Vi,{key:1,items:l.unref(s)(P),"arrow-navigation":E.arrowNavigation,"is-last":E.autoApply&&!l.unref(f).keepActionRow,"esc-close":E.escClose,height:l.unref(f).modeHeight,config:E.config,"no-overlay-focus":!!(E.noOverlayFocus||E.textInput),"use-relative":"",type:"month",onSelected:T=>l.unref(x)(T,P),onHoverValue:T=>l.unref(w)(T,P)},{header:l.withCtx(()=>[l.createVNode(Rd,l.mergeProps(E.$props,{items:l.unref(c)(P),instance:P,"show-year-picker":l.unref(h)[P],year:l.unref(d)(P),"is-disabled":T=>l.unref(u)(P,T),onHandleYear:T=>l.unref(O)(P,T),onYearSelect:T=>l.unref(v)(T,P),onToggleYearPicker:T=>l.unref(N)(P,T==null?void 0:T.flow,T==null?void 0:T.show)}),l.createSlots({_:2},[l.renderList(l.unref(o),(T,_)=>({name:T,fn:l.withCtx(z=>[l.renderSlot(E.$slots,T,l.normalizeProps(l.guardReactiveProps(z)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars"]))}}),fb=(n,e)=>{const{modelValue:t}=Ri(n,e),r=l.ref(null),{defaultedHighlight:i,defaultedFilters:o}=We(n),a=l.ref();l.onMounted(()=>{n.startDate&&(t.value&&n.focusStartDate||!t.value)&&(a.value=we(G(n.startDate)))});const s=p=>Array.isArray(t.value)?t.value.some(f=>we(f)===p):t.value?we(t.value)===p:!1,c=p=>n.range&&Array.isArray(t.value)?Ao(t.value,r.value,u(p)):!1,d=l.computed(()=>Wr(fs(n.yearRange,n.reverseYears),p=>{const f=s(p.value),h=Bi(p.value,qr(n.minDate),qr(n.maxDate))||o.value.years.includes(p.value),m=c(p.value)&&!f,y=bs(i.value,p.value);return{active:f,disabled:h,isBetween:m,highlighted:y}})),u=p=>fn(Jt(new Date),p);return{groupedYears:d,modelValue:t,focusYear:a,setHoverValue:p=>{r.value=fn(Jt(new Date),p)},selectYear:p=>{var f;if(n.multiDates)return t.value?Array.isArray(t.value)&&(((f=t.value)==null?void 0:f.map(h=>we(h))).includes(p)?t.value=t.value.filter(h=>we(h)!==p):t.value.push(fn(dt(G()),p))):t.value=[fn(dt(G()),p)],e("auto-apply",!0);if(n.range){const h=Ms(t,u(p),e);return Io(h,e,n.autoApply,n.modelAuto)}t.value=u(p),e("auto-apply")}}},hb=l.defineComponent({compatConfig:{MODE:3},__name:"YearPicker",props:{...Zt},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply"],setup(n,{expose:e,emit:t}){const r=t,i=n,{groupedYears:o,modelValue:a,focusYear:s,selectYear:c,setHoverValue:d}=fb(i,r),{defaultedConfig:u}=We(i);return e({getSidebarProps:()=>({modelValue:a,selectYear:c})}),(p,f)=>(l.openBlock(),l.createElementBlock("div",null,[p.$slots["month-year"]?l.renderSlot(p.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{years:l.unref(o),selectYear:l.unref(c)}))):(l.openBlock(),l.createBlock(Vi,{key:1,items:l.unref(o),"is-last":p.autoApply&&!l.unref(u).keepActionRow,height:l.unref(u).modeHeight,config:p.config,"no-overlay-focus":!!(p.noOverlayFocus||p.textInput),"focus-value":l.unref(s),type:"year","use-relative":"",onSelected:l.unref(c),onHoverValue:l.unref(d)},l.createSlots({_:2},[p.$slots["year-overlay-value"]?{name:"item",fn:l.withCtx(({item:h})=>[l.renderSlot(p.$slots,"year-overlay-value",{text:h.text,value:h.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),mb={key:0,class:"dp__time_input"},gb=["aria-label","onKeydown","onClick"],yb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),vb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),bb=["aria-label","disabled","onKeydown","onClick"],wb=["aria-label","onKeydown","onClick"],kb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1),xb=l.createElementVNode("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1),Cb={key:0},Tb=["aria-label","onKeydown"],Mb=l.defineComponent({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...Zt},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","am-pm-change"],setup(n,{expose:e,emit:t}){const r=t,i=n,{setTimePickerElements:o,setTimePickerBackRef:a}=Yn(),{defaultedAriaLabels:s,defaultedTransitions:c,defaultedFilters:d,defaultedConfig:u}=We(i),{transitionName:p,showTransition:f}=Ii(c),h=l.reactive({hours:!1,minutes:!1,seconds:!1}),m=l.ref("AM"),y=l.ref(null),w=l.ref([]);l.onMounted(()=>{r("mounted")});const x=D=>Ie(new Date,{hours:D.hours,minutes:D.minutes,seconds:i.enableSeconds?D.seconds:0,milliseconds:0}),C=l.computed(()=>D=>L(D,i[D])||v(D,i[D])),N=l.computed(()=>({hours:i.hours,minutes:i.minutes,seconds:i.seconds})),v=(D,ee)=>i.range&&!i.disableTimeRangeValidation?!i.validateTime(D,ee):!1,O=(D,ee)=>{if(i.range&&!i.disableTimeRangeValidation){const te=ee?+i[`${D}Increment`]:-+i[`${D}Increment`],K=i[D]+te;return!i.validateTime(D,K)}return!1},k=l.computed(()=>D=>!R(+i[D]+ +i[`${D}Increment`],D)||O(D,!0)),E=l.computed(()=>D=>!R(+i[D]-+i[`${D}Increment`],D)||O(D,!1)),W=(D,ee)=>Dc(Ie(G(),D),ee),P=(D,ee)=>H0(Ie(G(),D),ee),T=l.computed(()=>({dp__time_col:!0,dp__time_col_block:!i.timePickerInline,dp__time_col_reg_block:!i.enableSeconds&&i.is24&&!i.timePickerInline,dp__time_col_reg_inline:!i.enableSeconds&&i.is24&&i.timePickerInline,dp__time_col_reg_with_button:!i.enableSeconds&&!i.is24,dp__time_col_sec:i.enableSeconds&&i.is24,dp__time_col_sec_with_button:i.enableSeconds&&!i.is24})),_=l.computed(()=>{const D=[{type:"hours"},{type:"",separator:!0},{type:"minutes"}];return i.enableSeconds?D.concat([{type:"",separator:!0},{type:"seconds"}]):D}),z=l.computed(()=>_.value.filter(D=>!D.separator)),q=l.computed(()=>D=>{if(D==="hours"){const ee=M(+i.hours);return{text:ee<10?`0${ee}`:`${ee}`,value:ee}}return{text:i[D]<10?`0${i[D]}`:`${i[D]}`,value:i[D]}}),L=(D,ee)=>{var te;if(!i.disabledTimesConfig)return!1;const K=i.disabledTimesConfig(i.order,D==="hours"?ee:void 0);return K[D]?!!((te=K[D])!=null&&te.includes(ee)):!0},S=D=>{const ee=i.is24?24:12,te=D==="hours"?ee:60,K=+i[`${D}GridIncrement`],ce=D==="hours"&&!i.is24?K:0,ae=[];for(let U=ce;U<te;U+=K)ae.push({value:U,text:U<10?`0${U}`:`${U}`});return D==="hours"&&!i.is24&&ae.push({value:0,text:"12"}),Wr(ae,U=>({active:!1,disabled:d.value.times[D].includes(U.value)||!R(U.value,D)||L(D,U.value)||v(D,U.value)}))},R=(D,ee)=>{const te=i.minTime?x(hs(i.minTime)):null,K=i.maxTime?x(hs(i.maxTime)):null,ce=x(hs(N.value,ee,D));return te&&K?(Oi(ce,K)||Yr(ce,K))&&(Ni(ce,te)||Yr(ce,te)):te?Ni(ce,te)||Yr(ce,te):K?Oi(ce,K)||Yr(ce,K):!0},V=D=>i[`no${D[0].toUpperCase()+D.slice(1)}Overlay`],j=D=>{V(D)||(h[D]=!h[D],h[D]||r("overlay-closed"))},b=D=>D==="hours"?Gt:D==="minutes"?dn:Hr,g=(D,ee=!0)=>{const te=ee?W:P,K=ee?+i[`${D}Increment`]:-+i[`${D}Increment`];R(+i[D]+K,D)&&r(`update:${D}`,b(D)(te({[D]:+i[D]},{[D]:+i[`${D}Increment`]})))},M=D=>i.is24?D:(D>=12?m.value="PM":m.value="AM",yv(D)),A=()=>{m.value==="PM"?(m.value="AM",r("update:hours",i.hours-12)):(m.value="PM",r("update:hours",i.hours+12)),r("am-pm-change",m.value)},$=D=>{h[D]=!0},F=(D,ee,te)=>{if(D&&i.arrowNavigation){Array.isArray(w.value[ee])?w.value[ee][te]=D:w.value[ee]=[D];const K=w.value.reduce((ce,ae)=>ae.map((U,Z)=>[...ce[Z]||[],ae[Z]]),[]);a(i.closeTimePickerBtn),y.value&&(K[1]=K[1].concat(y.value)),o(K,i.order)}},B=(D,ee)=>(j(D),D==="hours"&&!i.is24?r(`update:${D}`,m.value==="PM"?ee+12:ee):r(`update:${D}`,ee));return e({openChildCmp:$}),(D,ee)=>{var te;return D.disabled?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",mb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,(K,ce)=>{var ae,U,Z;return l.openBlock(),l.createElementBlock("div",{key:ce,class:l.normalizeClass(T.value)},[K.separator?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createTextVNode(" : ")],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("button",{ref_for:!0,ref:me=>F(me,ce,0),type:"button",class:l.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_top:D.timePickerInline,dp__inc_dec_button_disabled:k.value(K.type)}),"aria-label":(ae=l.unref(s))==null?void 0:ae.incrementValue(K.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(me=>g(K.type),["prevent"]),["enter"]),l.withKeys(l.withModifiers(me=>g(K.type),["prevent"]),["space"])],onClick:me=>g(K.type)},[i.timePickerInline?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[yb,vb],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[D.$slots["arrow-up"]?l.renderSlot(D.$slots,"arrow-up",{key:0}):l.createCommentVNode("",!0),D.$slots["arrow-up"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Qa),{key:1}))],64))],42,gb),l.createElementVNode("button",{ref_for:!0,ref:me=>F(me,ce,1),type:"button","aria-label":(U=l.unref(s))==null?void 0:U.openTpOverlay(K.type),class:l.normalizeClass({dp__time_display:!0,dp__time_display_block:!D.timePickerInline,dp__time_display_inline:D.timePickerInline,"dp--time-invalid":C.value(K.type),"dp--time-overlay-btn":!C.value(K.type)}),disabled:V(K.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(me=>j(K.type),["prevent"]),["enter"]),l.withKeys(l.withModifiers(me=>j(K.type),["prevent"]),["space"])],onClick:me=>j(K.type)},[D.$slots[K.type]?l.renderSlot(D.$slots,K.type,{key:0,text:q.value(K.type).text,value:q.value(K.type).value}):l.createCommentVNode("",!0),D.$slots[K.type]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(q.value(K.type).text),1)],64))],42,bb),l.createElementVNode("button",{ref_for:!0,ref:me=>F(me,ce,2),type:"button",class:l.normalizeClass({dp__btn:!0,dp__inc_dec_button:!D.timePickerInline,dp__inc_dec_button_inline:D.timePickerInline,dp__tp_inline_btn_bottom:D.timePickerInline,dp__inc_dec_button_disabled:E.value(K.type)}),"aria-label":(Z=l.unref(s))==null?void 0:Z.decrementValue(K.type),tabindex:"0",onKeydown:[l.withKeys(l.withModifiers(me=>g(K.type,!1),["prevent"]),["enter"]),l.withKeys(l.withModifiers(me=>g(K.type,!1),["prevent"]),["space"])],onClick:me=>g(K.type,!1)},[i.timePickerInline?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[kb,xb],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[D.$slots["arrow-down"]?l.renderSlot(D.$slots,"arrow-down",{key:0}):l.createCommentVNode("",!0),D.$slots["arrow-down"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Xa),{key:1}))],64))],42,wb)],64))],2)}),128)),D.is24?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",Cb,[D.$slots["am-pm-button"]?l.renderSlot(D.$slots,"am-pm-button",{key:0,toggle:A,value:m.value}):l.createCommentVNode("",!0),D.$slots["am-pm-button"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("button",{key:1,ref_key:"amPmButton",ref:y,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(te=l.unref(s))==null?void 0:te.amPmButton,tabindex:"0",onClick:A,onKeydown:[l.withKeys(l.withModifiers(A,["prevent"]),["enter"]),l.withKeys(l.withModifiers(A,["prevent"]),["space"])]},l.toDisplayString(m.value),41,Tb))])),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(z.value,(K,ce)=>(l.openBlock(),l.createBlock(l.Transition,{key:ce,name:l.unref(p)(h[K.type]),css:l.unref(f)},{default:l.withCtx(()=>[h[K.type]?(l.openBlock(),l.createBlock(Vi,{key:0,items:S(K.type),"is-last":D.autoApply&&!l.unref(u).keepActionRow,"esc-close":D.escClose,type:K.type,"text-input":D.textInput,config:D.config,"arrow-navigation":D.arrowNavigation,onSelected:ae=>B(K.type,ae),onToggle:ae=>j(K.type),onResetFlow:ee[0]||(ee[0]=ae=>D.$emit("reset-flow"))},l.createSlots({"button-icon":l.withCtx(()=>[D.$slots["clock-icon"]?l.renderSlot(D.$slots,"clock-icon",{key:0}):l.createCommentVNode("",!0),D.$slots["clock-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(D.timePickerInline?l.unref(Ur):l.unref(Ja)),{key:1}))]),_:2},[D.$slots[`${K.type}-overlay-value`]?{name:"item",fn:l.withCtx(({item:ae})=>[l.renderSlot(D.$slots,`${K.type}-overlay-value`,{text:ae.text,value:ae.value})]),key:"0"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","onSelected","onToggle"])):l.createCommentVNode("",!0)]),_:2},1032,["name","css"]))),128))]))}}}),Sb={class:"dp--tp-wrap"},Db=["aria-label","tabindex"],Ab=["tabindex"],Eb=["aria-label"],$d=l.defineComponent({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...Zt},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(n,{expose:e,emit:t}){const r=t,i=n,{buildMatrix:o,setTimePicker:a}=Yn(),s=l.useSlots(),{defaultedTransitions:c,defaultedAriaLabels:d,defaultedTextInput:u,defaultedConfig:p}=We(i),{transitionName:f,showTransition:h}=Ii(c),{hideNavigationButtons:m}=_o(),y=l.ref(null),w=l.ref(null),x=l.ref([]),C=l.ref(null);l.onMounted(()=>{r("mount"),!i.timePicker&&i.arrowNavigation?o([Je(y.value)],"time"):a(!0,i.timePicker)});const N=l.computed(()=>i.range&&i.modelAuto?wd(i.internalModelValue):!0),v=l.ref(!1),O=S=>({hours:Array.isArray(i.hours)?i.hours[S]:i.hours,minutes:Array.isArray(i.minutes)?i.minutes[S]:i.minutes,seconds:Array.isArray(i.seconds)?i.seconds[S]:i.seconds}),k=l.computed(()=>{const S=[];if(i.range)for(let R=0;R<2;R++)S.push(O(R));else S.push(O(0));return S}),E=(S,R=!1,V="")=>{R||r("reset-flow"),v.value=S,r(S?"overlay-opened":"overlay-closed"),i.arrowNavigation&&a(S),l.nextTick(()=>{V!==""&&x.value[0]&&x.value[0].openChildCmp(V)})},W=l.computed(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:i.autoApply&&!p.value.keepActionRow})),P=Nt(s,"timePicker"),T=(S,R,V)=>i.range?R===0?[S,k.value[1][V]]:[k.value[0][V],S]:S,_=S=>{r("update:hours",S)},z=S=>{r("update:minutes",S)},q=S=>{r("update:seconds",S)},L=()=>{if(C.value&&!u.value.enabled&&!i.noOverlayFocus){const S=bv(C.value);S&&S.focus({preventScroll:!0})}};return e({toggleTimePicker:E}),(S,R)=>{var V;return l.openBlock(),l.createElementBlock("div",Sb,[!S.timePicker&&!S.timePickerInline?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:0,ref_key:"openTimePickerBtn",ref:y,type:"button",class:l.normalizeClass(W.value),"aria-label":(V=l.unref(d))==null?void 0:V.openTimePicker,tabindex:S.noOverlayFocus?void 0:0,onKeydown:[R[0]||(R[0]=l.withKeys(j=>E(!0),["enter"])),R[1]||(R[1]=l.withKeys(j=>E(!0),["space"]))],onClick:R[2]||(R[2]=j=>E(!0))},[S.$slots["clock-icon"]?l.renderSlot(S.$slots,"clock-icon",{key:0}):l.createCommentVNode("",!0),S.$slots["clock-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ja),{key:1}))],42,Db)),[[l.vShow,!l.unref(m)(S.hideNavigation,"time")]]):l.createCommentVNode("",!0),l.createVNode(l.Transition,{name:l.unref(f)(v.value),css:l.unref(h)&&!S.timePickerInline},{default:l.withCtx(()=>{var j;return[v.value||S.timePicker||S.timePickerInline?(l.openBlock(),l.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:C,class:l.normalizeClass({dp__overlay:!S.timePickerInline,"dp--overlay-absolute":!i.timePicker&&!S.timePickerInline,"dp--overlay-relative":i.timePicker}),style:l.normalizeStyle(S.timePicker?{height:`${l.unref(p).modeHeight}px`}:void 0),tabindex:S.timePickerInline?void 0:0},[l.createElementVNode("div",{class:l.normalizeClass(S.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[S.$slots["time-picker-overlay"]?l.renderSlot(S.$slots,"time-picker-overlay",{key:0,hours:n.hours,minutes:n.minutes,seconds:n.seconds,setHours:_,setMinutes:z,setSeconds:q}):l.createCommentVNode("",!0),S.$slots["time-picker-overlay"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(S.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(k.value,(b,g)=>l.withDirectives((l.openBlock(),l.createBlock(Mb,l.mergeProps({key:g},{...S.$props,order:g,hours:b.hours,minutes:b.minutes,seconds:b.seconds,closeTimePickerBtn:w.value,disabledTimesConfig:n.disabledTimesConfig,disabled:g===0?S.fixedStart:S.fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:x,"validate-time":(M,A)=>n.validateTime(M,T(A,g,M)),"onUpdate:hours":M=>_(T(M,g,"hours")),"onUpdate:minutes":M=>z(T(M,g,"minutes")),"onUpdate:seconds":M=>q(T(M,g,"seconds")),onMounted:L,onOverlayClosed:L,onAmPmChange:R[3]||(R[3]=M=>S.$emit("am-pm-change",M))}),l.createSlots({_:2},[l.renderList(l.unref(P),(M,A)=>({name:M,fn:l.withCtx($=>[l.renderSlot(S.$slots,M,l.normalizeProps(l.guardReactiveProps($)))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[l.vShow,g===0?!0:N.value]])),128))],2)),!S.timePicker&&!S.timePickerInline?l.withDirectives((l.openBlock(),l.createElementBlock("button",{key:2,ref_key:"closeTimePickerBtn",ref:w,type:"button",class:l.normalizeClass(W.value),"aria-label":(j=l.unref(d))==null?void 0:j.closeTimePicker,tabindex:"0",onKeydown:[R[4]||(R[4]=l.withKeys(b=>E(!1),["enter"])),R[5]||(R[5]=l.withKeys(b=>E(!1),["space"]))],onClick:R[6]||(R[6]=b=>E(!1))},[S.$slots["calendar-icon"]?l.renderSlot(S.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),S.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ur),{key:1}))],42,Eb)),[[l.vShow,!l.unref(m)(S.hideNavigation,"time")]]):l.createCommentVNode("",!0)],2)],14,Ab)):l.createCommentVNode("",!0)]}),_:3},8,["name","css"])])}}}),Fd=(n,e,t,r)=>{const i=(x,C)=>Array.isArray(e[x])?e[x][C]:e[x],o=x=>n.enableSeconds?Array.isArray(e.seconds)?e.seconds[x]:e.seconds:0,a=(x,C)=>x?C!==void 0?zn(x,i("hours",C),i("minutes",C),o(C)):zn(x,e.hours,e.minutes,o()):qa(G(),o(C)),s=(x,C)=>{e[x]=C},c=(x,C)=>{const N=Object.fromEntries(Object.keys(e).map(v=>v===x?[v,C]:[v,e[v]].slice()));if(n.range&&!n.disableTimeRangeValidation){const v=k=>t.value?zn(t.value[k],N.hours[k],N.minutes[k],N.seconds[k]):null,O=k=>Wa(t.value[k],0);return!(Ne(v(0),v(1))&&(Ni(v(0),O(1))||Oi(v(1),O(0))))}return!0},d=(x,C)=>{c(x,C)&&(s(x,C),r&&r())},u=x=>{d("hours",x)},p=x=>{d("minutes",x)},f=x=>{d("seconds",x)},h=(x,C,N,v)=>{C&&u(x),!C&&!N&&p(x),N&&f(x),t.value&&v(t.value)},m=x=>{if(x){const C=Array.isArray(x),N=C?[+x[0].hours,+x[1].hours]:+x.hours,v=C?[+x[0].minutes,+x[1].minutes]:+x.minutes,O=C?[+x[0].seconds,+x[1].seconds]:+x.seconds;s("hours",N),s("minutes",v),n.enableSeconds&&s("seconds",O)}},y=(x,C)=>{const N={hours:Array.isArray(e.hours)?e.hours[x]:e.hours,disabledArr:[]};return(C||C===0)&&(N.hours=C),Array.isArray(n.disabledTimes)&&(N.disabledArr=n.range&&Array.isArray(n.disabledTimes[x])?n.disabledTimes[x]:n.disabledTimes),N},w=l.computed(()=>(x,C)=>{var N;if(Array.isArray(n.disabledTimes)){const{disabledArr:v,hours:O}=y(x,C),k=v.filter(E=>+E.hours===O);return((N=k[0])==null?void 0:N.minutes)==="*"?{hours:[O],minutes:void 0,seconds:void 0}:{hours:[],minutes:(k==null?void 0:k.map(E=>+E.minutes))??[],seconds:(k==null?void 0:k.map(E=>E.seconds?+E.seconds:void 0))??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:s,updateHours:u,updateMinutes:p,updateSeconds:f,getSetDateTime:a,updateTimeValues:h,getSecondsValue:o,assignStartTime:m,validateTime:c,disabledTimesConfig:w}},Nb=(n,e)=>{const{modelValue:t,time:r}=Ri(n,e),{defaultedStartTime:i}=We(n),{updateTimeValues:o,getSetDateTime:a,setTime:s,assignStartTime:c,disabledTimesConfig:d,validateTime:u}=Fd(n,r,t),p=C=>{const{hours:N,minutes:v,seconds:O}=C;return{hours:+N,minutes:+v,seconds:O?+O:0}},f=()=>{if(n.startTime){if(Array.isArray(n.startTime)){const N=p(n.startTime[0]),v=p(n.startTime[1]);return[Ie(G(),N),Ie(G(),v)]}const C=p(n.startTime);return Ie(G(),C)}return n.range?[null,null]:null},h=()=>{if(n.range){const[C,N]=f();t.value=[a(C,0),a(N,1)]}else t.value=a(f())},m=C=>Array.isArray(C)?[gr(G(C[0])),gr(G(C[1]))]:[gr(C??G())],y=(C,N,v)=>{s("hours",C),s("minutes",N),s("seconds",n.enableSeconds?v:0)},w=()=>{const[C,N]=m(t.value);return n.range?y([C.hours,N.hours],[C.minutes,N.minutes],[C.seconds,N.minutes]):y(C.hours,C.minutes,C.seconds)};l.onMounted(()=>{if(!n.shadow)return c(i.value),t.value?w():h()});const x=()=>{Array.isArray(t.value)?t.value=t.value.map((C,N)=>C&&a(C,N)):t.value=a(t.value),e("time-update")};return{modelValue:t,time:r,disabledTimesConfig:d,updateTime:(C,N=!0,v=!1)=>{o(C,N,v,x)},validateTime:u}},Ob=l.defineComponent({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...Zt},emits:["update:internal-model-value","time-update","am-pm-change"],setup(n,{expose:e,emit:t}){const r=t,i=n,o=l.useSlots(),a=Nt(o,"timePicker"),{time:s,modelValue:c,disabledTimesConfig:d,updateTime:u,validateTime:p}=Nb(i,r);return e({getSidebarProps:()=>({modelValue:c,time:s,updateTime:u})}),(f,h)=>(l.openBlock(),l.createBlock(Po,{"multi-calendars":0,stretch:""},{default:l.withCtx(()=>[l.createVNode($d,l.mergeProps(f.$props,{hours:l.unref(s).hours,minutes:l.unref(s).minutes,seconds:l.unref(s).seconds,"internal-model-value":f.internalModelValue,"disabled-times-config":l.unref(d),"validate-time":l.unref(p),"onUpdate:hours":h[0]||(h[0]=m=>l.unref(u)(m)),"onUpdate:minutes":h[1]||(h[1]=m=>l.unref(u)(m,!1)),"onUpdate:seconds":h[2]||(h[2]=m=>l.unref(u)(m,!1,!0)),onAmPmChange:h[3]||(h[3]=m=>f.$emit("am-pm-change",m))}),l.createSlots({_:2},[l.renderList(l.unref(a),(m,y)=>({name:m,fn:l.withCtx(w=>[l.renderSlot(f.$slots,m,l.normalizeProps(l.guardReactiveProps(w)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),_b={class:"dp__month_year_row"},Bb=["aria-label","onClick","onKeydown"],Pb=l.defineComponent({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...Zt},emits:["update-month-year","mount","reset-flow","overlay-closed"],setup(n,{expose:e,emit:t}){const r=t,i=n,{defaultedTransitions:o,defaultedAriaLabels:a,defaultedMultiCalendars:s,defaultedFilters:c,defaultedConfig:d,defaultedHighlight:u}=We(i),{transitionName:p,showTransition:f}=Ii(o),{buildMatrix:h}=Yn(),{handleMonthYearChange:m,isDisabled:y,updateMonthYear:w}=jv(i,r),{showLeftIcon:x,showRightIcon:C}=_o(),N=l.ref(!1),v=l.ref(!1),O=l.ref([null,null,null,null]);l.onMounted(()=>{r("mount")});const k=g=>({get:()=>i[g],set:M=>{const A=g===Xt.month?Xt.year:Xt.month;r("update-month-year",{[g]:M,[A]:i[A]}),g===Xt.month?L(!0):S(!0)}}),E=l.computed(k(Xt.month)),W=l.computed(k(Xt.year)),P=l.computed(()=>g=>({month:i.month,year:i.year,items:g===Xt.month?i.months:i.years,instance:i.instance,updateMonthYear:w,toggle:g===Xt.month?L:S})),T=l.computed(()=>i.months.find(M=>M.value===i.month)||{text:"",value:0}),_=l.computed(()=>Wr(i.months,g=>{const M=i.month===g.value,A=Bi(g.value,Td(i.year,i.minDate),Md(i.year,i.maxDate))||c.value.months.includes(g.value),$=_d(u.value,g.value,i.year);return{active:M,disabled:A,highlighted:$}})),z=l.computed(()=>Wr(i.years,g=>{const M=i.year===g.value,A=Bi(g.value,qr(i.minDate),qr(i.maxDate))||c.value.years.includes(g.value),$=bs(u.value,g.value);return{active:M,disabled:A,highlighted:$}})),q=(g,M)=>{M!==void 0?g.value=M:g.value=!g.value,g.value||r("overlay-closed")},L=(g=!1,M)=>{R(g),q(N,M)},S=(g=!1,M)=>{R(g),q(v,M)},R=g=>{g||r("reset-flow")},V=(g,M)=>{i.arrowNavigation&&(O.value[M]=Je(g),h(O.value,"monthYear"))},j=l.computed(()=>{var g,M;return[{type:Xt.month,index:1,toggle:L,modelValue:E.value,updateModelValue:A=>E.value=A,text:T.value.text,showSelectionGrid:N.value,items:_.value,ariaLabel:(g=a.value)==null?void 0:g.openMonthsOverlay},{type:Xt.year,index:2,toggle:S,modelValue:W.value,updateModelValue:A=>W.value=A,text:i.year,showSelectionGrid:v.value,items:z.value,ariaLabel:(M=a.value)==null?void 0:M.openYearsOverlay}]}),b=l.computed(()=>i.disableYearSelect?[j.value[0]]:i.yearFirst?[...j.value].reverse():j.value);return e({toggleMonthPicker:L,toggleYearPicker:S,handleMonthYearChange:m}),(g,M)=>{var A,$,F;return l.openBlock(),l.createElementBlock("div",_b,[g.$slots["month-year"]?l.renderSlot(g.$slots,"month-year",l.normalizeProps(l.mergeProps({key:0},{month:n.month,year:n.year,months:n.months,years:n.years,updateMonthYear:l.unref(w),handleMonthYearChange:l.unref(m),instance:n.instance}))):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.unref(x)(l.unref(s),n.instance)&&!g.vertical?(l.openBlock(),l.createBlock(Li,{key:0,"aria-label":(A=l.unref(a))==null?void 0:A.prevMonth,disabled:l.unref(y)(!1),onActivate:M[0]||(M[0]=B=>l.unref(m)(!1,!0)),onSetRef:M[1]||(M[1]=B=>V(B,0))},{default:l.withCtx(()=>[g.$slots["arrow-left"]?l.renderSlot(g.$slots,"arrow-left",{key:0}):l.createCommentVNode("",!0),g.$slots["arrow-left"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ka),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:l.normalizeClass(["dp__month_year_wrap",{dp__year_disable_select:g.disableYearSelect}])},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(b.value,(B,D)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:B.type},[l.createElementVNode("button",{ref_for:!0,ref:ee=>V(ee,D+1),type:"button",class:"dp__btn dp__month_year_select",tabindex:"0","aria-label":B.ariaLabel,onClick:B.toggle,onKeydown:[l.withKeys(l.withModifiers(B.toggle,["prevent"]),["enter"]),l.withKeys(l.withModifiers(B.toggle,["prevent"]),["space"])]},[g.$slots[B.type]?l.renderSlot(g.$slots,B.type,{key:0,text:B.text,value:i[B.type]}):l.createCommentVNode("",!0),g.$slots[B.type]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(B.text),1)],64))],40,Bb),l.createVNode(l.Transition,{name:l.unref(p)(B.showSelectionGrid),css:l.unref(f)},{default:l.withCtx(()=>[B.showSelectionGrid?(l.openBlock(),l.createBlock(Vi,{key:0,items:B.items,"arrow-navigation":g.arrowNavigation,"hide-navigation":g.hideNavigation,"is-last":g.autoApply&&!l.unref(d).keepActionRow,"skip-button-ref":!1,config:g.config,type:B.type,"header-refs":[],"esc-close":g.escClose,"text-input":g.textInput,onSelected:B.updateModelValue,onToggle:B.toggle},l.createSlots({"button-icon":l.withCtx(()=>[g.$slots["calendar-icon"]?l.renderSlot(g.$slots,"calendar-icon",{key:0}):l.createCommentVNode("",!0),g.$slots["calendar-icon"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Ur),{key:1}))]),_:2},[g.$slots[`${B.type}-overlay-value`]?{name:"item",fn:l.withCtx(({item:ee})=>[l.renderSlot(g.$slots,`${B.type}-overlay-value`,{text:ee.text,value:ee.value})]),key:"0"}:void 0,g.$slots[`${B.type}-overlay`]?{name:"overlay",fn:l.withCtx(()=>[l.renderSlot(g.$slots,`${B.type}-overlay`,l.normalizeProps(l.guardReactiveProps(P.value(B.type))))]),key:"1"}:void 0,g.$slots[`${B.type}-overlay-header`]?{name:"header",fn:l.withCtx(()=>[l.renderSlot(g.$slots,`${B.type}-overlay-header`,{toggle:B.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","text-input","onSelected","onToggle"])):l.createCommentVNode("",!0)]),_:2},1032,["name","css"])],64))),128))],2),l.unref(x)(l.unref(s),n.instance)&&g.vertical?(l.openBlock(),l.createBlock(Li,{key:1,"aria-label":($=l.unref(a))==null?void 0:$.prevMonth,disabled:l.unref(y)(!1),onActivate:M[2]||(M[2]=B=>l.unref(m)(!1,!0))},{default:l.withCtx(()=>[g.$slots["arrow-up"]?l.renderSlot(g.$slots,"arrow-up",{key:0}):l.createCommentVNode("",!0),g.$slots["arrow-up"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Qa),{key:1}))]),_:3},8,["aria-label","disabled"])):l.createCommentVNode("",!0),l.unref(C)(l.unref(s),n.instance)?(l.openBlock(),l.createBlock(Li,{key:2,ref:"rightIcon",disabled:l.unref(y)(!0),"aria-label":(F=l.unref(a))==null?void 0:F.nextMonth,onActivate:M[3]||(M[3]=B=>l.unref(m)(!0,!0)),onSetRef:M[4]||(M[4]=B=>V(B,g.disableYearSelect?2:3))},{default:l.withCtx(()=>[g.$slots[g.vertical?"arrow-down":"arrow-right"]?l.renderSlot(g.$slots,g.vertical?"arrow-down":"arrow-right",{key:0}):l.createCommentVNode("",!0),g.$slots[g.vertical?"arrow-down":"arrow-right"]?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(g.vertical?l.unref(Xa):l.unref(Ga)),{key:1}))]),_:3},8,["disabled","aria-label"])):l.createCommentVNode("",!0)],64))])}}}),Ib=["aria-label"],Rb={class:"dp__calendar_header",role:"row"},Vb={key:0,class:"dp__calendar_header_item",role:"gridcell"},Lb=l.createElementVNode("div",{class:"dp__calendar_header_separator"},null,-1),$b=["aria-label"],Fb={key:0,role:"gridcell",class:"dp__calendar_item dp__week_num"},zb={class:"dp__cell_inner"},Hb=["id","aria-selected","aria-disabled","aria-label","onClick","onKeydown","onMouseenter","onMouseleave"],Yb=l.defineComponent({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...Zt},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(n,{expose:e,emit:t}){const r=t,i=n,{buildMultiLevelMatrix:o}=Yn(),{defaultedTransitions:a,defaultedConfig:s,defaultedAriaLabels:c,defaultedMultiCalendars:d,defaultedWeekNumbers:u}=We(i),p=l.ref(null),f=l.ref({bottom:"",left:"",transform:""}),h=l.ref([]),m=l.ref(null),y=l.ref(!0),w=l.ref(""),x=l.ref({startX:0,endX:0,startY:0,endY:0}),C=l.ref([]),N=l.ref({left:"50%"}),v=l.computed(()=>i.calendar?i.calendar(i.mappedDates):i.mappedDates),O=l.computed(()=>i.dayNames?Array.isArray(i.dayNames)?i.dayNames:i.dayNames(i.locale,+i.weekStart):gv(i.formatLocale,i.locale,+i.weekStart));l.onMounted(()=>{r("mount",{cmp:"calendar",refs:h}),s.value.noSwipe||m.value&&(m.value.addEventListener("touchstart",S,{passive:!1}),m.value.addEventListener("touchend",R,{passive:!1}),m.value.addEventListener("touchmove",V,{passive:!1})),i.monthChangeOnScroll&&m.value&&m.value.addEventListener("wheel",g,{passive:!1})});const k=B=>B?i.vertical?"vNext":"next":i.vertical?"vPrevious":"previous",E=(B,D)=>{if(i.transitions){const ee=dt(An(G(),i.month,i.year));w.value=ut(dt(An(G(),B,D)),ee)?a.value[k(!0)]:a.value[k(!1)],y.value=!1,l.nextTick(()=>{y.value=!0})}},W=l.computed(()=>({[i.calendarClassName]:!!i.calendarClassName})),P=l.computed(()=>B=>{const D=vv(B);return{dp__marker_dot:D.type==="dot",dp__marker_line:D.type==="line"}}),T=l.computed(()=>B=>Ne(B,p.value)),_=l.computed(()=>({dp__calendar:!0,dp__calendar_next:d.value.count>0&&i.instance!==0})),z=l.computed(()=>B=>i.hideOffsetDates?B.current:!0),q=async(B,D,ee)=>{var te,K;if(r("set-hover-date",B),(K=(te=B.marker)==null?void 0:te.tooltip)!=null&&K.length){const ce=Je(h.value[D][ee]);if(ce){const{width:ae,height:U}=ce.getBoundingClientRect();p.value=B.value;let Z={left:`${ae/2}px`},me=-50;if(await l.nextTick(),C.value[0]){const{left:ne,width:Me}=C.value[0].getBoundingClientRect();ne<0&&(Z={left:"0"},me=0,N.value.left=`${ae/2}px`),window.innerWidth<ne+Me&&(Z={right:"0"},me=0,N.value.left=`${Me-ae/2}px`)}f.value={bottom:`${U}px`,...Z,transform:`translateX(${me}%)`},r("tooltip-open",B.marker)}}},L=B=>{p.value&&(p.value=null,f.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),r("tooltip-close",B.marker))},S=B=>{x.value.startX=B.changedTouches[0].screenX,x.value.startY=B.changedTouches[0].screenY},R=B=>{x.value.endX=B.changedTouches[0].screenX,x.value.endY=B.changedTouches[0].screenY,j()},V=B=>{i.vertical&&!i.inline&&B.preventDefault()},j=()=>{const B=i.vertical?"Y":"X";Math.abs(x.value[`start${B}`]-x.value[`end${B}`])>10&&r("handle-swipe",x.value[`start${B}`]>x.value[`end${B}`]?"right":"left")},b=(B,D,ee)=>{B&&(Array.isArray(h.value[D])?h.value[D][ee]=B:h.value[D]=[B]),i.arrowNavigation&&o(h.value,"calendar")},g=B=>{i.monthChangeOnScroll&&(B.preventDefault(),r("handle-scroll",B))},M=B=>u.value.type==="local"?Ey(B.value,{weekStartsOn:+i.weekStart}):u.value.type==="iso"?My(B.value):typeof u.value.type=="function"?u.value.type(B.value):"",A=B=>{const D=B[0];return u.value.hideOnOffsetDates?B.some(ee=>ee.current)?M(D):"":M(D)},$=(B,D)=>{Fn(B,s.value),r("select-date",D)},F=B=>{Fn(B,s.value)};return e({triggerTransition:E}),(B,D)=>{var ee;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(_.value)},[l.createElementVNode("div",{ref_key:"calendarWrapRef",ref:m,role:"grid",class:l.normalizeClass(W.value),"aria-label":(ee=l.unref(c))==null?void 0:ee.calendarWrap},[(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",Rb,[B.weekNumbers?(l.openBlock(),l.createElementBlock("div",Vb,l.toDisplayString(B.weekNumName),1)):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(O.value,(te,K)=>(l.openBlock(),l.createElementBlock("div",{key:K,class:"dp__calendar_header_item",role:"gridcell"},[B.$slots["calendar-header"]?l.renderSlot(B.$slots,"calendar-header",{key:0,day:te,index:K}):l.createCommentVNode("",!0),B.$slots["calendar-header"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(te),1)],64))]))),128))]),Lb,l.createVNode(l.Transition,{name:w.value,css:!!B.transitions},{default:l.withCtx(()=>{var te;return[y.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__calendar",role:"rowgroup","aria-label":((te=l.unref(c))==null?void 0:te.calendarDays)||void 0},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(v.value,(K,ce)=>(l.openBlock(),l.createElementBlock("div",{key:ce,class:"dp__calendar_row",role:"row"},[B.weekNumbers?(l.openBlock(),l.createElementBlock("div",Fb,[l.createElementVNode("div",zb,l.toDisplayString(A(K.days)),1)])):l.createCommentVNode("",!0),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(K.days,(ae,U)=>{var Z,me,ne;return l.openBlock(),l.createElementBlock("div",{id:ae.value.toISOString().split("T")[0],ref_for:!0,ref:Me=>b(Me,ce,U),key:U+ce,role:"gridcell",class:"dp__calendar_item","aria-selected":ae.classData.dp__active_date||ae.classData.dp__range_start||ae.classData.dp__range_start,"aria-disabled":ae.classData.dp__cell_disabled||void 0,"aria-label":(me=(Z=l.unref(c))==null?void 0:Z.day)==null?void 0:me.call(Z,ae),tabindex:"0",onClick:l.withModifiers(Me=>$(Me,ae),["prevent"]),onKeydown:[l.withKeys(Me=>B.$emit("select-date",ae),["enter"]),l.withKeys(Me=>B.$emit("handle-space",ae),["space"])],onMouseenter:Me=>q(ae,ce,U),onMouseleave:Me=>L(ae)},[l.createElementVNode("div",{class:l.normalizeClass(["dp__cell_inner",ae.classData])},[B.$slots.day&&z.value(ae)?l.renderSlot(B.$slots,"day",{key:0,day:+ae.text,date:ae.value}):l.createCommentVNode("",!0),B.$slots.day?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(ae.text),1)],64)),ae.marker&&z.value(ae)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[B.$slots.marker?l.renderSlot(B.$slots,"marker",{key:0,marker:ae.marker,day:+ae.text,date:ae.value}):(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(P.value(ae.marker)),style:l.normalizeStyle(ae.marker.color?{backgroundColor:ae.marker.color}:{})},null,6))],64)):l.createCommentVNode("",!0),T.value(ae.value)?(l.openBlock(),l.createElementBlock("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:C,class:"dp__marker_tooltip",style:l.normalizeStyle(f.value)},[(ne=ae.marker)!=null&&ne.tooltip?(l.openBlock(),l.createElementBlock("div",{key:0,class:"dp__tooltip_content",onClick:F},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(ae.marker.tooltip,(Me,Xe)=>(l.openBlock(),l.createElementBlock("div",{key:Xe,class:"dp__tooltip_text"},[B.$slots["marker-tooltip"]?l.renderSlot(B.$slots,"marker-tooltip",{key:0,tooltip:Me,day:ae.value}):l.createCommentVNode("",!0),B.$slots["marker-tooltip"]?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createElementVNode("div",{class:"dp__tooltip_mark",style:l.normalizeStyle(Me.color?{backgroundColor:Me.color}:{})},null,4),l.createElementVNode("div",null,l.toDisplayString(Me.text),1)],64))]))),128)),l.createElementVNode("div",{class:"dp__arrow_bottom_tp",style:l.normalizeStyle(N.value)},null,4)])):l.createCommentVNode("",!0)],4)):l.createCommentVNode("",!0)],2)],40,Hb)}),128))]))),128))],8,$b)):l.createCommentVNode("",!0)]}),_:3},8,["name","css"])],64))],10,Ib)],2)}}}),zd=n=>Array.isArray(n),jb=(n,e,t,r)=>{const i=l.ref([]),{modelValue:o,calendars:a,time:s}=Ri(n,e),{defaultedMultiCalendars:c,defaultedStartTime:d}=We(n),{validateMonthYearInRange:u,isDisabled:p,isDateRangeAllowed:f,checkMinMaxRange:h}=br(n),{updateTimeValues:m,getSetDateTime:y,setTime:w,assignStartTime:x,validateTime:C,disabledTimesConfig:N}=Fd(n,s,o,r),v=l.computed(()=>I=>a.value[I]?a.value[I].month:0),O=l.computed(()=>I=>a.value[I]?a.value[I].year:0),k=(I,Q,fe)=>{var ke,Ve;a.value[I]||(a.value[I]={month:0,year:0}),a.value[I].month=xd(Q)?(ke=a.value[I])==null?void 0:ke.month:Q,a.value[I].year=xd(fe)?(Ve=a.value[I])==null?void 0:Ve.year:fe},E=()=>{n.autoApply&&e("select-date")};l.watch(o,(I,Q)=>{JSON.stringify(I)!==JSON.stringify(Q)&&T()}),l.onMounted(()=>{n.shadow||(o.value||(g(),d.value&&x(d.value)),T(!0),n.focusStartDate&&n.startDate&&g())});const W=l.computed(()=>{var I;return(I=n.flow)!=null&&I.length&&!n.partialFlow?n.flowStep===n.flow.length:!0}),P=()=>{n.autoApply&&W.value&&e("auto-apply",n.partialFlow)},T=(I=!1)=>{if(o.value)return Array.isArray(o.value)?(i.value=o.value,R(I)):z(o.value,I);if(c.value.count&&I&&!n.startDate)return _(G(),I)},_=(I,Q=!1)=>{if((!c.value.count||!c.value.static||Q)&&k(0,Se(I),we(I)),c.value.count&&(!c.value.solo||!o.value))for(let fe=1;fe<c.value.count;fe++){const ke=Ie(G(),{month:v.value(fe-1),year:O.value(fe-1)}),Ve=Dc(ke,{months:1});a.value[fe]={month:Se(Ve),year:we(Ve)}}},z=(I,Q)=>{_(I),w("hours",Gt(I)),w("minutes",dn(I)),w("seconds",Hr(I)),c.value.count&&Q&&b()},q=I=>{if(c.value.count){if(c.value.solo)return 0;const Q=Se(I[0]),fe=Se(I[1]);return Math.abs(fe-Q)<c.value.count?0:1}return 1},L=(I,Q)=>{I[1]&&n.showLastInRange?_(I[q(I)],Q):_(I[0],Q);const fe=(ke,Ve)=>[ke(I[0]),I[1]?ke(I[1]):s[Ve][1]];w("hours",fe(Gt,"hours")),w("minutes",fe(dn,"minutes")),w("seconds",fe(Hr,"seconds"))},S=(I,Q)=>{if((n.range||n.weekPicker)&&!n.multiDates)return L(I,Q);if(n.multiDates&&Q){const fe=I[I.length-1];return z(fe,Q)}},R=I=>{const Q=o.value;S(Q,I),c.value.count&&c.value.solo&&b()},V=(I,Q)=>{const fe=Ie(G(),{month:v.value(Q),year:O.value(Q)}),ke=I<0?Kt(fe,1):jr(fe,1);u(Se(ke),we(ke),I<0,n.preventMinMaxNavigation)&&(k(Q,Se(ke),we(ke)),e("update-month-year",{instance:Q,month:Se(ke),year:we(ke)}),c.value.count&&!c.value.solo&&j(Q),t())},j=I=>{for(let Q=I-1;Q>=0;Q--){const fe=jr(Ie(G(),{month:v.value(Q+1),year:O.value(Q+1)}),1);k(Q,Se(fe),we(fe))}for(let Q=I+1;Q<=c.value.count-1;Q++){const fe=Kt(Ie(G(),{month:v.value(Q-1),year:O.value(Q-1)}),1);k(Q,Se(fe),we(fe))}},b=()=>{if(Array.isArray(o.value)&&o.value.length===2){const I=G(G(o.value[1]?o.value[1]:Kt(o.value[0],1))),[Q,fe]=[Se(o.value[0]),we(o.value[0])],[ke,Ve]=[Se(o.value[1]),we(o.value[1])];(Q!==ke||Q===ke&&fe!==Ve)&&c.value.solo&&k(1,Se(I),we(I))}else o.value&&!Array.isArray(o.value)&&(k(0,Se(o.value),we(o.value)),_(G()))},g=()=>{n.startDate&&(k(0,Se(G(n.startDate)),we(G(n.startDate))),c.value.count&&j(0))},M=Cv((I,Q)=>{n.monthChangeOnScroll&&V(n.monthChangeOnScroll!=="inverse"?-I.deltaY:I.deltaY,Q)},50),A=(I,Q,fe=!1)=>{n.monthChangeOnArrows&&n.vertical===fe&&$(I,Q)},$=(I,Q)=>{V(I==="right"?-1:1,Q)},F=I=>n.markers.find(Q=>Ne(Sv(I.value),Qt(G(Q.date),n.timezone))),B=(I,Q)=>{switch(n.sixWeeks===!0?"append":n.sixWeeks){case"prepend":return[!0,!1];case"center":return[I==0,!0];case"fair":return[I==0||Q>I,!0];case"append":return[!1,!1];default:return[!1,!1]}},D=(I,Q,fe,ke)=>{if(n.sixWeeks&&I.length<6){const Ve=6-I.length,qt=(Q.getDay()+7-ke)%7,Y=6-(fe.getDay()+7-ke)%7,[H,X]=B(qt,Y);for(let re=1;re<=Ve;re++)if(X?!!(re%2)==H:H){const ge=I[0].days[0],Le=ee(Dn(ge.value,-7),Se(Q));I.unshift({days:Le})}else{const ge=I[I.length-1],Le=ge.days[ge.days.length-1],gt=ee(Dn(Le.value,1),Se(Q));I.push({days:gt})}}return I},ee=(I,Q)=>{const fe=G(I),ke=[];for(let Ve=0;Ve<7;Ve++){const qt=Dn(fe,Ve),Y=Se(qt)!==Q;ke.push({text:n.hideOffsetDates&&Y?"":qt.getDate(),value:qt,current:!Y,classData:{}})}return ke},te=(I,Q)=>{const fe=[],ke=new Date(Q,I),Ve=new Date(Q,I+1,0),qt=n.weekStart,Y=fr(ke,{weekStartsOn:qt}),H=X=>{const re=ee(X,I);if(fe.push({days:re}),!fe[fe.length-1].days.some(ge=>Ne(dt(ge.value),dt(Ve)))){const ge=Dn(X,7);H(ge)}};return H(Y),D(fe,ke,Ve,qt)},K=I=>(o.value=Eo(G(I.value),n.timezone,n.weekStart),e("date-update",I.value),P()),ce=I=>{const Q=zn(G(I.value),s.hours,s.minutes,sn());e("date-update",Q),n.multiDates?Ts(Q,o,n.multiDatesLimit):o.value=Q,r(),l.nextTick().then(()=>{P()})},ae=I=>n.noDisabledRange?Dd(i.value[0],I).some(Q=>p(Q)):!1,U=()=>{i.value=o.value?o.value.slice():[],i.value.length===2&&!(n.fixedStart||n.fixedEnd)&&(i.value=[])},Z=(I,Q)=>{const fe=[G(I.value),Dn(G(I.value),+n.autoRange)];f(fe)?(Q&&me(I.value),i.value=fe):e("invalid-date",I.value)},me=I=>{const Q=Se(G(I)),fe=we(G(I));if(k(0,Q,fe),c.value.count>0)for(let ke=1;ke<c.value.count;ke++){const Ve=Dv(Ie(G(I),{year:v.value(ke-1),month:O.value(ke-1)}));k(ke,Ve.month,Ve.year)}},ne=I=>Array.isArray(o.value)&&o.value.length===2?n.fixedStart&&(ut(I,o.value[0])||Ne(I,o.value[0]))?[o.value[0],I]:n.fixedEnd&&(ot(I,o.value[1])||Ne(I,o.value[1]))?[I,o.value[1]]:(e("invalid-fixed-range",I),o.value):[],Me=I=>{if(ae(I.value)||!h(I.value,o.value,n.fixedStart?0:1))return e("invalid-date",I.value);i.value=ne(G(I.value))},Xe=(I,Q)=>{if(U(),n.autoRange)return Z(I,Q);if(n.fixedStart||n.fixedEnd)return Me(I);i.value[0]?h(G(I.value),o.value)&&!ae(I.value)?ot(G(I.value),G(i.value[0]))?(i.value.unshift(G(I.value)),e("range-end",i.value[0])):(i.value[1]=G(I.value),e("range-end",i.value[1])):(n.autoApply&&e("auto-apply-invalid",I.value),e("invalid-date",I.value)):(i.value[0]=G(I.value),e("range-start",i.value[0]))},sn=(I=!0)=>n.enableSeconds?Array.isArray(s.seconds)?I?s.seconds[0]:s.seconds[1]:s.seconds:0,It=I=>{i.value[I]=zn(i.value[I],s.hours[I],s.minutes[I],sn(I!==1))},Et=()=>{var I,Q;i.value[0]&&i.value[1]&&+((I=i.value)==null?void 0:I[0])>+((Q=i.value)==null?void 0:Q[1])&&(i.value.reverse(),e("range-start",i.value[0]),e("range-end",i.value[1]))},Rt=()=>{i.value.length&&(i.value[0]&&!i.value[1]?It(0):(It(0),It(1),r()),Et(),o.value=i.value.slice(),Io(i.value,e,n.autoApply,n.modelAuto))},In=(I,Q=!1)=>{if(p(I.value)||!I.current&&n.hideOffsetDates)return e("invalid-date",I.value);if(n.weekPicker)return K(I);if(!n.range)return ce(I);zd(s.hours)&&zd(s.minutes)&&!n.multiDates&&(Xe(I,Q),Rt())},Vt=(I,Q)=>{var fe;k(I,Q.month,Q.year),c.value.count&&!c.value.solo&&j(I),e("update-month-year",{instance:I,month:Q.month,year:Q.year}),t(c.value.solo?I:void 0);const ke=(fe=n.flow)!=null&&fe.length?n.flow[n.flowStep]:void 0;!Q.fromNav&&(ke===hn.month||ke===hn.year)&&r()},it=(I,Q)=>{Vd({value:I,modelValue:o,range:n.range,timezone:Q?void 0:n.timezone}),E(),n.multiCalendars&&l.nextTick().then(()=>T(!0))},dr=()=>{n.range?o.value&&Array.isArray(o.value)&&o.value[0]?o.value=ot(G(),o.value[0])?[G(),o.value[0]]:[o.value[0],G()]:o.value=[G()]:o.value=G(),E()},ur=()=>{if(Array.isArray(o.value))if(n.multiDates){const I=Rn();o.value[o.value.length-1]=y(I)}else o.value=o.value.map((I,Q)=>I&&y(I,Q));else o.value=y(o.value);e("time-update")},Rn=()=>Array.isArray(o.value)&&o.value.length?o.value[o.value.length-1]:null;return{calendars:a,modelValue:o,month:v,year:O,time:s,disabledTimesConfig:N,validateTime:C,getCalendarDays:te,getMarker:F,handleScroll:M,handleSwipe:$,handleArrow:A,selectDate:In,updateMonthYear:Vt,presetDate:it,selectCurrentDate:dr,updateTime:(I,Q=!0,fe=!1)=>{m(I,Q,fe,ur)}}},Ub={key:0},Wb=l.defineComponent({__name:"DatePicker",props:{...Zt},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date"],setup(n,{expose:e,emit:t}){const r=t,i=n,{calendars:o,month:a,year:s,modelValue:c,time:d,disabledTimesConfig:u,validateTime:p,getCalendarDays:f,getMarker:h,handleArrow:m,handleScroll:y,handleSwipe:w,selectDate:x,updateMonthYear:C,presetDate:N,selectCurrentDate:v,updateTime:O}=jb(i,r,b,g),k=l.useSlots(),{setHoverDate:E,getDayClassData:W,clearHoverDate:P}=Kv(c,i),{defaultedMultiCalendars:T}=We(i),_=l.ref([]),z=l.ref([]),q=l.ref(null),L=Nt(k,"calendar"),S=Nt(k,"monthYear"),R=Nt(k,"timePicker"),V=A=>{i.shadow||r("mount",A)};l.watch(o,()=>{i.shadow||setTimeout(()=>{r("recalculate-position")},0)},{deep:!0});const j=l.computed(()=>A=>f(a.value(A),s.value(A)).map($=>({...$,days:$.days.map(F=>(F.marker=h(F),F.classData=W(F),F))})));function b(A){var $;A||A===0?($=z.value[A])==null||$.triggerTransition(a.value(A),s.value(A)):z.value.forEach((F,B)=>F.triggerTransition(a.value(B),s.value(B)))}function g(){r("update-flow-step")}const M=(A,$=!1)=>{x(A,$),i.spaceConfirm&&r("select-date")};return e({clearHoverDate:P,presetDate:N,selectCurrentDate:v,toggleMonthPicker:(A,$,F=0)=>{var B;(B=_.value[F])==null||B.toggleMonthPicker(A,$)},toggleYearPicker:(A,$,F=0)=>{var B;(B=_.value[F])==null||B.toggleYearPicker(A,$)},toggleTimePicker:(A,$,F)=>{var B;(B=q.value)==null||B.toggleTimePicker(A,$,F)},handleArrow:m,updateMonthYear:C,getSidebarProps:()=>({modelValue:c,month:a,year:s,time:d,updateTime:O,updateMonthYear:C,selectDate:x,presetDate:N})}),(A,$)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(Po,{"multi-calendars":l.unref(T).count},{default:l.withCtx(({instance:F,index:B})=>[A.disableMonthYearSelect?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(Pb,l.mergeProps({key:0,ref:D=>{D&&(_.value[B]=D)},months:l.unref(bd)(A.formatLocale,A.locale,A.monthNameFormat),years:l.unref(fs)(A.yearRange,A.reverseYears),month:l.unref(a)(F),year:l.unref(s)(F),instance:F},A.$props,{onMount:$[0]||($[0]=D=>V(l.unref(vr).header)),onResetFlow:$[1]||($[1]=D=>A.$emit("reset-flow")),onUpdateMonthYear:D=>l.unref(C)(F,D),onOverlayClosed:$[2]||($[2]=D=>A.$emit("focus-menu"))}),l.createSlots({_:2},[l.renderList(l.unref(S),(D,ee)=>({name:D,fn:l.withCtx(te=>[l.renderSlot(A.$slots,D,l.normalizeProps(l.guardReactiveProps(te)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),l.createVNode(Yb,l.mergeProps({ref:D=>{D&&(z.value[B]=D)},"mapped-dates":j.value(F),month:l.unref(a)(F),year:l.unref(s)(F),instance:F},A.$props,{onSelectDate:D=>l.unref(x)(D,F!==1),onHandleSpace:D=>M(D,F!==1),onSetHoverDate:$[3]||($[3]=D=>l.unref(E)(D)),onHandleScroll:D=>l.unref(y)(D,F),onHandleSwipe:D=>l.unref(w)(D,F),onMount:$[4]||($[4]=D=>V(l.unref(vr).calendar)),onResetFlow:$[5]||($[5]=D=>A.$emit("reset-flow")),onTooltipOpen:$[6]||($[6]=D=>A.$emit("tooltip-open",D)),onTooltipClose:$[7]||($[7]=D=>A.$emit("tooltip-close",D))}),l.createSlots({_:2},[l.renderList(l.unref(L),(D,ee)=>({name:D,fn:l.withCtx(te=>[l.renderSlot(A.$slots,D,l.normalizeProps(l.guardReactiveProps({...te})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars"]),A.enableTimePicker?(l.openBlock(),l.createElementBlock("div",Ub,[A.$slots["time-picker"]?l.renderSlot(A.$slots,"time-picker",l.normalizeProps(l.mergeProps({key:0},{time:l.unref(d),updateTime:l.unref(O)}))):(l.openBlock(),l.createBlock($d,l.mergeProps({key:1,ref_key:"timePickerRef",ref:q},A.$props,{hours:l.unref(d).hours,minutes:l.unref(d).minutes,seconds:l.unref(d).seconds,"internal-model-value":A.internalModelValue,"disabled-times-config":l.unref(u),"validate-time":l.unref(p),onMount:$[8]||($[8]=F=>V(l.unref(vr).timePicker)),"onUpdate:hours":$[9]||($[9]=F=>l.unref(O)(F)),"onUpdate:minutes":$[10]||($[10]=F=>l.unref(O)(F,!1)),"onUpdate:seconds":$[11]||($[11]=F=>l.unref(O)(F,!1,!0)),onResetFlow:$[12]||($[12]=F=>A.$emit("reset-flow")),onOverlayClosed:$[13]||($[13]=F=>A.$emit("time-picker-close")),onOverlayOpened:$[14]||($[14]=F=>A.$emit("time-picker-open",F)),onAmPmChange:$[15]||($[15]=F=>A.$emit("am-pm-change",F))}),l.createSlots({_:2},[l.renderList(l.unref(R),(F,B)=>({name:F,fn:l.withCtx(D=>[l.renderSlot(A.$slots,F,l.normalizeProps(l.guardReactiveProps(D)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):l.createCommentVNode("",!0)],64))}}),qb=(n,e)=>{const t=l.ref(),{defaultedMultiCalendars:r,defaultedConfig:i,defaultedHighlight:o}=We(n),{modelValue:a,year:s,month:c,calendars:d}=Ri(n,e),{isDisabled:u}=br(n),{selectYear:p,groupedYears:f,showYearPicker:h,isDisabled:m,toggleYearPicker:y,handleYearSelect:w,handleYear:x}=Ld({modelValue:a,multiCalendars:r,highlight:o,calendars:d,month:c,year:s,props:n,emit:e}),C=(P,T)=>[P,T].map(_=>$n(_,"MMMM",{locale:n.formatLocale})).join("-"),N=l.computed(()=>P=>a.value?Array.isArray(a.value)?a.value.some(T=>ed(P,T)):ed(a.value,P):!1),v=P=>{if(n.range){if(Array.isArray(a.value)){const T=Ne(P,a.value[0])||Ne(P,a.value[1]);return Ao(a.value,t.value,P)&&!T}return!1}return!1},O=l.computed(()=>P=>{const T=Ie(new Date,{year:s.value(P)});return yg({start:bg(T),end:vg(T)}).map(_=>{const z=Di(_),q=_c(_),L=u(_),S=v(z),R=typeof o.value=="function"?o.value({quarter:Nc(z),year:we(z)}):!!o.value.quarters.find(V=>V.quarter===Nc(z)&&V.year===we(z));return{text:C(z,q),value:z,active:N.value(z),highlighted:R,disabled:L,isBetween:S}})}),k=P=>{Ts(P,a,n.multiDatesLimit),e("auto-apply",!0)},E=P=>{const T=Ms(a,P,e);Io(T,e,n.autoApply,n.modelAuto)},W=P=>{a.value=P,e("auto-apply")};return{defaultedConfig:i,defaultedMultiCalendars:r,groupedYears:f,year:s,isDisabled:m,quarters:O,showYearPicker:h,modelValue:a,setHoverDate:P=>{t.value=P},selectYear:p,selectQuarter:(P,T,_)=>{if(!_)return d.value[T].month=Se(_c(P)),n.multiDates?k(P):n.range?E(P):W(P)},toggleYearPicker:y,handleYearSelect:w,handleYear:x}},Kb={class:"dp--quarter-items"},Gb=["disabled","onClick","onMouseover"],Jb=l.defineComponent({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...Zt},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end"],setup(n,{expose:e,emit:t}){const r=t,i=n,o=l.useSlots(),a=Nt(o,"yearMode"),{defaultedMultiCalendars:s,defaultedConfig:c,groupedYears:d,year:u,isDisabled:p,quarters:f,modelValue:h,showYearPicker:m,setHoverDate:y,selectQuarter:w,toggleYearPicker:x,handleYearSelect:C,handleYear:N}=qb(i,r);return e({getSidebarProps:()=>({modelValue:h,year:u,selectQuarter:w,handleYearSelect:C,handleYear:N})}),(v,O)=>(l.openBlock(),l.createBlock(Po,{"multi-calendars":l.unref(s).count,stretch:""},{default:l.withCtx(({instance:k})=>[l.createElementVNode("div",{class:"dp-quarter-picker-wrap",style:l.normalizeStyle({minHeight:`${l.unref(c).modeHeight}px`})},[l.createElementVNode("div",null,[l.createVNode(Rd,l.mergeProps(v.$props,{items:l.unref(d)(k),instance:k,"show-year-picker":l.unref(m)[k],year:l.unref(u)(k),"is-disabled":E=>l.unref(p)(k,E),onHandleYear:E=>l.unref(N)(k,E),onYearSelect:E=>l.unref(C)(E,k),onToggleYearPicker:E=>l.unref(x)(k,E==null?void 0:E.flow,E==null?void 0:E.show)}),l.createSlots({_:2},[l.renderList(l.unref(a),(E,W)=>({name:E,fn:l.withCtx(P=>[l.renderSlot(v.$slots,E,l.normalizeProps(l.guardReactiveProps(P)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),l.createElementVNode("div",Kb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(l.unref(f)(k),(E,W)=>(l.openBlock(),l.createElementBlock("div",{key:W},[l.createElementVNode("button",{type:"button",class:l.normalizeClass(["dp--qr-btn",{"dp--qr-btn-active":E.active,"dp--qr-btn-between":E.isBetween,"dp--qr-btn-disabled":E.disabled,"dp--highlighted":E.highlighted}]),disabled:E.disabled,onClick:P=>l.unref(w)(E.value,k,E.disabled),onMouseover:P=>l.unref(y)(E.value)},[v.$slots.quarter?l.renderSlot(v.$slots,"quarter",{key:0,value:E.value,text:E.text}):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(E.text),1)],64))],42,Gb)]))),128))])],4)]),_:3},8,["multi-calendars"]))}}),Qb=["id"],Xb={key:0,class:"dp__sidebar_left"},Zb={key:1,class:"dp--preset-dates"},ew=["onClick","onKeydown"],tw={key:2,class:"dp__sidebar_right"},nw={key:3,class:"dp__action_extra"},Hd=l.defineComponent({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{...Bo,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},arrMapValues:{type:Object,default:()=>({})},noOverlayFocus:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date"],setup(n,{expose:e,emit:t}){const r=t,i=n,o=l.computed(()=>{const{openOnTop:U,...Z}=i;return{...Z,flowStep:W.value,noOverlayFocus:i.noOverlayFocus}}),{setMenuFocused:a,setShiftKey:s,control:c}=Bd(),d=l.useSlots(),{defaultedTextInput:u,defaultedInline:p,defaultedConfig:f}=We(i),h=l.ref(null),m=l.ref(0),y=l.ref(null),w=l.ref(null),x=l.ref(!1),C=l.ref(null);l.onMounted(()=>{if(!i.shadow){x.value=!0,N(),window.addEventListener("resize",N);const U=Je(y);if(U&&!u.value.enabled&&!p.value.enabled&&(a(!0),q()),U){const Z=me=>{f.value.allowPreventDefault&&me.preventDefault(),Fn(me,f.value,!0)};U.addEventListener("pointerdown",Z),U.addEventListener("mousedown",Z)}}}),l.onUnmounted(()=>{window.removeEventListener("resize",N)});const N=()=>{const U=Je(w);U&&(m.value=U.getBoundingClientRect().width)},{arrowRight:v,arrowLeft:O,arrowDown:k,arrowUp:E}=Yn(),{flowStep:W,updateFlowStep:P,childMount:T,resetFlow:_}=Gv(i,r,C),z=l.computed(()=>i.monthPicker?pb:i.yearPicker?hb:i.timePicker?Ob:i.quarterPicker?Jb:Wb),q=()=>{const U=Je(y);U&&U.focus({preventScroll:!0})},L=l.computed(()=>{var U;return((U=C.value)==null?void 0:U.getSidebarProps())||{}}),S=()=>{i.openOnTop&&r("recalculate-position")},R=Nt(d,"action"),V=l.computed(()=>i.monthPicker||i.yearPicker?Nt(d,"monthYear"):i.timePicker?Nt(d,"timePicker"):Nt(d,"shared")),j=l.computed(()=>i.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),b=l.computed(()=>({dp__menu_disabled:i.disabled,dp__menu_readonly:i.readonly})),g=l.computed(()=>({dp__menu:!0,dp__menu_index:!p.value.enabled,dp__relative:p.value.enabled,[i.menuClassName]:!!i.menuClassName})),M=U=>{Fn(U,f.value,!0)},A=()=>{i.escClose&&r("close-picker")},$=U=>{if(i.arrowNavigation){if(U==="up")return E();if(U==="down")return k();if(U==="left")return O();if(U==="right")return v()}else U==="left"||U==="up"?te("handleArrow","left",0,U==="up"):te("handleArrow","right",0,U==="down")},F=U=>{s(U.shiftKey),!i.disableMonthYearSelect&&U.code==="Tab"&&U.target.classList.contains("dp__menu")&&c.value.shiftKeyInMenu&&(U.preventDefault(),Fn(U,f.value,!0),r("close-picker"))},B=()=>{q(),r("time-picker-close")},D=U=>{var Z,me,ne;(Z=C.value)==null||Z.toggleTimePicker(!1,!1),(me=C.value)==null||me.toggleMonthPicker(!1,!1,U),(ne=C.value)==null||ne.toggleYearPicker(!1,!1,U)},ee=(U,Z=0)=>{var me,ne,Me;return U==="month"?(me=C.value)==null?void 0:me.toggleMonthPicker(!1,!0,Z):U==="year"?(ne=C.value)==null?void 0:ne.toggleYearPicker(!1,!0,Z):U==="time"?(Me=C.value)==null?void 0:Me.toggleTimePicker(!0,!1):D(Z)},te=(U,...Z)=>{var me,ne;(me=C.value)!=null&&me[U]&&((ne=C.value)==null||ne[U](...Z))},K=()=>{te("selectCurrentDate")},ce=(U,Z)=>{te("presetDate",U,Z)},ae=()=>{te("clearHoverDate")};return e({updateMonthYear:(U,Z)=>{te("updateMonthYear",U,Z)},switchView:ee}),(U,Z)=>{var me;return l.openBlock(),l.createElementBlock("div",{id:U.uid?`dp-menu-${U.uid}`:void 0,ref_key:"dpMenuRef",ref:y,tabindex:"0",role:"dialog",class:l.normalizeClass(g.value),onMouseleave:ae,onClick:M,onKeydown:[l.withKeys(A,["esc"]),Z[18]||(Z[18]=l.withKeys(l.withModifiers(ne=>$("left"),["prevent"]),["left"])),Z[19]||(Z[19]=l.withKeys(l.withModifiers(ne=>$("up"),["prevent"]),["up"])),Z[20]||(Z[20]=l.withKeys(l.withModifiers(ne=>$("down"),["prevent"]),["down"])),Z[21]||(Z[21]=l.withKeys(l.withModifiers(ne=>$("right"),["prevent"]),["right"])),F]},[(U.disabled||U.readonly)&&l.unref(p).enabled?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(b.value)},null,2)):l.createCommentVNode("",!0),!l.unref(p).enabled&&!U.teleportCenter?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(j.value)},null,2)):l.createCommentVNode("",!0),l.createElementVNode("div",{ref_key:"innerMenuRef",ref:w,class:l.normalizeClass({dp__menu_content_wrapper:((me=U.presetDates)==null?void 0:me.length)||!!U.$slots["left-sidebar"]||!!U.$slots["right-sidebar"]}),style:l.normalizeStyle({"--dp-menu-width":`${m.value}px`})},[U.$slots["left-sidebar"]?(l.openBlock(),l.createElementBlock("div",Xb,[l.renderSlot(U.$slots,"left-sidebar",l.normalizeProps(l.guardReactiveProps(L.value)))])):l.createCommentVNode("",!0),U.presetDates.length?(l.openBlock(),l.createElementBlock("div",Zb,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(U.presetDates,(ne,Me)=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:Me},[ne.slot?l.renderSlot(U.$slots,ne.slot,{key:0,presetDate:ce,label:ne.label,value:ne.value}):(l.openBlock(),l.createElementBlock("button",{key:1,type:"button",style:l.normalizeStyle(ne.style||{}),class:"dp__btn dp--preset-range",onClick:l.withModifiers(Xe=>ce(ne.value,ne.noTz),["prevent"]),onKeydown:[l.withKeys(l.withModifiers(Xe=>ce(ne.value,ne.noTz),["prevent"]),["enter"]),l.withKeys(l.withModifiers(Xe=>ce(ne.value,ne.noTz),["prevent"]),["space"])]},l.toDisplayString(ne.label),45,ew))],64))),128))])):l.createCommentVNode("",!0),l.createElementVNode("div",{ref_key:"calendarWrapperRef",ref:h,class:"dp__instance_calendar",role:"document"},[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(z.value),l.mergeProps({ref_key:"dynCmpRef",ref:C},o.value,{"flow-step":l.unref(W),onMount:l.unref(T),onUpdateFlowStep:l.unref(P),onResetFlow:l.unref(_),onFocusMenu:q,onSelectDate:Z[0]||(Z[0]=ne=>U.$emit("select-date")),onDateUpdate:Z[1]||(Z[1]=ne=>U.$emit("date-update",ne)),onTooltipOpen:Z[2]||(Z[2]=ne=>U.$emit("tooltip-open",ne)),onTooltipClose:Z[3]||(Z[3]=ne=>U.$emit("tooltip-close",ne)),onAutoApply:Z[4]||(Z[4]=ne=>U.$emit("auto-apply",ne)),onRangeStart:Z[5]||(Z[5]=ne=>U.$emit("range-start",ne)),onRangeEnd:Z[6]||(Z[6]=ne=>U.$emit("range-end",ne)),onInvalidFixedRange:Z[7]||(Z[7]=ne=>U.$emit("invalid-fixed-range",ne)),onTimeUpdate:Z[8]||(Z[8]=ne=>U.$emit("time-update")),onAmPmChange:Z[9]||(Z[9]=ne=>U.$emit("am-pm-change",ne)),onTimePickerOpen:Z[10]||(Z[10]=ne=>U.$emit("time-picker-open",ne)),onTimePickerClose:B,onRecalculatePosition:S,onUpdateMonthYear:Z[11]||(Z[11]=ne=>U.$emit("update-month-year",ne)),onAutoApplyInvalid:Z[12]||(Z[12]=ne=>U.$emit("auto-apply-invalid",ne)),onInvalidDate:Z[13]||(Z[13]=ne=>U.$emit("invalid-date",ne)),"onUpdate:internalModelValue":Z[14]||(Z[14]=ne=>U.$emit("update:internal-model-value",ne))}),l.createSlots({_:2},[l.renderList(V.value,(ne,Me)=>({name:ne,fn:l.withCtx(Xe=>[l.renderSlot(U.$slots,ne,l.normalizeProps(l.guardReactiveProps({...Xe})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),U.$slots["right-sidebar"]?(l.openBlock(),l.createElementBlock("div",tw,[l.renderSlot(U.$slots,"right-sidebar",l.normalizeProps(l.guardReactiveProps(L.value)))])):l.createCommentVNode("",!0),U.$slots["action-extra"]?(l.openBlock(),l.createElementBlock("div",nw,[U.$slots["action-extra"]?l.renderSlot(U.$slots,"action-extra",{key:0,selectCurrentDate:K}):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],6),!U.autoApply||l.unref(f).keepActionRow?(l.openBlock(),l.createBlock(rb,l.mergeProps({key:2,"menu-mount":x.value},o.value,{"calendar-width":m.value,onClosePicker:Z[15]||(Z[15]=ne=>U.$emit("close-picker")),onSelectDate:Z[16]||(Z[16]=ne=>U.$emit("select-date")),onInvalidSelect:Z[17]||(Z[17]=ne=>U.$emit("invalid-select")),onSelectNow:K}),l.createSlots({_:2},[l.renderList(l.unref(R),(ne,Me)=>({name:ne,fn:l.withCtx(Xe=>[l.renderSlot(U.$slots,ne,l.normalizeProps(l.guardReactiveProps({...Xe})))])}))]),1040,["menu-mount","calendar-width"])):l.createCommentVNode("",!0)],42,Qb)}}}),rw=typeof window<"u"?window:void 0,Ss=()=>{},iw=n=>l.getCurrentScope()?(l.onScopeDispose(n),!0):!1,ow=(n,e,t,r)=>{if(!n)return Ss;let i=Ss;const o=l.watch(()=>l.unref(n),s=>{i(),s&&(s.addEventListener(e,t,r),i=()=>{s.removeEventListener(e,t,r),i=Ss})},{immediate:!0,flush:"post"}),a=()=>{o(),i()};return iw(a),a},aw=(n,e,t,r={})=>{const{window:i=rw,event:o="pointerdown"}=r;return i?ow(i,o,a=>{const s=Je(n),c=Je(e);!s||!c||s===a.target||a.composedPath().includes(s)||a.composedPath().includes(c)||t(a)},{passive:!0}):void 0},sw=l.defineComponent({compatConfig:{MODE:3},__name:"VueDatePicker",props:{...Bo},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date"],setup(n,{expose:e,emit:t}){const r=t,i=n,o=l.useSlots(),a=l.ref(!1),s=l.toRef(i,"modelValue"),c=l.toRef(i,"timezone"),d=l.ref(null),u=l.ref(null),p=l.ref(null),f=l.ref(!1),h=l.ref(null),m=l.ref(!1),y=l.ref(!1),{setMenuFocused:w,setShiftKey:x}=Bd(),{clearArrowNav:C}=Yn(),{mapDatesArrToMap:N,validateDate:v,isValidTime:O}=br(i),{defaultedTransitions:k,defaultedTextInput:E,defaultedInline:W,defaultedConfig:P}=We(i),{menuTransition:T,showTransition:_}=Ii(k);l.onMounted(()=>{$(i.modelValue),l.nextTick().then(()=>{if(!W.value.enabled){const H=b(h.value);H==null||H.addEventListener("scroll",U),window==null||window.addEventListener("resize",Z)}}),W.value.enabled&&(a.value=!0),window==null||window.addEventListener("keyup",me),window==null||window.addEventListener("keydown",ne)});const z=l.computed(()=>N());l.onUnmounted(()=>{if(!W.value.enabled){const H=b(h.value);H==null||H.removeEventListener("scroll",U),window==null||window.removeEventListener("resize",Z)}window==null||window.removeEventListener("keyup",me),window==null||window.removeEventListener("keydown",ne)});const q=Nt(o,"all",i.presetDates),L=Nt(o,"input");l.watch([s,c],()=>{$(s.value)},{deep:!0});const{openOnTop:S,menuStyle:R,xCorrect:V,setMenuPosition:j,getScrollableParent:b,shadowRender:g}=Uv({menuRef:d,menuRefInner:u,inputRef:p,pickerWrapperRef:h,inline:W,emit:r,props:i,slots:o}),{inputValue:M,internalModelValue:A,parseExternalModelValue:$,emitModelValue:F,formatInputValue:B,checkBeforeEmit:D}=Yv(r,i,f),ee=l.computed(()=>({dp__main:!0,dp__theme_dark:i.dark,dp__theme_light:!i.dark,dp__flex_display:W.value.enabled,dp__flex_display_with_input:W.value.input})),te=l.computed(()=>i.dark?"dp__theme_dark":"dp__theme_light"),K=l.computed(()=>({to:typeof i.teleport=="boolean"?"body":i.teleport,disabled:!i.teleport||W.value.enabled})),ce=l.computed(()=>({class:"dp__outer_menu_wrap"})),ae=l.computed(()=>W.value.enabled&&(i.timePicker||i.monthPicker||i.yearPicker||i.quarterPicker)),U=()=>{a.value&&(P.value.closeOnScroll?it():j())},Z=()=>{a.value&&j()},me=H=>{H.key==="Tab"&&!W.value.enabled&&!i.teleport&&P.value.tabOutClosesMenu&&(h.value.contains(document.activeElement)||it()),y.value=H.shiftKey},ne=H=>{y.value=H.shiftKey},Me=()=>{!i.disabled&&!i.readonly&&(g(Hd,i),j(!1),a.value=!0,a.value&&r("open"),a.value||Vt(),$(i.modelValue))},Xe=()=>{var H;M.value="",Vt(),(H=p.value)==null||H.setParsedDate(null),r("update:model-value",null),r("update:model-timezone-value",null),r("cleared"),P.value.closeOnClearValue&&it()},sn=()=>{const H=A.value;return!H||!Array.isArray(H)&&v(H)?!0:Array.isArray(H)?i.multiDates||H.length===2&&v(H[0])&&v(H[1])?!0:i.partialRange&&!i.timePicker?v(H[0]):!1:!1},It=()=>{D()&&sn()?(F(),it()):r("invalid-select",A.value)},Et=H=>{Rt(),F(),P.value.closeOnAutoApply&&!H&&it()},Rt=()=>{p.value&&E.value.enabled&&p.value.setParsedDate(A.value)},In=(H=!1)=>{i.autoApply&&O(A.value)&&sn()&&(i.range&&Array.isArray(A.value)?(i.partialRange||A.value.length===2)&&Et(H):Et(H))},Vt=()=>{E.value.enabled||(A.value=null)},it=()=>{W.value.enabled||(a.value&&(a.value=!1,V.value=!1,w(!1),x(!1),C(),r("closed"),M.value&&$(s.value)),Vt(),r("blur"))},dr=(H,X,re=!1)=>{if(!H){A.value=null;return}const ge=Array.isArray(H)?!H.some(gt=>!v(gt)):v(H),Le=O(H);ge&&Le&&(A.value=H,X&&(m.value=re,It(),r("text-submit")))},ur=()=>{i.autoApply&&O(A.value)&&F(),Rt()},Rn=()=>a.value?it():Me(),I=H=>{A.value=H},Q=()=>{E.value.enabled&&(f.value=!0,B()),r("focus")},fe=()=>{if(E.value.enabled&&(f.value=!1,$(i.modelValue),m.value)){const H=xv(h.value,y.value);H==null||H.focus()}r("blur")},ke=H=>{u.value&&u.value.updateMonthYear(0,{month:kd(H.month),year:kd(H.year)})},Ve=H=>{$(H??i.modelValue)},qt=(H,X)=>{var re;(re=u.value)==null||re.switchView(H,X)},Y=H=>P.value.onClickOutside?P.value.onClickOutside(H):it();return aw(d,p,()=>Y(sn)),e({closeMenu:it,selectDate:It,clearValue:Xe,openMenu:Me,onScroll:U,formatInputValue:B,updateInternalModelValue:I,setMonthYear:ke,parseModel:Ve,switchView:qt,toggleMenu:Rn}),(H,X)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"pickerWrapperRef",ref:h,class:l.normalizeClass(ee.value),"data-datepicker-instance":""},[l.createVNode(Zv,l.mergeProps({ref_key:"inputRef",ref:p,"input-value":l.unref(M),"onUpdate:inputValue":X[0]||(X[0]=re=>l.isRef(M)?M.value=re:null),"is-menu-open":a.value},H.$props,{onClear:Xe,onOpen:Me,onSetInputDate:dr,onSetEmptyDate:l.unref(F),onSelectDate:It,onToggle:Rn,onClose:it,onFocus:Q,onBlur:fe,onRealBlur:X[1]||(X[1]=re=>f.value=!1)}),l.createSlots({_:2},[l.renderList(l.unref(L),(re,ge)=>({name:re,fn:l.withCtx(Le=>[l.renderSlot(H.$slots,re,l.normalizeProps(l.guardReactiveProps(Le)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),l.createVNode(l.Teleport,l.normalizeProps(l.guardReactiveProps(K.value)),{default:l.withCtx(()=>[l.createVNode(l.Transition,{name:l.unref(T)(l.unref(S)),css:l.unref(_)&&!l.unref(W).enabled},{default:l.withCtx(()=>[a.value?(l.openBlock(),l.createElementBlock("div",l.mergeProps({key:0,ref_key:"dpWrapMenuRef",ref:d},ce.value,{class:{"dp--menu-wrapper":!l.unref(W).enabled},style:l.unref(W).enabled?void 0:l.unref(R)}),[l.createVNode(Hd,l.mergeProps({ref_key:"dpMenuRef",ref:u},H.$props,{"internal-model-value":l.unref(A),"onUpdate:internalModelValue":X[2]||(X[2]=re=>l.isRef(A)?A.value=re:null),class:{[te.value]:!0,"dp--menu-wrapper":H.teleport},"open-on-top":l.unref(S),"arr-map-values":z.value,"no-overlay-focus":ae.value,onClosePicker:it,onSelectDate:It,onAutoApply:In,onTimeUpdate:ur,onFlowStep:X[3]||(X[3]=re=>H.$emit("flow-step",re)),onUpdateMonthYear:X[4]||(X[4]=re=>H.$emit("update-month-year",re)),onInvalidSelect:X[5]||(X[5]=re=>H.$emit("invalid-select",l.unref(A))),onAutoApplyInvalid:X[6]||(X[6]=re=>H.$emit("invalid-select",re)),onInvalidFixedRange:X[7]||(X[7]=re=>H.$emit("invalid-fixed-range",re)),onRecalculatePosition:l.unref(j),onTooltipOpen:X[8]||(X[8]=re=>H.$emit("tooltip-open",re)),onTooltipClose:X[9]||(X[9]=re=>H.$emit("tooltip-close",re)),onTimePickerOpen:X[10]||(X[10]=re=>H.$emit("time-picker-open",re)),onTimePickerClose:X[11]||(X[11]=re=>H.$emit("time-picker-close",re)),onAmPmChange:X[12]||(X[12]=re=>H.$emit("am-pm-change",re)),onRangeStart:X[13]||(X[13]=re=>H.$emit("range-start",re)),onRangeEnd:X[14]||(X[14]=re=>H.$emit("range-end",re)),onDateUpdate:X[15]||(X[15]=re=>H.$emit("date-update",re)),onInvalidDate:X[16]||(X[16]=re=>H.$emit("invalid-date",re))}),l.createSlots({_:2},[l.renderList(l.unref(q),(re,ge)=>({name:re,fn:l.withCtx(Le=>[l.renderSlot(H.$slots,re,l.normalizeProps(l.guardReactiveProps({...Le})))])}))]),1040,["internal-model-value","class","open-on-top","arr-map-values","no-overlay-focus","onRecalculatePosition"])],16)):l.createCommentVNode("",!0)]),_:3},8,["name","css"])]),_:3},16)],2))}}),Ds=(()=>{const n=sw;return n.install=e=>{e.component("Vue3DatePicker",n)},n})();Object.entries(Object.freeze(Object.defineProperty({__proto__:null,default:Ds},Symbol.toStringTag,{value:"Module"}))).forEach(([n,e])=>{n!=="default"&&(Ds[n]=e)});const lw={components:{VueDatePicker:Ds},props:{setDate:{type:[Date,String],default:()=>new Date,required:!0},invalid:{type:Boolean,default:!1}},data(){return{selectedDate:this.setDate?new Date(this.setDate):null,minDate:new Date}},watch:{selectedDate(n){this.$emit("update:selectedDate",n)}}};function cw(n,e,t,r,i,o){const a=l.resolveComponent("VueDatePicker");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(a,{modelValue:i.selectedDate,"onUpdate:modelValue":e[0]||(e[0]=s=>i.selectedDate=s),"enable-time-picker":!1,format:"MM/dd/yyyy","min-date":i.minDate,mode:"date",placeholder:"Select Start Date"},null,8,["modelValue","min-date"])])}const As=Pe(lw,[["render",cw],["__scopeId","data-v-5c57e3ae"]]),dw={},uw={class:"flex flex-row justify-center"};function pw(n,e){return l.openBlock(),l.createElementBlock("div",uw)}const fw=Pe(dw,[["render",pw]]);function hw(n){if(Array.isArray(n))return n}function mw(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,i,o,a,s=[],c=!0,d=!1;try{if(o=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(r=o.call(t)).done)&&(s.push(r.value),s.length!==e);c=!0);}catch(u){d=!0,i=u}finally{try{if(!c&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(d)throw i}}return s}}function gw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yw(n,e){return hw(n)||mw(n,e)||Uc(n,e)||gw()}function Yd(n,e,t,r,i,o,a){try{var s=n[o](a),c=s.value}catch(d){t(d);return}s.done?e(c):Promise.resolve(c).then(r,i)}function vw(n){return function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(c){Yd(o,r,i,a,s,"next",c)}function s(c){Yd(o,r,i,a,s,"throw",c)}a(void 0)})}}function jd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ud={exports:{}},Wd={exports:{}};(function(n){function e(t){"@babel/helpers - typeof";return n.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,e(t)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(Wd);var bw=Wd.exports;(function(n){var e=bw.default;function t(){n.exports=t=function(){return i},n.exports.__esModule=!0,n.exports.default=n.exports;var r,i={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(b,g,M){b[g]=M.value},c=typeof Symbol=="function"?Symbol:{},d=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",p=c.toStringTag||"@@toStringTag";function f(b,g,M){return Object.defineProperty(b,g,{value:M,enumerable:!0,configurable:!0,writable:!0}),b[g]}try{f({},"")}catch{f=function(M,A,$){return M[A]=$}}function h(b,g,M,A){var $=g&&g.prototype instanceof v?g:v,F=Object.create($.prototype),B=new V(A||[]);return s(F,"_invoke",{value:q(b,M,B)}),F}function m(b,g,M){try{return{type:"normal",arg:b.call(g,M)}}catch(A){return{type:"throw",arg:A}}}i.wrap=h;var y="suspendedStart",w="suspendedYield",x="executing",C="completed",N={};function v(){}function O(){}function k(){}var E={};f(E,d,function(){return this});var W=Object.getPrototypeOf,P=W&&W(W(j([])));P&&P!==o&&a.call(P,d)&&(E=P);var T=k.prototype=v.prototype=Object.create(E);function _(b){["next","throw","return"].forEach(function(g){f(b,g,function(M){return this._invoke(g,M)})})}function z(b,g){function M($,F,B,D){var ee=m(b[$],b,F);if(ee.type!=="throw"){var te=ee.arg,K=te.value;return K&&e(K)=="object"&&a.call(K,"__await")?g.resolve(K.__await).then(function(ce){M("next",ce,B,D)},function(ce){M("throw",ce,B,D)}):g.resolve(K).then(function(ce){te.value=ce,B(te)},function(ce){return M("throw",ce,B,D)})}D(ee.arg)}var A;s(this,"_invoke",{value:function(F,B){function D(){return new g(function(ee,te){M(F,B,ee,te)})}return A=A?A.then(D,D):D()}})}function q(b,g,M){var A=y;return function($,F){if(A===x)throw new Error("Generator is already running");if(A===C){if($==="throw")throw F;return{value:r,done:!0}}for(M.method=$,M.arg=F;;){var B=M.delegate;if(B){var D=L(B,M);if(D){if(D===N)continue;return D}}if(M.method==="next")M.sent=M._sent=M.arg;else if(M.method==="throw"){if(A===y)throw A=C,M.arg;M.dispatchException(M.arg)}else M.method==="return"&&M.abrupt("return",M.arg);A=x;var ee=m(b,g,M);if(ee.type==="normal"){if(A=M.done?C:w,ee.arg===N)continue;return{value:ee.arg,done:M.done}}ee.type==="throw"&&(A=C,M.method="throw",M.arg=ee.arg)}}}function L(b,g){var M=g.method,A=b.iterator[M];if(A===r)return g.delegate=null,M==="throw"&&b.iterator.return&&(g.method="return",g.arg=r,L(b,g),g.method==="throw")||M!=="return"&&(g.method="throw",g.arg=new TypeError("The iterator does not provide a '"+M+"' method")),N;var $=m(A,b.iterator,g.arg);if($.type==="throw")return g.method="throw",g.arg=$.arg,g.delegate=null,N;var F=$.arg;return F?F.done?(g[b.resultName]=F.value,g.next=b.nextLoc,g.method!=="return"&&(g.method="next",g.arg=r),g.delegate=null,N):F:(g.method="throw",g.arg=new TypeError("iterator result is not an object"),g.delegate=null,N)}function S(b){var g={tryLoc:b[0]};1 in b&&(g.catchLoc=b[1]),2 in b&&(g.finallyLoc=b[2],g.afterLoc=b[3]),this.tryEntries.push(g)}function R(b){var g=b.completion||{};g.type="normal",delete g.arg,b.completion=g}function V(b){this.tryEntries=[{tryLoc:"root"}],b.forEach(S,this),this.reset(!0)}function j(b){if(b||b===""){var g=b[d];if(g)return g.call(b);if(typeof b.next=="function")return b;if(!isNaN(b.length)){var M=-1,A=function $(){for(;++M<b.length;)if(a.call(b,M))return $.value=b[M],$.done=!1,$;return $.value=r,$.done=!0,$};return A.next=A}}throw new TypeError(e(b)+" is not iterable")}return O.prototype=k,s(T,"constructor",{value:k,configurable:!0}),s(k,"constructor",{value:O,configurable:!0}),O.displayName=f(k,p,"GeneratorFunction"),i.isGeneratorFunction=function(b){var g=typeof b=="function"&&b.constructor;return!!g&&(g===O||(g.displayName||g.name)==="GeneratorFunction")},i.mark=function(b){return Object.setPrototypeOf?Object.setPrototypeOf(b,k):(b.__proto__=k,f(b,p,"GeneratorFunction")),b.prototype=Object.create(T),b},i.awrap=function(b){return{__await:b}},_(z.prototype),f(z.prototype,u,function(){return this}),i.AsyncIterator=z,i.async=function(b,g,M,A,$){$===void 0&&($=Promise);var F=new z(h(b,g,M,A),$);return i.isGeneratorFunction(g)?F:F.next().then(function(B){return B.done?B.value:F.next()})},_(T),f(T,p,"Generator"),f(T,d,function(){return this}),f(T,"toString",function(){return"[object Generator]"}),i.keys=function(b){var g=Object(b),M=[];for(var A in g)M.push(A);return M.reverse(),function $(){for(;M.length;){var F=M.pop();if(F in g)return $.value=F,$.done=!1,$}return $.done=!0,$}},i.values=j,V.prototype={constructor:V,reset:function(g){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(R),!g)for(var M in this)M.charAt(0)==="t"&&a.call(this,M)&&!isNaN(+M.slice(1))&&(this[M]=r)},stop:function(){this.done=!0;var g=this.tryEntries[0].completion;if(g.type==="throw")throw g.arg;return this.rval},dispatchException:function(g){if(this.done)throw g;var M=this;function A(te,K){return B.type="throw",B.arg=g,M.next=te,K&&(M.method="next",M.arg=r),!!K}for(var $=this.tryEntries.length-1;$>=0;--$){var F=this.tryEntries[$],B=F.completion;if(F.tryLoc==="root")return A("end");if(F.tryLoc<=this.prev){var D=a.call(F,"catchLoc"),ee=a.call(F,"finallyLoc");if(D&&ee){if(this.prev<F.catchLoc)return A(F.catchLoc,!0);if(this.prev<F.finallyLoc)return A(F.finallyLoc)}else if(D){if(this.prev<F.catchLoc)return A(F.catchLoc,!0)}else{if(!ee)throw new Error("try statement without catch or finally");if(this.prev<F.finallyLoc)return A(F.finallyLoc)}}}},abrupt:function(g,M){for(var A=this.tryEntries.length-1;A>=0;--A){var $=this.tryEntries[A];if($.tryLoc<=this.prev&&a.call($,"finallyLoc")&&this.prev<$.finallyLoc){var F=$;break}}F&&(g==="break"||g==="continue")&&F.tryLoc<=M&&M<=F.finallyLoc&&(F=null);var B=F?F.completion:{};return B.type=g,B.arg=M,F?(this.method="next",this.next=F.finallyLoc,N):this.complete(B)},complete:function(g,M){if(g.type==="throw")throw g.arg;return g.type==="break"||g.type==="continue"?this.next=g.arg:g.type==="return"?(this.rval=this.arg=g.arg,this.method="return",this.next="end"):g.type==="normal"&&M&&(this.next=M),N},finish:function(g){for(var M=this.tryEntries.length-1;M>=0;--M){var A=this.tryEntries[M];if(A.finallyLoc===g)return this.complete(A.completion,A.afterLoc),R(A),N}},catch:function(g){for(var M=this.tryEntries.length-1;M>=0;--M){var A=this.tryEntries[M];if(A.tryLoc===g){var $=A.completion;if($.type==="throw"){var F=$.arg;R(A)}return F}}throw new Error("illegal catch attempt")},delegateYield:function(g,M,A){return this.delegate={iterator:j(g),resultName:M,nextLoc:A},this.method==="next"&&(this.arg=r),N}},i}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Ud);var ww=Ud.exports,Ro=ww(),kw=Ro;try{regeneratorRuntime=Ro}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=Ro:Function("r","regeneratorRuntime = r")(Ro)}const qd=jd(kw);/*!
|
|
4
4
|
* Cropper.js v1.6.1
|
|
5
5
|
* https://fengyuanchen.github.io/cropperjs
|
|
6
6
|
*
|
|
@@ -8,8 +8,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
8
8
|
* Released under the MIT license
|
|
9
9
|
*
|
|
10
10
|
* Date: 2023-09-17T03:44:19.860Z
|
|
11
|
-
*/function Kd(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Gd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kd(Object(t),!0).forEach(function(r){
|
|
12
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iw(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Xd(n){var e=Iw(n,"string");return typeof e=="symbol"?e:String(e)}var Vo=typeof window<"u"&&typeof window.document<"u",hn=Vo?window:{},Os=Vo&&hn.document.documentElement?"ontouchstart"in hn.document.documentElement:!1,Es=Vo?"PointerEvent"in hn:!1,Ve="cropper",Ns="all",Zd="crop",eu="move",tu="zoom",vr="e",br="w",qr="s",jn="n",Li="ne",Fi="nw",zi="se",Hi="sw",_s="".concat(Ve,"-crop"),nu="".concat(Ve,"-disabled"),xt="".concat(Ve,"-hidden"),ru="".concat(Ve,"-hide"),Rw="".concat(Ve,"-invisible"),$o="".concat(Ve,"-modal"),Bs="".concat(Ve,"-move"),Yi="".concat(Ve,"Action"),Lo="".concat(Ve,"Preview"),Ps="crop",iu="move",ou="none",Is="crop",Rs="cropend",Vs="cropmove",$s="cropstart",au="dblclick",Vw=Os?"touchstart":"mousedown",$w=Os?"touchmove":"mousemove",Lw=Os?"touchend touchcancel":"mouseup",su=Es?"pointerdown":Vw,lu=Es?"pointermove":$w,cu=Es?"pointerup pointercancel":Lw,du="ready",uu="resize",fu="wheel",Ls="zoom",pu="image/jpeg",Fw=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,zw=/^data:/,Hw=/^data:image\/jpeg;base64,/,Yw=/^img|canvas$/i,hu=200,mu=100,gu={viewMode:0,dragMode:Ps,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:hu,minContainerHeight:mu,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},jw='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',Uw=Number.isNaN||hn.isNaN;function xe(n){return typeof n=="number"&&!Uw(n)}var yu=function(e){return e>0&&e<1/0};function Fs(n){return typeof n>"u"}function wr(n){return Ds(n)==="object"&&n!==null}var Ww=Object.prototype.hasOwnProperty;function Kr(n){if(!wr(n))return!1;try{var e=n.constructor,t=e.prototype;return e&&t&&Ww.call(t,"isPrototypeOf")}catch{return!1}}function Ct(n){return typeof n=="function"}var qw=Array.prototype.slice;function vu(n){return Array.from?Array.from(n):qw.call(n)}function qe(n,e){return n&&Ct(e)&&(Array.isArray(n)||xe(n.length)?vu(n).forEach(function(t,r){e.call(n,t,r,n)}):wr(n)&&Object.keys(n).forEach(function(t){e.call(n,n[t],t,n)})),n}var $e=Object.assign||function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return wr(e)&&r.length>0&&r.forEach(function(o){wr(o)&&Object.keys(o).forEach(function(a){e[a]=o[a]})}),e},Kw=/\.\d*(?:0|9){12}\d*$/;function Gr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Kw.test(n)?Math.round(n*e)/e:n}var Gw=/^width|height|left|top|marginLeft|marginTop$/;function Un(n,e){var t=n.style;qe(e,function(r,i){Gw.test(i)&&xe(r)&&(r="".concat(r,"px")),t[i]=r})}function Qw(n,e){return n.classList?n.classList.contains(e):n.className.indexOf(e)>-1}function tt(n,e){if(e){if(xe(n.length)){qe(n,function(r){tt(r,e)});return}if(n.classList){n.classList.add(e);return}var t=n.className.trim();t?t.indexOf(e)<0&&(n.className="".concat(t," ").concat(e)):n.className=e}}function mn(n,e){if(e){if(xe(n.length)){qe(n,function(t){mn(t,e)});return}if(n.classList){n.classList.remove(e);return}n.className.indexOf(e)>=0&&(n.className=n.className.replace(e,""))}}function Qr(n,e,t){if(e){if(xe(n.length)){qe(n,function(r){Qr(r,e,t)});return}t?tt(n,e):mn(n,e)}}var Jw=/([a-z\d])([A-Z])/g;function zs(n){return n.replace(Jw,"$1-$2").toLowerCase()}function Hs(n,e){return wr(n[e])?n[e]:n.dataset?n.dataset[e]:n.getAttribute("data-".concat(zs(e)))}function ji(n,e,t){wr(t)?n[e]=t:n.dataset?n.dataset[e]=t:n.setAttribute("data-".concat(zs(e)),t)}function Xw(n,e){if(wr(n[e]))try{delete n[e]}catch{n[e]=void 0}else if(n.dataset)try{delete n.dataset[e]}catch{n.dataset[e]=void 0}else n.removeAttribute("data-".concat(zs(e)))}var bu=/\s\s*/,wu=function(){var n=!1;if(Vo){var e=!1,t=function(){},r=Object.defineProperty({},"once",{get:function(){return n=!0,e},set:function(o){e=o}});hn.addEventListener("test",t,r),hn.removeEventListener("test",t,r)}return n}();function Xt(n,e,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t;e.trim().split(bu).forEach(function(o){if(!wu){var a=n.listeners;a&&a[o]&&a[o][t]&&(i=a[o][t],delete a[o][t],Object.keys(a[o]).length===0&&delete a[o],Object.keys(a).length===0&&delete n.listeners)}n.removeEventListener(o,i,r)})}function Rt(n,e,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t;e.trim().split(bu).forEach(function(o){if(r.once&&!wu){var a=n.listeners,s=a===void 0?{}:a;i=function(){delete s[o][t],n.removeEventListener(o,i,r);for(var d=arguments.length,u=new Array(d),f=0;f<d;f++)u[f]=arguments[f];t.apply(n,u)},s[o]||(s[o]={}),s[o][t]&&n.removeEventListener(o,s[o][t],r),s[o][t]=i,n.listeners=s}n.addEventListener(o,i,r)})}function Jr(n,e,t){var r;return Ct(Event)&&Ct(CustomEvent)?r=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(e,!0,!0,t)),n.dispatchEvent(r)}function ku(n){var e=n.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var Ys=hn.location,Zw=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function xu(n){var e=n.match(Zw);return e!==null&&(e[1]!==Ys.protocol||e[2]!==Ys.hostname||e[3]!==Ys.port)}function Cu(n){var e="timestamp=".concat(new Date().getTime());return n+(n.indexOf("?")===-1?"?":"&")+e}function Ui(n){var e=n.rotate,t=n.scaleX,r=n.scaleY,i=n.translateX,o=n.translateY,a=[];xe(i)&&i!==0&&a.push("translateX(".concat(i,"px)")),xe(o)&&o!==0&&a.push("translateY(".concat(o,"px)")),xe(e)&&e!==0&&a.push("rotate(".concat(e,"deg)")),xe(t)&&t!==1&&a.push("scaleX(".concat(t,")")),xe(r)&&r!==1&&a.push("scaleY(".concat(r,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function ek(n){var e=Gd({},n),t=0;return qe(n,function(r,i){delete e[i],qe(e,function(o){var a=Math.abs(r.startX-o.startX),s=Math.abs(r.startY-o.startY),c=Math.abs(r.endX-o.endX),d=Math.abs(r.endY-o.endY),u=Math.sqrt(a*a+s*s),f=Math.sqrt(c*c+d*d),p=(f-u)/u;Math.abs(p)>Math.abs(t)&&(t=p)})}),t}function Fo(n,e){var t=n.pageX,r=n.pageY,i={endX:t,endY:r};return e?i:Gd({startX:t,startY:r},i)}function tk(n){var e=0,t=0,r=0;return qe(n,function(i){var o=i.startX,a=i.startY;e+=o,t+=a,r+=1}),e/=r,t/=r,{pageX:e,pageY:t}}function Wn(n){var e=n.aspectRatio,t=n.height,r=n.width,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=yu(r),a=yu(t);if(o&&a){var s=t*e;i==="contain"&&s>r||i==="cover"&&s<r?t=r/e:r=t*e}else o?t=r/e:a&&(r=t*e);return{width:r,height:t}}function nk(n){var e=n.width,t=n.height,r=n.degree;if(r=Math.abs(r)%180,r===90)return{width:t,height:e};var i=r%90*Math.PI/180,o=Math.sin(i),a=Math.cos(i),s=e*a+t*o,c=e*o+t*a;return r>90?{width:c,height:s}:{width:s,height:c}}function rk(n,e,t,r){var i=e.aspectRatio,o=e.naturalWidth,a=e.naturalHeight,s=e.rotate,c=s===void 0?0:s,d=e.scaleX,u=d===void 0?1:d,f=e.scaleY,p=f===void 0?1:f,h=t.aspectRatio,m=t.naturalWidth,v=t.naturalHeight,w=r.fillColor,x=w===void 0?"transparent":w,C=r.imageSmoothingEnabled,N=C===void 0?!0:C,y=r.imageSmoothingQuality,_=y===void 0?"low":y,k=r.maxWidth,E=k===void 0?1/0:k,j=r.maxHeight,I=j===void 0?1/0:j,M=r.minWidth,B=M===void 0?0:M,H=r.minHeight,W=H===void 0?0:H,L=document.createElement("canvas"),T=L.getContext("2d"),R=Wn({aspectRatio:h,width:E,height:I}),$=Wn({aspectRatio:h,width:B,height:W},"cover"),Y=Math.min(R.width,Math.max($.width,m)),b=Math.min(R.height,Math.max($.height,v)),g=Wn({aspectRatio:i,width:E,height:I}),S=Wn({aspectRatio:i,width:B,height:W},"cover"),O=Math.min(g.width,Math.max(S.width,o)),F=Math.min(g.height,Math.max(S.height,a)),z=[-O/2,-F/2,O,F];return L.width=Gr(Y),L.height=Gr(b),T.fillStyle=x,T.fillRect(0,0,Y,b),T.save(),T.translate(Y/2,b/2),T.rotate(c*Math.PI/180),T.scale(u,p),T.imageSmoothingEnabled=N,T.imageSmoothingQuality=_,T.drawImage.apply(T,[n].concat(Jd(z.map(function(P){return Math.floor(Gr(P))})))),T.restore(),L}var Mu=String.fromCharCode;function ik(n,e,t){var r="";t+=e;for(var i=e;i<t;i+=1)r+=Mu(n.getUint8(i));return r}var ok=/^data:.*,/;function ak(n){var e=n.replace(ok,""),t=atob(e),r=new ArrayBuffer(t.length),i=new Uint8Array(r);return qe(i,function(o,a){i[a]=t.charCodeAt(a)}),r}function sk(n,e){for(var t=[],r=8192,i=new Uint8Array(n);i.length>0;)t.push(Mu.apply(null,vu(i.subarray(0,r)))),i=i.subarray(r);return"data:".concat(e,";base64,").concat(btoa(t.join("")))}function lk(n){var e=new DataView(n),t;try{var r,i,o;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var a=e.byteLength,s=2;s+1<a;){if(e.getUint8(s)===255&&e.getUint8(s+1)===225){i=s;break}s+=1}if(i){var c=i+4,d=i+10;if(ik(e,c,4)==="Exif"){var u=e.getUint16(d);if(r=u===18761,(r||u===19789)&&e.getUint16(d+2,r)===42){var f=e.getUint32(d+4,r);f>=8&&(o=d+f)}}}if(o){var p=e.getUint16(o,r),h,m;for(m=0;m<p;m+=1)if(h=o+m*12+2,e.getUint16(h,r)===274){h+=8,t=e.getUint16(h,r),e.setUint16(h,1,r);break}}}catch{t=1}return t}function ck(n){var e=0,t=1,r=1;switch(n){case 2:t=-1;break;case 3:e=-180;break;case 4:r=-1;break;case 5:e=90,r=-1;break;case 6:e=90;break;case 7:e=90,t=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:t,scaleY:r}}var dk={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,r=this.container,i=this.cropper,o=Number(t.minContainerWidth),a=Number(t.minContainerHeight);tt(i,xt),mn(e,xt);var s={width:Math.max(r.offsetWidth,o>=0?o:hu),height:Math.max(r.offsetHeight,a>=0?a:mu)};this.containerData=s,Un(i,{width:s.width,height:s.height}),tt(e,xt),mn(i,xt)},initCanvas:function(){var e=this.containerData,t=this.imageData,r=this.options.viewMode,i=Math.abs(t.rotate)%180===90,o=i?t.naturalHeight:t.naturalWidth,a=i?t.naturalWidth:t.naturalHeight,s=o/a,c=e.width,d=e.height;e.height*s>e.width?r===3?c=e.height*s:d=e.width/s:r===3?d=e.width/s:c=e.height*s;var u={aspectRatio:s,naturalWidth:o,naturalHeight:a,width:c,height:d};this.canvasData=u,this.limited=r===1||r===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(e.width-u.width)/2,u.top=(e.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=$e({},u)},limitCanvas:function(e,t){var r=this.options,i=this.containerData,o=this.canvasData,a=this.cropBoxData,s=r.viewMode,c=o.aspectRatio,d=this.cropped&&a;if(e){var u=Number(r.minCanvasWidth)||0,f=Number(r.minCanvasHeight)||0;s>1?(u=Math.max(u,i.width),f=Math.max(f,i.height),s===3&&(f*c>u?u=f*c:f=u/c)):s>0&&(u?u=Math.max(u,d?a.width:0):f?f=Math.max(f,d?a.height:0):d&&(u=a.width,f=a.height,f*c>u?u=f*c:f=u/c));var p=Wn({aspectRatio:c,width:u,height:f});u=p.width,f=p.height,o.minWidth=u,o.minHeight=f,o.maxWidth=1/0,o.maxHeight=1/0}if(t)if(s>(d?0:1)){var h=i.width-o.width,m=i.height-o.height;o.minLeft=Math.min(0,h),o.minTop=Math.min(0,m),o.maxLeft=Math.max(0,h),o.maxTop=Math.max(0,m),d&&this.limited&&(o.minLeft=Math.min(a.left,a.left+(a.width-o.width)),o.minTop=Math.min(a.top,a.top+(a.height-o.height)),o.maxLeft=a.left,o.maxTop=a.top,s===2&&(o.width>=i.width&&(o.minLeft=Math.min(0,h),o.maxLeft=Math.max(0,h)),o.height>=i.height&&(o.minTop=Math.min(0,m),o.maxTop=Math.max(0,m))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=i.width,o.maxTop=i.height},renderCanvas:function(e,t){var r=this.canvasData,i=this.imageData;if(t){var o=nk({width:i.naturalWidth*Math.abs(i.scaleX||1),height:i.naturalHeight*Math.abs(i.scaleY||1),degree:i.rotate||0}),a=o.width,s=o.height,c=r.width*(a/r.naturalWidth),d=r.height*(s/r.naturalHeight);r.left-=(c-r.width)/2,r.top-=(d-r.height)/2,r.width=c,r.height=d,r.aspectRatio=a/s,r.naturalWidth=a,r.naturalHeight=s,this.limitCanvas(!0,!1)}(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCanvas(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,Un(this.canvas,$e({width:r.width,height:r.height},Ui({translateX:r.left,translateY:r.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,r=this.imageData,i=r.naturalWidth*(t.width/t.naturalWidth),o=r.naturalHeight*(t.height/t.naturalHeight);$e(r,{width:i,height:o,left:(t.width-i)/2,top:(t.height-o)/2}),Un(this.image,$e({width:r.width,height:r.height},Ui($e({translateX:r.left,translateY:r.top},r)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,r=e.aspectRatio||e.initialAspectRatio,i=Number(e.autoCropArea)||.8,o={width:t.width,height:t.height};r&&(t.height*r>t.width?o.height=o.width/r:o.width=o.height*r),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*i),o.height=Math.max(o.minHeight,o.height*i),o.left=t.left+(t.width-o.width)/2,o.top=t.top+(t.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=$e({},o)},limitCropBox:function(e,t){var r=this.options,i=this.containerData,o=this.canvasData,a=this.cropBoxData,s=this.limited,c=r.aspectRatio;if(e){var d=Number(r.minCropBoxWidth)||0,u=Number(r.minCropBoxHeight)||0,f=s?Math.min(i.width,o.width,o.width+o.left,i.width-o.left):i.width,p=s?Math.min(i.height,o.height,o.height+o.top,i.height-o.top):i.height;d=Math.min(d,i.width),u=Math.min(u,i.height),c&&(d&&u?u*c>d?u=d/c:d=u*c:d?u=d/c:u&&(d=u*c),p*c>f?p=f/c:f=p*c),a.minWidth=Math.min(d,f),a.minHeight=Math.min(u,p),a.maxWidth=f,a.maxHeight=p}t&&(s?(a.minLeft=Math.max(0,o.left),a.minTop=Math.max(0,o.top),a.maxLeft=Math.min(i.width,o.left+o.width)-a.width,a.maxTop=Math.min(i.height,o.top+o.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=i.width-a.width,a.maxTop=i.height-a.height))},renderCropBox:function(){var e=this.options,t=this.containerData,r=this.cropBoxData;(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCropBox(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,e.movable&&e.cropBoxMovable&&ji(this.face,Yi,r.width>=t.width&&r.height>=t.height?eu:Ns),Un(this.cropBox,$e({width:r.width,height:r.height},Ui({translateX:r.left,translateY:r.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Jr(this.element,Is,this.getData())}},uk={initPreview:function(){var e=this.element,t=this.crossOrigin,r=this.options.preview,i=t?this.crossOriginUrl:this.url,o=e.alt||"The image to preview",a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=i,a.alt=o,this.viewBox.appendChild(a),this.viewBoxImage=a,!!r){var s=r;typeof r=="string"?s=e.ownerDocument.querySelectorAll(r):r.querySelector&&(s=[r]),this.previews=s,qe(s,function(c){var d=document.createElement("img");ji(c,Lo,{width:c.offsetWidth,height:c.offsetHeight,html:c.innerHTML}),t&&(d.crossOrigin=t),d.src=i,d.alt=o,d.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',c.innerHTML="",c.appendChild(d)})}},resetPreview:function(){qe(this.previews,function(e){var t=Hs(e,Lo);Un(e,{width:t.width,height:t.height}),e.innerHTML=t.html,Xw(e,Lo)})},preview:function(){var e=this.imageData,t=this.canvasData,r=this.cropBoxData,i=r.width,o=r.height,a=e.width,s=e.height,c=r.left-t.left-e.left,d=r.top-t.top-e.top;!this.cropped||this.disabled||(Un(this.viewBoxImage,$e({width:a,height:s},Ui($e({translateX:-c,translateY:-d},e)))),qe(this.previews,function(u){var f=Hs(u,Lo),p=f.width,h=f.height,m=p,v=h,w=1;i&&(w=p/i,v=o*w),o&&v>h&&(w=h/o,m=i*w,v=h),Un(u,{width:m,height:v}),Un(u.getElementsByTagName("img")[0],$e({width:a*w,height:s*w},Ui($e({translateX:-c*w,translateY:-d*w},e))))}))}},fk={bind:function(){var e=this.element,t=this.options,r=this.cropper;Ct(t.cropstart)&&Rt(e,$s,t.cropstart),Ct(t.cropmove)&&Rt(e,Vs,t.cropmove),Ct(t.cropend)&&Rt(e,Rs,t.cropend),Ct(t.crop)&&Rt(e,Is,t.crop),Ct(t.zoom)&&Rt(e,Ls,t.zoom),Rt(r,su,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Rt(r,fu,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Rt(r,au,this.onDblclick=this.dblclick.bind(this)),Rt(e.ownerDocument,lu,this.onCropMove=this.cropMove.bind(this)),Rt(e.ownerDocument,cu,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Rt(window,uu,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,r=this.cropper;Ct(t.cropstart)&&Xt(e,$s,t.cropstart),Ct(t.cropmove)&&Xt(e,Vs,t.cropmove),Ct(t.cropend)&&Xt(e,Rs,t.cropend),Ct(t.crop)&&Xt(e,Is,t.crop),Ct(t.zoom)&&Xt(e,Ls,t.zoom),Xt(r,su,this.onCropStart),t.zoomable&&t.zoomOnWheel&&Xt(r,fu,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Xt(r,au,this.onDblclick),Xt(e.ownerDocument,lu,this.onCropMove),Xt(e.ownerDocument,cu,this.onCropEnd),t.responsive&&Xt(window,uu,this.onResize)}},pk={resize:function(){if(!this.disabled){var e=this.options,t=this.container,r=this.containerData,i=t.offsetWidth/r.width,o=t.offsetHeight/r.height,a=Math.abs(i-1)>Math.abs(o-1)?i:o;if(a!==1){var s,c;e.restore&&(s=this.getCanvasData(),c=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(qe(s,function(d,u){s[u]=d*a})),this.setCropBoxData(qe(c,function(d,u){c[u]=d*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===ou||this.setDragMode(Qw(this.dragBox,_s)?iu:Ps)},wheel:function(e){var t=this,r=Number(this.options.wheelZoomRatio)||.1,i=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?i=e.deltaY>0?1:-1:e.wheelDelta?i=-e.wheelDelta/120:e.detail&&(i=e.detail>0?1:-1),this.zoom(-i*r,e)))},cropStart:function(e){var t=e.buttons,r=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(xe(t)&&t!==1||xe(r)&&r!==0||e.ctrlKey))){var i=this.options,o=this.pointers,a;e.changedTouches?qe(e.changedTouches,function(s){o[s.identifier]=Fo(s)}):o[e.pointerId||0]=Fo(e),Object.keys(o).length>1&&i.zoomable&&i.zoomOnTouch?a=tu:a=Hs(e.target,Yi),Fw.test(a)&&Jr(this.element,$s,{originalEvent:e,action:a})!==!1&&(e.preventDefault(),this.action=a,this.cropping=!1,a===Zd&&(this.cropping=!0,tt(this.dragBox,$o)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var r=this.pointers;e.preventDefault(),Jr(this.element,Vs,{originalEvent:e,action:t})!==!1&&(e.changedTouches?qe(e.changedTouches,function(i){$e(r[i.identifier]||{},Fo(i,!0))}):$e(r[e.pointerId||0]||{},Fo(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,r=this.pointers;e.changedTouches?qe(e.changedTouches,function(i){delete r[i.identifier]}):delete r[e.pointerId||0],t&&(e.preventDefault(),Object.keys(r).length||(this.action=""),this.cropping&&(this.cropping=!1,Qr(this.dragBox,$o,this.cropped&&this.options.modal)),Jr(this.element,Rs,{originalEvent:e,action:t}))}}},hk={change:function(e){var t=this.options,r=this.canvasData,i=this.containerData,o=this.cropBoxData,a=this.pointers,s=this.action,c=t.aspectRatio,d=o.left,u=o.top,f=o.width,p=o.height,h=d+f,m=u+p,v=0,w=0,x=i.width,C=i.height,N=!0,y;!c&&e.shiftKey&&(c=f&&p?f/p:1),this.limited&&(v=o.minLeft,w=o.minTop,x=v+Math.min(i.width,r.width,r.left+r.width),C=w+Math.min(i.height,r.height,r.top+r.height));var _=a[Object.keys(a)[0]],k={x:_.endX-_.startX,y:_.endY-_.startY},E=function(I){switch(I){case vr:h+k.x>x&&(k.x=x-h);break;case br:d+k.x<v&&(k.x=v-d);break;case jn:u+k.y<w&&(k.y=w-u);break;case qr:m+k.y>C&&(k.y=C-m);break}};switch(s){case Ns:d+=k.x,u+=k.y;break;case vr:if(k.x>=0&&(h>=x||c&&(u<=w||m>=C))){N=!1;break}E(vr),f+=k.x,f<0&&(s=br,f=-f,d-=f),c&&(p=f/c,u+=(o.height-p)/2);break;case jn:if(k.y<=0&&(u<=w||c&&(d<=v||h>=x))){N=!1;break}E(jn),p-=k.y,u+=k.y,p<0&&(s=qr,p=-p,u-=p),c&&(f=p*c,d+=(o.width-f)/2);break;case br:if(k.x<=0&&(d<=v||c&&(u<=w||m>=C))){N=!1;break}E(br),f-=k.x,d+=k.x,f<0&&(s=vr,f=-f,d-=f),c&&(p=f/c,u+=(o.height-p)/2);break;case qr:if(k.y>=0&&(m>=C||c&&(d<=v||h>=x))){N=!1;break}E(qr),p+=k.y,p<0&&(s=jn,p=-p,u-=p),c&&(f=p*c,d+=(o.width-f)/2);break;case Li:if(c){if(k.y<=0&&(u<=w||h>=x)){N=!1;break}E(jn),p-=k.y,u+=k.y,f=p*c}else E(jn),E(vr),k.x>=0?h<x?f+=k.x:k.y<=0&&u<=w&&(N=!1):f+=k.x,k.y<=0?u>w&&(p-=k.y,u+=k.y):(p-=k.y,u+=k.y);f<0&&p<0?(s=Hi,p=-p,f=-f,u-=p,d-=f):f<0?(s=Fi,f=-f,d-=f):p<0&&(s=zi,p=-p,u-=p);break;case Fi:if(c){if(k.y<=0&&(u<=w||d<=v)){N=!1;break}E(jn),p-=k.y,u+=k.y,f=p*c,d+=o.width-f}else E(jn),E(br),k.x<=0?d>v?(f-=k.x,d+=k.x):k.y<=0&&u<=w&&(N=!1):(f-=k.x,d+=k.x),k.y<=0?u>w&&(p-=k.y,u+=k.y):(p-=k.y,u+=k.y);f<0&&p<0?(s=zi,p=-p,f=-f,u-=p,d-=f):f<0?(s=Li,f=-f,d-=f):p<0&&(s=Hi,p=-p,u-=p);break;case Hi:if(c){if(k.x<=0&&(d<=v||m>=C)){N=!1;break}E(br),f-=k.x,d+=k.x,p=f/c}else E(qr),E(br),k.x<=0?d>v?(f-=k.x,d+=k.x):k.y>=0&&m>=C&&(N=!1):(f-=k.x,d+=k.x),k.y>=0?m<C&&(p+=k.y):p+=k.y;f<0&&p<0?(s=Li,p=-p,f=-f,u-=p,d-=f):f<0?(s=zi,f=-f,d-=f):p<0&&(s=Fi,p=-p,u-=p);break;case zi:if(c){if(k.x>=0&&(h>=x||m>=C)){N=!1;break}E(vr),f+=k.x,p=f/c}else E(qr),E(vr),k.x>=0?h<x?f+=k.x:k.y>=0&&m>=C&&(N=!1):f+=k.x,k.y>=0?m<C&&(p+=k.y):p+=k.y;f<0&&p<0?(s=Fi,p=-p,f=-f,u-=p,d-=f):f<0?(s=Hi,f=-f,d-=f):p<0&&(s=Li,p=-p,u-=p);break;case eu:this.move(k.x,k.y),N=!1;break;case tu:this.zoom(ek(a),e),N=!1;break;case Zd:if(!k.x||!k.y){N=!1;break}y=ku(this.cropper),d=_.startX-y.left,u=_.startY-y.top,f=o.minWidth,p=o.minHeight,k.x>0?s=k.y>0?zi:Li:k.x<0&&(d-=f,s=k.y>0?Hi:Fi),k.y<0&&(u-=p),this.cropped||(mn(this.cropBox,xt),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}N&&(o.width=f,o.height=p,o.left=d,o.top=u,this.action=s,this.renderCropBox()),qe(a,function(j){j.startX=j.endX,j.startY=j.endY})}},mk={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&tt(this.dragBox,$o),mn(this.cropBox,xt),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=$e({},this.initialImageData),this.canvasData=$e({},this.initialCanvasData),this.cropBoxData=$e({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&($e(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),mn(this.dragBox,$o),tt(this.cropBox,xt)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,qe(this.previews,function(r){r.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,mn(this.cropper,nu)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,tt(this.cropper,nu)),this},destroy:function(){var e=this.element;return e[Ve]?(e[Ve]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.canvasData,i=r.left,o=r.top;return this.moveTo(Fs(e)?e:i+Number(e),Fs(t)?t:o+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.canvasData,i=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(xe(e)&&(r.left=e,i=!0),xe(t)&&(r.top=t,i=!0),i&&this.renderCanvas(!0)),this},zoom:function(e,t){var r=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(r.width*e/r.naturalWidth,null,t)},zoomTo:function(e,t,r){var i=this.options,o=this.canvasData,a=o.width,s=o.height,c=o.naturalWidth,d=o.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&i.zoomable){var u=c*e,f=d*e;if(Jr(this.element,Ls,{ratio:e,oldRatio:a/c,originalEvent:r})===!1)return this;if(r){var p=this.pointers,h=ku(this.cropper),m=p&&Object.keys(p).length?tk(p):{pageX:r.pageX,pageY:r.pageY};o.left-=(u-a)*((m.pageX-h.left-o.left)/a),o.top-=(f-s)*((m.pageY-h.top-o.top)/s)}else Kr(t)&&xe(t.x)&&xe(t.y)?(o.left-=(u-a)*((t.x-o.left)/a),o.top-=(f-s)*((t.y-o.top)/s)):(o.left-=(u-a)/2,o.top-=(f-s)/2);o.width=u,o.height=f,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),xe(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,xe(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(xe(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.imageData,i=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(xe(e)&&(r.scaleX=e,i=!0),xe(t)&&(r.scaleY=t,i=!0),i&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,r=this.imageData,i=this.canvasData,o=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:o.left-i.left,y:o.top-i.top,width:o.width,height:o.height};var s=r.width/r.naturalWidth;if(qe(a,function(u,f){a[f]=u/s}),e){var c=Math.round(a.y+a.height),d=Math.round(a.x+a.width);a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=d-a.x,a.height=c-a.y}}else a={x:0,y:0,width:0,height:0};return t.rotatable&&(a.rotate=r.rotate||0),t.scalable&&(a.scaleX=r.scaleX||1,a.scaleY=r.scaleY||1),a},setData:function(e){var t=this.options,r=this.imageData,i=this.canvasData,o={};if(this.ready&&!this.disabled&&Kr(e)){var a=!1;t.rotatable&&xe(e.rotate)&&e.rotate!==r.rotate&&(r.rotate=e.rotate,a=!0),t.scalable&&(xe(e.scaleX)&&e.scaleX!==r.scaleX&&(r.scaleX=e.scaleX,a=!0),xe(e.scaleY)&&e.scaleY!==r.scaleY&&(r.scaleY=e.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var s=r.width/r.naturalWidth;xe(e.x)&&(o.left=e.x*s+i.left),xe(e.y)&&(o.top=e.y*s+i.top),xe(e.width)&&(o.width=e.width*s),xe(e.height)&&(o.height=e.height*s),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?$e({},this.containerData):{}},getImageData:function(){return this.sized?$e({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&qe(["left","top","width","height","naturalWidth","naturalHeight"],function(r){t[r]=e[r]}),t},setCanvasData:function(e){var t=this.canvasData,r=t.aspectRatio;return this.ready&&!this.disabled&&Kr(e)&&(xe(e.left)&&(t.left=e.left),xe(e.top)&&(t.top=e.top),xe(e.width)?(t.width=e.width,t.height=e.width/r):xe(e.height)&&(t.height=e.height,t.width=e.height*r),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,r=this.options.aspectRatio,i,o;return this.ready&&this.cropped&&!this.disabled&&Kr(e)&&(xe(e.left)&&(t.left=e.left),xe(e.top)&&(t.top=e.top),xe(e.width)&&e.width!==t.width&&(i=!0,t.width=e.width),xe(e.height)&&e.height!==t.height&&(o=!0,t.height=e.height),r&&(i?t.height=t.width/r:o&&(t.width=t.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,r=rk(this.image,this.imageData,t,e);if(!this.cropped)return r;var i=this.getData(e.rounded),o=i.x,a=i.y,s=i.width,c=i.height,d=r.width/Math.floor(t.naturalWidth);d!==1&&(o*=d,a*=d,s*=d,c*=d);var u=s/c,f=Wn({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),p=Wn({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),h=Wn({aspectRatio:u,width:e.width||(d!==1?r.width:s),height:e.height||(d!==1?r.height:c)}),m=h.width,v=h.height;m=Math.min(f.width,Math.max(p.width,m)),v=Math.min(f.height,Math.max(p.height,v));var w=document.createElement("canvas"),x=w.getContext("2d");w.width=Gr(m),w.height=Gr(v),x.fillStyle=e.fillColor||"transparent",x.fillRect(0,0,m,v);var C=e.imageSmoothingEnabled,N=C===void 0?!0:C,y=e.imageSmoothingQuality;x.imageSmoothingEnabled=N,y&&(x.imageSmoothingQuality=y);var _=r.width,k=r.height,E=o,j=a,I,M,B,H,W,L;E<=-s||E>_?(E=0,I=0,B=0,W=0):E<=0?(B=-E,E=0,I=Math.min(_,s+E),W=I):E<=_&&(B=0,I=Math.min(s,_-E),W=I),I<=0||j<=-c||j>k?(j=0,M=0,H=0,L=0):j<=0?(H=-j,j=0,M=Math.min(k,c+j),L=M):j<=k&&(H=0,M=Math.min(c,k-j),L=M);var T=[E,j,I,M];if(W>0&&L>0){var R=m/s;T.push(B*R,H*R,W*R,L*R)}return x.drawImage.apply(x,[r].concat(Jd(T.map(function($){return Math.floor(Gr($))})))),w},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!Fs(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,r=this.dragBox,i=this.face;if(this.ready&&!this.disabled){var o=e===Ps,a=t.movable&&e===iu;e=o||a?e:ou,t.dragMode=e,ji(r,Yi,e),Qr(r,_s,o),Qr(r,Bs,a),t.cropBoxMovable||(ji(i,Yi,e),Qr(i,_s,o),Qr(i,Bs,a))}return this}},gk=hn.Cropper,Su=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Aw(this,n),!e||!Yw.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=$e({},gu,Kr(t)&&t),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Ow(n,[{key:"init",value:function(){var t=this.element,r=t.tagName.toLowerCase(),i;if(!t[Ve]){if(t[Ve]=this,r==="img"){if(this.isImg=!0,i=t.getAttribute("src")||"",this.originalUrl=i,!i)return;i=t.src}else r==="canvas"&&window.HTMLCanvasElement&&(i=t.toDataURL());this.load(i)}}},{key:"load",value:function(t){var r=this;if(t){this.url=t,this.imageData={};var i=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(zw.test(t)){Hw.test(t)?this.read(ak(t)):this.clone();return}var a=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=a,a.onabort=s,a.onerror=s,a.ontimeout=s,a.onprogress=function(){a.getResponseHeader("content-type")!==pu&&a.abort()},a.onload=function(){r.read(a.response)},a.onloadend=function(){r.reloading=!1,r.xhr=null},o.checkCrossOrigin&&xu(t)&&i.crossOrigin&&(t=Cu(t)),a.open("GET",t,!0),a.responseType="arraybuffer",a.withCredentials=i.crossOrigin==="use-credentials",a.send()}}},{key:"read",value:function(t){var r=this.options,i=this.imageData,o=lk(t),a=0,s=1,c=1;if(o>1){this.url=sk(t,pu);var d=ck(o);a=d.rotate,s=d.scaleX,c=d.scaleY}r.rotatable&&(i.rotate=a),r.scalable&&(i.scaleX=s,i.scaleY=c),this.clone()}},{key:"clone",value:function(){var t=this.element,r=this.url,i=t.crossOrigin,o=r;this.options.checkCrossOrigin&&xu(r)&&(i||(i="anonymous"),o=Cu(r)),this.crossOrigin=i,this.crossOriginUrl=o;var a=document.createElement("img");i&&(a.crossOrigin=i),a.src=o||r,a.alt=t.alt||"The image to crop",this.image=a,a.onload=this.start.bind(this),a.onerror=this.stop.bind(this),tt(a,ru),t.parentNode.insertBefore(a,t.nextSibling)}},{key:"start",value:function(){var t=this,r=this.image;r.onload=null,r.onerror=null,this.sizing=!0;var i=hn.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(hn.navigator.userAgent),o=function(d,u){$e(t.imageData,{naturalWidth:d,naturalHeight:u,aspectRatio:d/u}),t.initialImageData=$e({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(r.naturalWidth&&!i){o(r.naturalWidth,r.naturalHeight);return}var a=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=a,a.onload=function(){o(a.width,a.height),i||s.removeChild(a)},a.src=r.src,i||(a.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",s.appendChild(a))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var t=this.element,r=this.options,i=this.image,o=t.parentNode,a=document.createElement("div");a.innerHTML=jw;var s=a.querySelector(".".concat(Ve,"-container")),c=s.querySelector(".".concat(Ve,"-canvas")),d=s.querySelector(".".concat(Ve,"-drag-box")),u=s.querySelector(".".concat(Ve,"-crop-box")),f=u.querySelector(".".concat(Ve,"-face"));this.container=o,this.cropper=s,this.canvas=c,this.dragBox=d,this.cropBox=u,this.viewBox=s.querySelector(".".concat(Ve,"-view-box")),this.face=f,c.appendChild(i),tt(t,xt),o.insertBefore(s,t.nextSibling),mn(i,ru),this.initPreview(),this.bind(),r.initialAspectRatio=Math.max(0,r.initialAspectRatio)||NaN,r.aspectRatio=Math.max(0,r.aspectRatio)||NaN,r.viewMode=Math.max(0,Math.min(3,Math.round(r.viewMode)))||0,tt(u,xt),r.guides||tt(u.getElementsByClassName("".concat(Ve,"-dashed")),xt),r.center||tt(u.getElementsByClassName("".concat(Ve,"-center")),xt),r.background&&tt(s,"".concat(Ve,"-bg")),r.highlight||tt(f,Rw),r.cropBoxMovable&&(tt(f,Bs),ji(f,Yi,Ns)),r.cropBoxResizable||(tt(u.getElementsByClassName("".concat(Ve,"-line")),xt),tt(u.getElementsByClassName("".concat(Ve,"-point")),xt)),this.render(),this.ready=!0,this.setDragMode(r.dragMode),r.autoCrop&&this.crop(),this.setData(r.data),Ct(r.ready)&&Rt(t,du,r.ready,{once:!0}),Jr(t,du)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),mn(this.element,xt)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=gk,n}},{key:"setDefaults",value:function(t){$e(gu,Kr(t)&&t)}}]),n}();$e(Su.prototype,dk,uk,fk,pk,hk,mk);function zo(){this._types=Object.create(null),this._extensions=Object.create(null);for(let n=0;n<arguments.length;n++)this.define(arguments[n]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}zo.prototype.define=function(n,e){for(let t in n){let r=n[t].map(function(i){return i.toLowerCase()});t=t.toLowerCase();for(let i=0;i<r.length;i++){const o=r[i];if(o[0]!=="*"){if(!e&&o in this._types)throw new Error('Attempt to change mapping for "'+o+'" extension from "'+this._types[o]+'" to "'+t+'". Pass `force=true` to allow this, otherwise remove "'+o+'" from the list of extensions for "'+t+'".');this._types[o]=t}}if(e||!this._extensions[t]){const i=r[0];this._extensions[t]=i[0]!=="*"?i:i.substr(1)}}},zo.prototype.getType=function(n){n=String(n);let e=n.replace(/^.*[/\\]/,"").toLowerCase(),t=e.replace(/^.*\./,"").toLowerCase(),r=e.length<n.length;return(t.length<e.length-1||!r)&&this._types[t]||null},zo.prototype.getExtension=function(n){return n=/^\s*([^;\s]*)/.test(n)&&RegExp.$1,n&&this._extensions[n.toLowerCase()]||null};var yk=zo,vk={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};let bk=yk;var wk=new bk(vk);const kk=jd(wk);var Ho=l.defineComponent({name:"AvatarCropper",emits:["update:modelValue","submit","error","cancel","changed","uploading","completed","uploaded"],props:{modelValue:{type:Boolean,default:!1},file:{type:File},uploadHandler:{type:Function},uploadUrl:{type:String},requestOptions:{type:Object,default:function(){return{method:"POST"}}},uploadFileField:{type:String,default:"file"},uploadFileName:{type:[String,Function]},uploadFormData:{type:FormData,default:function(){return new FormData}},cropperOptions:{type:Object,default:function(){return{aspectRatio:1,autoCropArea:1,viewMode:1,movable:!1,zoomable:!1}}},outputOptions:{type:Object},outputMime:{type:String,default:null},outputQuality:{type:Number,default:.9},mimes:{type:String,default:"image/png, image/gif, image/jpeg, image/bmp, image/x-icon"},capture:{type:String},labels:{type:Object,default:function(){return{submit:"Ok",cancel:"Cancel"}}},inline:{type:Boolean,default:!1}},data:function(){return{cropper:void 0,dataUrl:void 0,fileName:void 0,mimeType:void 0}},computed:{cleanedMimes:function(){if(!this.mimes)throw new Error("vue-avatar-cropper: mimes prop cannot be empty");return this.mimes.trim().toLowerCase()}},watch:{modelValue:function(n){n&&(this.file?this.onFileChange(this.file):this.pickImage(),this.$emit("update:modelValue",!1))}},mounted:function(){this.$emit("update:modelValue",!1)},methods:{destroy:function(){this.cropper&&this.cropper.destroy(),this.$refs.input&&(this.$refs.input.value=""),this.dataUrl=void 0},submit:function(){this.$emit("submit"),this.uploadUrl?this.uploadImage():this.uploadHandler?this.uploadHandler(this.cropper):this.$emit("error",{type:"user",message:"No upload handler found"}),this.destroy()},cancel:function(){this.$emit("cancel"),this.destroy()},onImgElementError:function(){this.$emit("error",{type:"load",message:"File loading failed"}),this.destroy()},pickImage:function(){this.$refs.input&&this.$refs.input.click()},onFileChange:function(n){var e=this;if(this.cleanedMimes==="image/*"){if(n.type.split("/")[0]!=="image")return void this.$emit("error",{type:"user",message:"File type not correct"})}else if(this.cleanedMimes){var t=this.cleanedMimes.split(", ").find(function(i){return i===n.type});if(!t)return void this.$emit("error",{type:"user",message:"File type not correct"})}var r=new FileReader;r.onload=function(i){e.dataUrl=i.target.result},r.readAsDataURL(n),this.fileName=n.name||"unknown",this.mimeType=n.type,this.$emit("changed",{file:n,reader:r})},onFileInputChange:function(n){n.target.files&&n.target.files[0]&&this.onFileChange(n.target.files[0])},createCropper:function(){this.cropper=new Su(this.$refs.img,this.cropperOptions)},getFilename:function(n){var e=kk.getExtension(n.type);if(!this.uploadFileName){var t=this.fileName,r=this.fileName.split(".");return r.length>1&&(t=r.slice(0,-1).join(".")),"".concat(t,".").concat(e)}return typeof this.uploadFileName=="string"?this.uploadFileName:typeof this.uploadFileName=="function"?this.uploadFileName({filename:this.fileName,mime:n.type,extension:e}):"unknown.".concat(e)},uploadImage:function(){var n=this;this.cropper.getCroppedCanvas(this.outputOptions).toBlob(function(){var e=Mw(qd.mark(function t(r){var i,o,a,s,c,d,u,f,p;return qd.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:for(o in i=new FormData,n.uploadFormData.entries())a=Cw(o,2),s=a[0],c=a[1],i.append(s,c);return i.append(n.uploadFileField,r,n.getFilename(r)),d=Object.assign({body:i},n.requestOptions),u=new Request(n.uploadUrl,d),f=fetch(u),n.$emit("uploading",{form:i,request:u,response:f}),h.next=9,f;case 9:p=h.sent,n.$emit("completed",{form:i,request:u,response:p}),p.ok?n.$emit("uploaded",{form:i,request:u,response:p}):n.$emit("error",{type:"upload",message:"Image upload fail",context:{request:u,response:p}});case 12:case"end":return h.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.outputMime||this.mimeType,this.outputQuality)}}}),xk={class:"avatar-cropper"},Ck={key:0,class:"avatar-cropper-mark"},Mk=["title"],Sk={class:"avatar-cropper-container"},Tk={class:"avatar-cropper-image-container"},Dk=["src"],Ak={class:"avatar-cropper-footer"},Ok=["accept","capture"];(function(n,e){e===void 0&&(e={});var t=e.insertAt;if(n&&typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}})(`.avatar-cropper .avatar-cropper-overlay {
|
|
11
|
+
*/function Kd(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Gd(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kd(Object(t),!0).forEach(function(r){Tw(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Kd(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Es(n){"@babel/helpers - typeof";return Es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Es(n)}function xw(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Jd(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,Xd(r.key),r)}}function Cw(n,e,t){return e&&Jd(n.prototype,e),t&&Jd(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Tw(n,e,t){return e=Xd(e),e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Qd(n){return Mw(n)||Sw(n)||Dw(n)||Aw()}function Mw(n){if(Array.isArray(n))return Ns(n)}function Sw(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function Dw(n,e){if(n){if(typeof n=="string")return Ns(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ns(n,e)}}function Ns(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function Aw(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
12
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ew(n,e){if(typeof n!="object"||n===null)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Xd(n){var e=Ew(n,"string");return typeof e=="symbol"?e:String(e)}var Vo=typeof window<"u"&&typeof window.document<"u",mn=Vo?window:{},Os=Vo&&mn.document.documentElement?"ontouchstart"in mn.document.documentElement:!1,_s=Vo?"PointerEvent"in mn:!1,$e="cropper",Bs="all",Zd="crop",eu="move",tu="zoom",wr="e",kr="w",Jr="s",Un="n",$i="ne",Fi="nw",zi="se",Hi="sw",Ps="".concat($e,"-crop"),nu="".concat($e,"-disabled"),Ct="".concat($e,"-hidden"),ru="".concat($e,"-hide"),Nw="".concat($e,"-invisible"),Lo="".concat($e,"-modal"),Is="".concat($e,"-move"),Yi="".concat($e,"Action"),$o="".concat($e,"Preview"),Rs="crop",iu="move",ou="none",Vs="crop",Ls="cropend",$s="cropmove",Fs="cropstart",au="dblclick",Ow=Os?"touchstart":"mousedown",_w=Os?"touchmove":"mousemove",Bw=Os?"touchend touchcancel":"mouseup",su=_s?"pointerdown":Ow,lu=_s?"pointermove":_w,cu=_s?"pointerup pointercancel":Bw,du="ready",uu="resize",pu="wheel",zs="zoom",fu="image/jpeg",Pw=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Iw=/^data:/,Rw=/^data:image\/jpeg;base64,/,Vw=/^img|canvas$/i,hu=200,mu=100,gu={viewMode:0,dragMode:Rs,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:hu,minContainerHeight:mu,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Lw='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',$w=Number.isNaN||mn.isNaN;function xe(n){return typeof n=="number"&&!$w(n)}var yu=function(e){return e>0&&e<1/0};function Hs(n){return typeof n>"u"}function xr(n){return Es(n)==="object"&&n!==null}var Fw=Object.prototype.hasOwnProperty;function Qr(n){if(!xr(n))return!1;try{var e=n.constructor,t=e.prototype;return e&&t&&Fw.call(t,"isPrototypeOf")}catch{return!1}}function Tt(n){return typeof n=="function"}var zw=Array.prototype.slice;function vu(n){return Array.from?Array.from(n):zw.call(n)}function qe(n,e){return n&&Tt(e)&&(Array.isArray(n)||xe(n.length)?vu(n).forEach(function(t,r){e.call(n,t,r,n)}):xr(n)&&Object.keys(n).forEach(function(t){e.call(n,n[t],t,n)})),n}var Fe=Object.assign||function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return xr(e)&&r.length>0&&r.forEach(function(o){xr(o)&&Object.keys(o).forEach(function(a){e[a]=o[a]})}),e},Hw=/\.\d*(?:0|9){12}\d*$/;function Xr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Hw.test(n)?Math.round(n*e)/e:n}var Yw=/^width|height|left|top|marginLeft|marginTop$/;function Wn(n,e){var t=n.style;qe(e,function(r,i){Yw.test(i)&&xe(r)&&(r="".concat(r,"px")),t[i]=r})}function jw(n,e){return n.classList?n.classList.contains(e):n.className.indexOf(e)>-1}function et(n,e){if(e){if(xe(n.length)){qe(n,function(r){et(r,e)});return}if(n.classList){n.classList.add(e);return}var t=n.className.trim();t?t.indexOf(e)<0&&(n.className="".concat(t," ").concat(e)):n.className=e}}function gn(n,e){if(e){if(xe(n.length)){qe(n,function(t){gn(t,e)});return}if(n.classList){n.classList.remove(e);return}n.className.indexOf(e)>=0&&(n.className=n.className.replace(e,""))}}function Zr(n,e,t){if(e){if(xe(n.length)){qe(n,function(r){Zr(r,e,t)});return}t?et(n,e):gn(n,e)}}var Uw=/([a-z\d])([A-Z])/g;function Ys(n){return n.replace(Uw,"$1-$2").toLowerCase()}function js(n,e){return xr(n[e])?n[e]:n.dataset?n.dataset[e]:n.getAttribute("data-".concat(Ys(e)))}function ji(n,e,t){xr(t)?n[e]=t:n.dataset?n.dataset[e]=t:n.setAttribute("data-".concat(Ys(e)),t)}function Ww(n,e){if(xr(n[e]))try{delete n[e]}catch{n[e]=void 0}else if(n.dataset)try{delete n.dataset[e]}catch{n.dataset[e]=void 0}else n.removeAttribute("data-".concat(Ys(e)))}var bu=/\s\s*/,wu=function(){var n=!1;if(Vo){var e=!1,t=function(){},r=Object.defineProperty({},"once",{get:function(){return n=!0,e},set:function(o){e=o}});mn.addEventListener("test",t,r),mn.removeEventListener("test",t,r)}return n}();function en(n,e,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t;e.trim().split(bu).forEach(function(o){if(!wu){var a=n.listeners;a&&a[o]&&a[o][t]&&(i=a[o][t],delete a[o][t],Object.keys(a[o]).length===0&&delete a[o],Object.keys(a).length===0&&delete n.listeners)}n.removeEventListener(o,i,r)})}function Ft(n,e,t){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},i=t;e.trim().split(bu).forEach(function(o){if(r.once&&!wu){var a=n.listeners,s=a===void 0?{}:a;i=function(){delete s[o][t],n.removeEventListener(o,i,r);for(var d=arguments.length,u=new Array(d),p=0;p<d;p++)u[p]=arguments[p];t.apply(n,u)},s[o]||(s[o]={}),s[o][t]&&n.removeEventListener(o,s[o][t],r),s[o][t]=i,n.listeners=s}n.addEventListener(o,i,r)})}function ei(n,e,t){var r;return Tt(Event)&&Tt(CustomEvent)?r=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0}):(r=document.createEvent("CustomEvent"),r.initCustomEvent(e,!0,!0,t)),n.dispatchEvent(r)}function ku(n){var e=n.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var Us=mn.location,qw=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function xu(n){var e=n.match(qw);return e!==null&&(e[1]!==Us.protocol||e[2]!==Us.hostname||e[3]!==Us.port)}function Cu(n){var e="timestamp=".concat(new Date().getTime());return n+(n.indexOf("?")===-1?"?":"&")+e}function Ui(n){var e=n.rotate,t=n.scaleX,r=n.scaleY,i=n.translateX,o=n.translateY,a=[];xe(i)&&i!==0&&a.push("translateX(".concat(i,"px)")),xe(o)&&o!==0&&a.push("translateY(".concat(o,"px)")),xe(e)&&e!==0&&a.push("rotate(".concat(e,"deg)")),xe(t)&&t!==1&&a.push("scaleX(".concat(t,")")),xe(r)&&r!==1&&a.push("scaleY(".concat(r,")"));var s=a.length?a.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Kw(n){var e=Gd({},n),t=0;return qe(n,function(r,i){delete e[i],qe(e,function(o){var a=Math.abs(r.startX-o.startX),s=Math.abs(r.startY-o.startY),c=Math.abs(r.endX-o.endX),d=Math.abs(r.endY-o.endY),u=Math.sqrt(a*a+s*s),p=Math.sqrt(c*c+d*d),f=(p-u)/u;Math.abs(f)>Math.abs(t)&&(t=f)})}),t}function Fo(n,e){var t=n.pageX,r=n.pageY,i={endX:t,endY:r};return e?i:Gd({startX:t,startY:r},i)}function Gw(n){var e=0,t=0,r=0;return qe(n,function(i){var o=i.startX,a=i.startY;e+=o,t+=a,r+=1}),e/=r,t/=r,{pageX:e,pageY:t}}function qn(n){var e=n.aspectRatio,t=n.height,r=n.width,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",o=yu(r),a=yu(t);if(o&&a){var s=t*e;i==="contain"&&s>r||i==="cover"&&s<r?t=r/e:r=t*e}else o?t=r/e:a&&(r=t*e);return{width:r,height:t}}function Jw(n){var e=n.width,t=n.height,r=n.degree;if(r=Math.abs(r)%180,r===90)return{width:t,height:e};var i=r%90*Math.PI/180,o=Math.sin(i),a=Math.cos(i),s=e*a+t*o,c=e*o+t*a;return r>90?{width:c,height:s}:{width:s,height:c}}function Qw(n,e,t,r){var i=e.aspectRatio,o=e.naturalWidth,a=e.naturalHeight,s=e.rotate,c=s===void 0?0:s,d=e.scaleX,u=d===void 0?1:d,p=e.scaleY,f=p===void 0?1:p,h=t.aspectRatio,m=t.naturalWidth,y=t.naturalHeight,w=r.fillColor,x=w===void 0?"transparent":w,C=r.imageSmoothingEnabled,N=C===void 0?!0:C,v=r.imageSmoothingQuality,O=v===void 0?"low":v,k=r.maxWidth,E=k===void 0?1/0:k,W=r.maxHeight,P=W===void 0?1/0:W,T=r.minWidth,_=T===void 0?0:T,z=r.minHeight,q=z===void 0?0:z,L=document.createElement("canvas"),S=L.getContext("2d"),R=qn({aspectRatio:h,width:E,height:P}),V=qn({aspectRatio:h,width:_,height:q},"cover"),j=Math.min(R.width,Math.max(V.width,m)),b=Math.min(R.height,Math.max(V.height,y)),g=qn({aspectRatio:i,width:E,height:P}),M=qn({aspectRatio:i,width:_,height:q},"cover"),A=Math.min(g.width,Math.max(M.width,o)),$=Math.min(g.height,Math.max(M.height,a)),F=[-A/2,-$/2,A,$];return L.width=Xr(j),L.height=Xr(b),S.fillStyle=x,S.fillRect(0,0,j,b),S.save(),S.translate(j/2,b/2),S.rotate(c*Math.PI/180),S.scale(u,f),S.imageSmoothingEnabled=N,S.imageSmoothingQuality=O,S.drawImage.apply(S,[n].concat(Qd(F.map(function(B){return Math.floor(Xr(B))})))),S.restore(),L}var Tu=String.fromCharCode;function Xw(n,e,t){var r="";t+=e;for(var i=e;i<t;i+=1)r+=Tu(n.getUint8(i));return r}var Zw=/^data:.*,/;function ek(n){var e=n.replace(Zw,""),t=atob(e),r=new ArrayBuffer(t.length),i=new Uint8Array(r);return qe(i,function(o,a){i[a]=t.charCodeAt(a)}),r}function tk(n,e){for(var t=[],r=8192,i=new Uint8Array(n);i.length>0;)t.push(Tu.apply(null,vu(i.subarray(0,r)))),i=i.subarray(r);return"data:".concat(e,";base64,").concat(btoa(t.join("")))}function nk(n){var e=new DataView(n),t;try{var r,i,o;if(e.getUint8(0)===255&&e.getUint8(1)===216)for(var a=e.byteLength,s=2;s+1<a;){if(e.getUint8(s)===255&&e.getUint8(s+1)===225){i=s;break}s+=1}if(i){var c=i+4,d=i+10;if(Xw(e,c,4)==="Exif"){var u=e.getUint16(d);if(r=u===18761,(r||u===19789)&&e.getUint16(d+2,r)===42){var p=e.getUint32(d+4,r);p>=8&&(o=d+p)}}}if(o){var f=e.getUint16(o,r),h,m;for(m=0;m<f;m+=1)if(h=o+m*12+2,e.getUint16(h,r)===274){h+=8,t=e.getUint16(h,r),e.setUint16(h,1,r);break}}}catch{t=1}return t}function rk(n){var e=0,t=1,r=1;switch(n){case 2:t=-1;break;case 3:e=-180;break;case 4:r=-1;break;case 5:e=90,r=-1;break;case 6:e=90;break;case 7:e=90,t=-1;break;case 8:e=-90;break}return{rotate:e,scaleX:t,scaleY:r}}var ik={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,r=this.container,i=this.cropper,o=Number(t.minContainerWidth),a=Number(t.minContainerHeight);et(i,Ct),gn(e,Ct);var s={width:Math.max(r.offsetWidth,o>=0?o:hu),height:Math.max(r.offsetHeight,a>=0?a:mu)};this.containerData=s,Wn(i,{width:s.width,height:s.height}),et(e,Ct),gn(i,Ct)},initCanvas:function(){var e=this.containerData,t=this.imageData,r=this.options.viewMode,i=Math.abs(t.rotate)%180===90,o=i?t.naturalHeight:t.naturalWidth,a=i?t.naturalWidth:t.naturalHeight,s=o/a,c=e.width,d=e.height;e.height*s>e.width?r===3?c=e.height*s:d=e.width/s:r===3?d=e.width/s:c=e.height*s;var u={aspectRatio:s,naturalWidth:o,naturalHeight:a,width:c,height:d};this.canvasData=u,this.limited=r===1||r===2,this.limitCanvas(!0,!0),u.width=Math.min(Math.max(u.width,u.minWidth),u.maxWidth),u.height=Math.min(Math.max(u.height,u.minHeight),u.maxHeight),u.left=(e.width-u.width)/2,u.top=(e.height-u.height)/2,u.oldLeft=u.left,u.oldTop=u.top,this.initialCanvasData=Fe({},u)},limitCanvas:function(e,t){var r=this.options,i=this.containerData,o=this.canvasData,a=this.cropBoxData,s=r.viewMode,c=o.aspectRatio,d=this.cropped&&a;if(e){var u=Number(r.minCanvasWidth)||0,p=Number(r.minCanvasHeight)||0;s>1?(u=Math.max(u,i.width),p=Math.max(p,i.height),s===3&&(p*c>u?u=p*c:p=u/c)):s>0&&(u?u=Math.max(u,d?a.width:0):p?p=Math.max(p,d?a.height:0):d&&(u=a.width,p=a.height,p*c>u?u=p*c:p=u/c));var f=qn({aspectRatio:c,width:u,height:p});u=f.width,p=f.height,o.minWidth=u,o.minHeight=p,o.maxWidth=1/0,o.maxHeight=1/0}if(t)if(s>(d?0:1)){var h=i.width-o.width,m=i.height-o.height;o.minLeft=Math.min(0,h),o.minTop=Math.min(0,m),o.maxLeft=Math.max(0,h),o.maxTop=Math.max(0,m),d&&this.limited&&(o.minLeft=Math.min(a.left,a.left+(a.width-o.width)),o.minTop=Math.min(a.top,a.top+(a.height-o.height)),o.maxLeft=a.left,o.maxTop=a.top,s===2&&(o.width>=i.width&&(o.minLeft=Math.min(0,h),o.maxLeft=Math.max(0,h)),o.height>=i.height&&(o.minTop=Math.min(0,m),o.maxTop=Math.max(0,m))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=i.width,o.maxTop=i.height},renderCanvas:function(e,t){var r=this.canvasData,i=this.imageData;if(t){var o=Jw({width:i.naturalWidth*Math.abs(i.scaleX||1),height:i.naturalHeight*Math.abs(i.scaleY||1),degree:i.rotate||0}),a=o.width,s=o.height,c=r.width*(a/r.naturalWidth),d=r.height*(s/r.naturalHeight);r.left-=(c-r.width)/2,r.top-=(d-r.height)/2,r.width=c,r.height=d,r.aspectRatio=a/s,r.naturalWidth=a,r.naturalHeight=s,this.limitCanvas(!0,!1)}(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCanvas(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,Wn(this.canvas,Fe({width:r.width,height:r.height},Ui({translateX:r.left,translateY:r.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,r=this.imageData,i=r.naturalWidth*(t.width/t.naturalWidth),o=r.naturalHeight*(t.height/t.naturalHeight);Fe(r,{width:i,height:o,left:(t.width-i)/2,top:(t.height-o)/2}),Wn(this.image,Fe({width:r.width,height:r.height},Ui(Fe({translateX:r.left,translateY:r.top},r)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,r=e.aspectRatio||e.initialAspectRatio,i=Number(e.autoCropArea)||.8,o={width:t.width,height:t.height};r&&(t.height*r>t.width?o.height=o.width/r:o.width=o.height*r),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*i),o.height=Math.max(o.minHeight,o.height*i),o.left=t.left+(t.width-o.width)/2,o.top=t.top+(t.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=Fe({},o)},limitCropBox:function(e,t){var r=this.options,i=this.containerData,o=this.canvasData,a=this.cropBoxData,s=this.limited,c=r.aspectRatio;if(e){var d=Number(r.minCropBoxWidth)||0,u=Number(r.minCropBoxHeight)||0,p=s?Math.min(i.width,o.width,o.width+o.left,i.width-o.left):i.width,f=s?Math.min(i.height,o.height,o.height+o.top,i.height-o.top):i.height;d=Math.min(d,i.width),u=Math.min(u,i.height),c&&(d&&u?u*c>d?u=d/c:d=u*c:d?u=d/c:u&&(d=u*c),f*c>p?f=p/c:p=f*c),a.minWidth=Math.min(d,p),a.minHeight=Math.min(u,f),a.maxWidth=p,a.maxHeight=f}t&&(s?(a.minLeft=Math.max(0,o.left),a.minTop=Math.max(0,o.top),a.maxLeft=Math.min(i.width,o.left+o.width)-a.width,a.maxTop=Math.min(i.height,o.top+o.height)-a.height):(a.minLeft=0,a.minTop=0,a.maxLeft=i.width-a.width,a.maxTop=i.height-a.height))},renderCropBox:function(){var e=this.options,t=this.containerData,r=this.cropBoxData;(r.width>r.maxWidth||r.width<r.minWidth)&&(r.left=r.oldLeft),(r.height>r.maxHeight||r.height<r.minHeight)&&(r.top=r.oldTop),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),this.limitCropBox(!1,!0),r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft),r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop),r.oldLeft=r.left,r.oldTop=r.top,e.movable&&e.cropBoxMovable&&ji(this.face,Yi,r.width>=t.width&&r.height>=t.height?eu:Bs),Wn(this.cropBox,Fe({width:r.width,height:r.height},Ui({translateX:r.left,translateY:r.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),ei(this.element,Vs,this.getData())}},ok={initPreview:function(){var e=this.element,t=this.crossOrigin,r=this.options.preview,i=t?this.crossOriginUrl:this.url,o=e.alt||"The image to preview",a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=i,a.alt=o,this.viewBox.appendChild(a),this.viewBoxImage=a,!!r){var s=r;typeof r=="string"?s=e.ownerDocument.querySelectorAll(r):r.querySelector&&(s=[r]),this.previews=s,qe(s,function(c){var d=document.createElement("img");ji(c,$o,{width:c.offsetWidth,height:c.offsetHeight,html:c.innerHTML}),t&&(d.crossOrigin=t),d.src=i,d.alt=o,d.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',c.innerHTML="",c.appendChild(d)})}},resetPreview:function(){qe(this.previews,function(e){var t=js(e,$o);Wn(e,{width:t.width,height:t.height}),e.innerHTML=t.html,Ww(e,$o)})},preview:function(){var e=this.imageData,t=this.canvasData,r=this.cropBoxData,i=r.width,o=r.height,a=e.width,s=e.height,c=r.left-t.left-e.left,d=r.top-t.top-e.top;!this.cropped||this.disabled||(Wn(this.viewBoxImage,Fe({width:a,height:s},Ui(Fe({translateX:-c,translateY:-d},e)))),qe(this.previews,function(u){var p=js(u,$o),f=p.width,h=p.height,m=f,y=h,w=1;i&&(w=f/i,y=o*w),o&&y>h&&(w=h/o,m=i*w,y=h),Wn(u,{width:m,height:y}),Wn(u.getElementsByTagName("img")[0],Fe({width:a*w,height:s*w},Ui(Fe({translateX:-c*w,translateY:-d*w},e))))}))}},ak={bind:function(){var e=this.element,t=this.options,r=this.cropper;Tt(t.cropstart)&&Ft(e,Fs,t.cropstart),Tt(t.cropmove)&&Ft(e,$s,t.cropmove),Tt(t.cropend)&&Ft(e,Ls,t.cropend),Tt(t.crop)&&Ft(e,Vs,t.crop),Tt(t.zoom)&&Ft(e,zs,t.zoom),Ft(r,su,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Ft(r,pu,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Ft(r,au,this.onDblclick=this.dblclick.bind(this)),Ft(e.ownerDocument,lu,this.onCropMove=this.cropMove.bind(this)),Ft(e.ownerDocument,cu,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Ft(window,uu,this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,r=this.cropper;Tt(t.cropstart)&&en(e,Fs,t.cropstart),Tt(t.cropmove)&&en(e,$s,t.cropmove),Tt(t.cropend)&&en(e,Ls,t.cropend),Tt(t.crop)&&en(e,Vs,t.crop),Tt(t.zoom)&&en(e,zs,t.zoom),en(r,su,this.onCropStart),t.zoomable&&t.zoomOnWheel&&en(r,pu,this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&en(r,au,this.onDblclick),en(e.ownerDocument,lu,this.onCropMove),en(e.ownerDocument,cu,this.onCropEnd),t.responsive&&en(window,uu,this.onResize)}},sk={resize:function(){if(!this.disabled){var e=this.options,t=this.container,r=this.containerData,i=t.offsetWidth/r.width,o=t.offsetHeight/r.height,a=Math.abs(i-1)>Math.abs(o-1)?i:o;if(a!==1){var s,c;e.restore&&(s=this.getCanvasData(),c=this.getCropBoxData()),this.render(),e.restore&&(this.setCanvasData(qe(s,function(d,u){s[u]=d*a})),this.setCropBoxData(qe(c,function(d,u){c[u]=d*a})))}}},dblclick:function(){this.disabled||this.options.dragMode===ou||this.setDragMode(jw(this.dragBox,Ps)?iu:Rs)},wheel:function(e){var t=this,r=Number(this.options.wheelZoomRatio)||.1,i=1;this.disabled||(e.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){t.wheeling=!1},50),e.deltaY?i=e.deltaY>0?1:-1:e.wheelDelta?i=-e.wheelDelta/120:e.detail&&(i=e.detail>0?1:-1),this.zoom(-i*r,e)))},cropStart:function(e){var t=e.buttons,r=e.button;if(!(this.disabled||(e.type==="mousedown"||e.type==="pointerdown"&&e.pointerType==="mouse")&&(xe(t)&&t!==1||xe(r)&&r!==0||e.ctrlKey))){var i=this.options,o=this.pointers,a;e.changedTouches?qe(e.changedTouches,function(s){o[s.identifier]=Fo(s)}):o[e.pointerId||0]=Fo(e),Object.keys(o).length>1&&i.zoomable&&i.zoomOnTouch?a=tu:a=js(e.target,Yi),Pw.test(a)&&ei(this.element,Fs,{originalEvent:e,action:a})!==!1&&(e.preventDefault(),this.action=a,this.cropping=!1,a===Zd&&(this.cropping=!0,et(this.dragBox,Lo)))}},cropMove:function(e){var t=this.action;if(!(this.disabled||!t)){var r=this.pointers;e.preventDefault(),ei(this.element,$s,{originalEvent:e,action:t})!==!1&&(e.changedTouches?qe(e.changedTouches,function(i){Fe(r[i.identifier]||{},Fo(i,!0))}):Fe(r[e.pointerId||0]||{},Fo(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,r=this.pointers;e.changedTouches?qe(e.changedTouches,function(i){delete r[i.identifier]}):delete r[e.pointerId||0],t&&(e.preventDefault(),Object.keys(r).length||(this.action=""),this.cropping&&(this.cropping=!1,Zr(this.dragBox,Lo,this.cropped&&this.options.modal)),ei(this.element,Ls,{originalEvent:e,action:t}))}}},lk={change:function(e){var t=this.options,r=this.canvasData,i=this.containerData,o=this.cropBoxData,a=this.pointers,s=this.action,c=t.aspectRatio,d=o.left,u=o.top,p=o.width,f=o.height,h=d+p,m=u+f,y=0,w=0,x=i.width,C=i.height,N=!0,v;!c&&e.shiftKey&&(c=p&&f?p/f:1),this.limited&&(y=o.minLeft,w=o.minTop,x=y+Math.min(i.width,r.width,r.left+r.width),C=w+Math.min(i.height,r.height,r.top+r.height));var O=a[Object.keys(a)[0]],k={x:O.endX-O.startX,y:O.endY-O.startY},E=function(P){switch(P){case wr:h+k.x>x&&(k.x=x-h);break;case kr:d+k.x<y&&(k.x=y-d);break;case Un:u+k.y<w&&(k.y=w-u);break;case Jr:m+k.y>C&&(k.y=C-m);break}};switch(s){case Bs:d+=k.x,u+=k.y;break;case wr:if(k.x>=0&&(h>=x||c&&(u<=w||m>=C))){N=!1;break}E(wr),p+=k.x,p<0&&(s=kr,p=-p,d-=p),c&&(f=p/c,u+=(o.height-f)/2);break;case Un:if(k.y<=0&&(u<=w||c&&(d<=y||h>=x))){N=!1;break}E(Un),f-=k.y,u+=k.y,f<0&&(s=Jr,f=-f,u-=f),c&&(p=f*c,d+=(o.width-p)/2);break;case kr:if(k.x<=0&&(d<=y||c&&(u<=w||m>=C))){N=!1;break}E(kr),p-=k.x,d+=k.x,p<0&&(s=wr,p=-p,d-=p),c&&(f=p/c,u+=(o.height-f)/2);break;case Jr:if(k.y>=0&&(m>=C||c&&(d<=y||h>=x))){N=!1;break}E(Jr),f+=k.y,f<0&&(s=Un,f=-f,u-=f),c&&(p=f*c,d+=(o.width-p)/2);break;case $i:if(c){if(k.y<=0&&(u<=w||h>=x)){N=!1;break}E(Un),f-=k.y,u+=k.y,p=f*c}else E(Un),E(wr),k.x>=0?h<x?p+=k.x:k.y<=0&&u<=w&&(N=!1):p+=k.x,k.y<=0?u>w&&(f-=k.y,u+=k.y):(f-=k.y,u+=k.y);p<0&&f<0?(s=Hi,f=-f,p=-p,u-=f,d-=p):p<0?(s=Fi,p=-p,d-=p):f<0&&(s=zi,f=-f,u-=f);break;case Fi:if(c){if(k.y<=0&&(u<=w||d<=y)){N=!1;break}E(Un),f-=k.y,u+=k.y,p=f*c,d+=o.width-p}else E(Un),E(kr),k.x<=0?d>y?(p-=k.x,d+=k.x):k.y<=0&&u<=w&&(N=!1):(p-=k.x,d+=k.x),k.y<=0?u>w&&(f-=k.y,u+=k.y):(f-=k.y,u+=k.y);p<0&&f<0?(s=zi,f=-f,p=-p,u-=f,d-=p):p<0?(s=$i,p=-p,d-=p):f<0&&(s=Hi,f=-f,u-=f);break;case Hi:if(c){if(k.x<=0&&(d<=y||m>=C)){N=!1;break}E(kr),p-=k.x,d+=k.x,f=p/c}else E(Jr),E(kr),k.x<=0?d>y?(p-=k.x,d+=k.x):k.y>=0&&m>=C&&(N=!1):(p-=k.x,d+=k.x),k.y>=0?m<C&&(f+=k.y):f+=k.y;p<0&&f<0?(s=$i,f=-f,p=-p,u-=f,d-=p):p<0?(s=zi,p=-p,d-=p):f<0&&(s=Fi,f=-f,u-=f);break;case zi:if(c){if(k.x>=0&&(h>=x||m>=C)){N=!1;break}E(wr),p+=k.x,f=p/c}else E(Jr),E(wr),k.x>=0?h<x?p+=k.x:k.y>=0&&m>=C&&(N=!1):p+=k.x,k.y>=0?m<C&&(f+=k.y):f+=k.y;p<0&&f<0?(s=Fi,f=-f,p=-p,u-=f,d-=p):p<0?(s=Hi,p=-p,d-=p):f<0&&(s=$i,f=-f,u-=f);break;case eu:this.move(k.x,k.y),N=!1;break;case tu:this.zoom(Kw(a),e),N=!1;break;case Zd:if(!k.x||!k.y){N=!1;break}v=ku(this.cropper),d=O.startX-v.left,u=O.startY-v.top,p=o.minWidth,f=o.minHeight,k.x>0?s=k.y>0?zi:$i:k.x<0&&(d-=p,s=k.y>0?Hi:Fi),k.y<0&&(u-=f),this.cropped||(gn(this.cropBox,Ct),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}N&&(o.width=p,o.height=f,o.left=d,o.top=u,this.action=s,this.renderCropBox()),qe(a,function(W){W.startX=W.endX,W.startY=W.endY})}},ck={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&et(this.dragBox,Lo),gn(this.cropBox,Ct),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=Fe({},this.initialImageData),this.canvasData=Fe({},this.initialCanvasData),this.cropBoxData=Fe({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(Fe(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),gn(this.dragBox,Lo),et(this.cropBox,Ct)),this},replace:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,qe(this.previews,function(r){r.getElementsByTagName("img")[0].src=e}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,gn(this.cropper,nu)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,et(this.cropper,nu)),this},destroy:function(){var e=this.element;return e[$e]?(e[$e]=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.canvasData,i=r.left,o=r.top;return this.moveTo(Hs(e)?e:i+Number(e),Hs(t)?t:o+Number(t))},moveTo:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.canvasData,i=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(xe(e)&&(r.left=e,i=!0),xe(t)&&(r.top=t,i=!0),i&&this.renderCanvas(!0)),this},zoom:function(e,t){var r=this.canvasData;return e=Number(e),e<0?e=1/(1-e):e=1+e,this.zoomTo(r.width*e/r.naturalWidth,null,t)},zoomTo:function(e,t,r){var i=this.options,o=this.canvasData,a=o.width,s=o.height,c=o.naturalWidth,d=o.naturalHeight;if(e=Number(e),e>=0&&this.ready&&!this.disabled&&i.zoomable){var u=c*e,p=d*e;if(ei(this.element,zs,{ratio:e,oldRatio:a/c,originalEvent:r})===!1)return this;if(r){var f=this.pointers,h=ku(this.cropper),m=f&&Object.keys(f).length?Gw(f):{pageX:r.pageX,pageY:r.pageY};o.left-=(u-a)*((m.pageX-h.left-o.left)/a),o.top-=(p-s)*((m.pageY-h.top-o.top)/s)}else Qr(t)&&xe(t.x)&&xe(t.y)?(o.left-=(u-a)*((t.x-o.left)/a),o.top-=(p-s)*((t.y-o.top)/s)):(o.left-=(u-a)/2,o.top-=(p-s)/2);o.width=u,o.height=p,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return e=Number(e),xe(e)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,xe(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(xe(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e,r=this.imageData,i=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(xe(e)&&(r.scaleX=e,i=!0),xe(t)&&(r.scaleY=t,i=!0),i&&this.renderCanvas(!0,!0)),this},getData:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.options,r=this.imageData,i=this.canvasData,o=this.cropBoxData,a;if(this.ready&&this.cropped){a={x:o.left-i.left,y:o.top-i.top,width:o.width,height:o.height};var s=r.width/r.naturalWidth;if(qe(a,function(u,p){a[p]=u/s}),e){var c=Math.round(a.y+a.height),d=Math.round(a.x+a.width);a.x=Math.round(a.x),a.y=Math.round(a.y),a.width=d-a.x,a.height=c-a.y}}else a={x:0,y:0,width:0,height:0};return t.rotatable&&(a.rotate=r.rotate||0),t.scalable&&(a.scaleX=r.scaleX||1,a.scaleY=r.scaleY||1),a},setData:function(e){var t=this.options,r=this.imageData,i=this.canvasData,o={};if(this.ready&&!this.disabled&&Qr(e)){var a=!1;t.rotatable&&xe(e.rotate)&&e.rotate!==r.rotate&&(r.rotate=e.rotate,a=!0),t.scalable&&(xe(e.scaleX)&&e.scaleX!==r.scaleX&&(r.scaleX=e.scaleX,a=!0),xe(e.scaleY)&&e.scaleY!==r.scaleY&&(r.scaleY=e.scaleY,a=!0)),a&&this.renderCanvas(!0,!0);var s=r.width/r.naturalWidth;xe(e.x)&&(o.left=e.x*s+i.left),xe(e.y)&&(o.top=e.y*s+i.top),xe(e.width)&&(o.width=e.width*s),xe(e.height)&&(o.height=e.height*s),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?Fe({},this.containerData):{}},getImageData:function(){return this.sized?Fe({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&qe(["left","top","width","height","naturalWidth","naturalHeight"],function(r){t[r]=e[r]}),t},setCanvasData:function(e){var t=this.canvasData,r=t.aspectRatio;return this.ready&&!this.disabled&&Qr(e)&&(xe(e.left)&&(t.left=e.left),xe(e.top)&&(t.top=e.top),xe(e.width)?(t.width=e.width,t.height=e.width/r):xe(e.height)&&(t.height=e.height,t.width=e.height*r),this.renderCanvas(!0)),this},getCropBoxData:function(){var e=this.cropBoxData,t;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(e){var t=this.cropBoxData,r=this.options.aspectRatio,i,o;return this.ready&&this.cropped&&!this.disabled&&Qr(e)&&(xe(e.left)&&(t.left=e.left),xe(e.top)&&(t.top=e.top),xe(e.width)&&e.width!==t.width&&(i=!0,t.width=e.width),xe(e.height)&&e.height!==t.height&&(o=!0,t.height=e.height),r&&(i?t.height=t.width/r:o&&(t.width=t.height*r)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,r=Qw(this.image,this.imageData,t,e);if(!this.cropped)return r;var i=this.getData(e.rounded),o=i.x,a=i.y,s=i.width,c=i.height,d=r.width/Math.floor(t.naturalWidth);d!==1&&(o*=d,a*=d,s*=d,c*=d);var u=s/c,p=qn({aspectRatio:u,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),f=qn({aspectRatio:u,width:e.minWidth||0,height:e.minHeight||0},"cover"),h=qn({aspectRatio:u,width:e.width||(d!==1?r.width:s),height:e.height||(d!==1?r.height:c)}),m=h.width,y=h.height;m=Math.min(p.width,Math.max(f.width,m)),y=Math.min(p.height,Math.max(f.height,y));var w=document.createElement("canvas"),x=w.getContext("2d");w.width=Xr(m),w.height=Xr(y),x.fillStyle=e.fillColor||"transparent",x.fillRect(0,0,m,y);var C=e.imageSmoothingEnabled,N=C===void 0?!0:C,v=e.imageSmoothingQuality;x.imageSmoothingEnabled=N,v&&(x.imageSmoothingQuality=v);var O=r.width,k=r.height,E=o,W=a,P,T,_,z,q,L;E<=-s||E>O?(E=0,P=0,_=0,q=0):E<=0?(_=-E,E=0,P=Math.min(O,s+E),q=P):E<=O&&(_=0,P=Math.min(s,O-E),q=P),P<=0||W<=-c||W>k?(W=0,T=0,z=0,L=0):W<=0?(z=-W,W=0,T=Math.min(k,c+W),L=T):W<=k&&(z=0,T=Math.min(c,k-W),L=T);var S=[E,W,P,T];if(q>0&&L>0){var R=m/s;S.push(_*R,z*R,q*R,L*R)}return x.drawImage.apply(x,[r].concat(Qd(S.map(function(V){return Math.floor(Xr(V))})))),w},setAspectRatio:function(e){var t=this.options;return!this.disabled&&!Hs(e)&&(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,r=this.dragBox,i=this.face;if(this.ready&&!this.disabled){var o=e===Rs,a=t.movable&&e===iu;e=o||a?e:ou,t.dragMode=e,ji(r,Yi,e),Zr(r,Ps,o),Zr(r,Is,a),t.cropBoxMovable||(ji(i,Yi,e),Zr(i,Ps,o),Zr(i,Is,a))}return this}},dk=mn.Cropper,Mu=function(){function n(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(xw(this,n),!e||!Vw.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=Fe({},gu,Qr(t)&&t),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return Cw(n,[{key:"init",value:function(){var t=this.element,r=t.tagName.toLowerCase(),i;if(!t[$e]){if(t[$e]=this,r==="img"){if(this.isImg=!0,i=t.getAttribute("src")||"",this.originalUrl=i,!i)return;i=t.src}else r==="canvas"&&window.HTMLCanvasElement&&(i=t.toDataURL());this.load(i)}}},{key:"load",value:function(t){var r=this;if(t){this.url=t,this.imageData={};var i=this.element,o=this.options;if(!o.rotatable&&!o.scalable&&(o.checkOrientation=!1),!o.checkOrientation||!window.ArrayBuffer){this.clone();return}if(Iw.test(t)){Rw.test(t)?this.read(ek(t)):this.clone();return}var a=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=a,a.onabort=s,a.onerror=s,a.ontimeout=s,a.onprogress=function(){a.getResponseHeader("content-type")!==fu&&a.abort()},a.onload=function(){r.read(a.response)},a.onloadend=function(){r.reloading=!1,r.xhr=null},o.checkCrossOrigin&&xu(t)&&i.crossOrigin&&(t=Cu(t)),a.open("GET",t,!0),a.responseType="arraybuffer",a.withCredentials=i.crossOrigin==="use-credentials",a.send()}}},{key:"read",value:function(t){var r=this.options,i=this.imageData,o=nk(t),a=0,s=1,c=1;if(o>1){this.url=tk(t,fu);var d=rk(o);a=d.rotate,s=d.scaleX,c=d.scaleY}r.rotatable&&(i.rotate=a),r.scalable&&(i.scaleX=s,i.scaleY=c),this.clone()}},{key:"clone",value:function(){var t=this.element,r=this.url,i=t.crossOrigin,o=r;this.options.checkCrossOrigin&&xu(r)&&(i||(i="anonymous"),o=Cu(r)),this.crossOrigin=i,this.crossOriginUrl=o;var a=document.createElement("img");i&&(a.crossOrigin=i),a.src=o||r,a.alt=t.alt||"The image to crop",this.image=a,a.onload=this.start.bind(this),a.onerror=this.stop.bind(this),et(a,ru),t.parentNode.insertBefore(a,t.nextSibling)}},{key:"start",value:function(){var t=this,r=this.image;r.onload=null,r.onerror=null,this.sizing=!0;var i=mn.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(mn.navigator.userAgent),o=function(d,u){Fe(t.imageData,{naturalWidth:d,naturalHeight:u,aspectRatio:d/u}),t.initialImageData=Fe({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(r.naturalWidth&&!i){o(r.naturalWidth,r.naturalHeight);return}var a=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=a,a.onload=function(){o(a.width,a.height),i||s.removeChild(a)},a.src=r.src,i||(a.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",s.appendChild(a))}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(!(!this.sized||this.ready)){var t=this.element,r=this.options,i=this.image,o=t.parentNode,a=document.createElement("div");a.innerHTML=Lw;var s=a.querySelector(".".concat($e,"-container")),c=s.querySelector(".".concat($e,"-canvas")),d=s.querySelector(".".concat($e,"-drag-box")),u=s.querySelector(".".concat($e,"-crop-box")),p=u.querySelector(".".concat($e,"-face"));this.container=o,this.cropper=s,this.canvas=c,this.dragBox=d,this.cropBox=u,this.viewBox=s.querySelector(".".concat($e,"-view-box")),this.face=p,c.appendChild(i),et(t,Ct),o.insertBefore(s,t.nextSibling),gn(i,ru),this.initPreview(),this.bind(),r.initialAspectRatio=Math.max(0,r.initialAspectRatio)||NaN,r.aspectRatio=Math.max(0,r.aspectRatio)||NaN,r.viewMode=Math.max(0,Math.min(3,Math.round(r.viewMode)))||0,et(u,Ct),r.guides||et(u.getElementsByClassName("".concat($e,"-dashed")),Ct),r.center||et(u.getElementsByClassName("".concat($e,"-center")),Ct),r.background&&et(s,"".concat($e,"-bg")),r.highlight||et(p,Nw),r.cropBoxMovable&&(et(p,Is),ji(p,Yi,Bs)),r.cropBoxResizable||(et(u.getElementsByClassName("".concat($e,"-line")),Ct),et(u.getElementsByClassName("".concat($e,"-point")),Ct)),this.render(),this.ready=!0,this.setDragMode(r.dragMode),r.autoCrop&&this.crop(),this.setData(r.data),Tt(r.ready)&&Ft(t,du,r.ready,{once:!0}),ei(t,du)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),gn(this.element,Ct)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=dk,n}},{key:"setDefaults",value:function(t){Fe(gu,Qr(t)&&t)}}]),n}();Fe(Mu.prototype,ik,ok,ak,sk,lk,ck);function zo(){this._types=Object.create(null),this._extensions=Object.create(null);for(let n=0;n<arguments.length;n++)this.define(arguments[n]);this.define=this.define.bind(this),this.getType=this.getType.bind(this),this.getExtension=this.getExtension.bind(this)}zo.prototype.define=function(n,e){for(let t in n){let r=n[t].map(function(i){return i.toLowerCase()});t=t.toLowerCase();for(let i=0;i<r.length;i++){const o=r[i];if(o[0]!=="*"){if(!e&&o in this._types)throw new Error('Attempt to change mapping for "'+o+'" extension from "'+this._types[o]+'" to "'+t+'". Pass `force=true` to allow this, otherwise remove "'+o+'" from the list of extensions for "'+t+'".');this._types[o]=t}}if(e||!this._extensions[t]){const i=r[0];this._extensions[t]=i[0]!=="*"?i:i.substr(1)}}},zo.prototype.getType=function(n){n=String(n);let e=n.replace(/^.*[/\\]/,"").toLowerCase(),t=e.replace(/^.*\./,"").toLowerCase(),r=e.length<n.length;return(t.length<e.length-1||!r)&&this._types[t]||null},zo.prototype.getExtension=function(n){return n=/^\s*([^;\s]*)/.test(n)&&RegExp.$1,n&&this._extensions[n.toLowerCase()]||null};var uk=zo,pk={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["es","ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};let fk=uk;var hk=new fk(pk);const mk=jd(hk);var Ho=l.defineComponent({name:"AvatarCropper",emits:["update:modelValue","submit","error","cancel","changed","uploading","completed","uploaded"],props:{modelValue:{type:Boolean,default:!1},file:{type:File},uploadHandler:{type:Function},uploadUrl:{type:String},requestOptions:{type:Object,default:function(){return{method:"POST"}}},uploadFileField:{type:String,default:"file"},uploadFileName:{type:[String,Function]},uploadFormData:{type:FormData,default:function(){return new FormData}},cropperOptions:{type:Object,default:function(){return{aspectRatio:1,autoCropArea:1,viewMode:1,movable:!1,zoomable:!1}}},outputOptions:{type:Object},outputMime:{type:String,default:null},outputQuality:{type:Number,default:.9},mimes:{type:String,default:"image/png, image/gif, image/jpeg, image/bmp, image/x-icon"},capture:{type:String},labels:{type:Object,default:function(){return{submit:"Ok",cancel:"Cancel"}}},inline:{type:Boolean,default:!1}},data:function(){return{cropper:void 0,dataUrl:void 0,fileName:void 0,mimeType:void 0}},computed:{cleanedMimes:function(){if(!this.mimes)throw new Error("vue-avatar-cropper: mimes prop cannot be empty");return this.mimes.trim().toLowerCase()}},watch:{modelValue:function(n){n&&(this.file?this.onFileChange(this.file):this.pickImage(),this.$emit("update:modelValue",!1))}},mounted:function(){this.$emit("update:modelValue",!1)},methods:{destroy:function(){this.cropper&&this.cropper.destroy(),this.$refs.input&&(this.$refs.input.value=""),this.dataUrl=void 0},submit:function(){this.$emit("submit"),this.uploadUrl?this.uploadImage():this.uploadHandler?this.uploadHandler(this.cropper):this.$emit("error",{type:"user",message:"No upload handler found"}),this.destroy()},cancel:function(){this.$emit("cancel"),this.destroy()},onImgElementError:function(){this.$emit("error",{type:"load",message:"File loading failed"}),this.destroy()},pickImage:function(){this.$refs.input&&this.$refs.input.click()},onFileChange:function(n){var e=this;if(this.cleanedMimes==="image/*"){if(n.type.split("/")[0]!=="image")return void this.$emit("error",{type:"user",message:"File type not correct"})}else if(this.cleanedMimes){var t=this.cleanedMimes.split(", ").find(function(i){return i===n.type});if(!t)return void this.$emit("error",{type:"user",message:"File type not correct"})}var r=new FileReader;r.onload=function(i){e.dataUrl=i.target.result},r.readAsDataURL(n),this.fileName=n.name||"unknown",this.mimeType=n.type,this.$emit("changed",{file:n,reader:r})},onFileInputChange:function(n){n.target.files&&n.target.files[0]&&this.onFileChange(n.target.files[0])},createCropper:function(){this.cropper=new Mu(this.$refs.img,this.cropperOptions)},getFilename:function(n){var e=mk.getExtension(n.type);if(!this.uploadFileName){var t=this.fileName,r=this.fileName.split(".");return r.length>1&&(t=r.slice(0,-1).join(".")),"".concat(t,".").concat(e)}return typeof this.uploadFileName=="string"?this.uploadFileName:typeof this.uploadFileName=="function"?this.uploadFileName({filename:this.fileName,mime:n.type,extension:e}):"unknown.".concat(e)},uploadImage:function(){var n=this;this.cropper.getCroppedCanvas(this.outputOptions).toBlob(function(){var e=vw(qd.mark(function t(r){var i,o,a,s,c,d,u,p,f;return qd.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:for(o in i=new FormData,n.uploadFormData.entries())a=yw(o,2),s=a[0],c=a[1],i.append(s,c);return i.append(n.uploadFileField,r,n.getFilename(r)),d=Object.assign({body:i},n.requestOptions),u=new Request(n.uploadUrl,d),p=fetch(u),n.$emit("uploading",{form:i,request:u,response:p}),h.next=9,p;case 9:f=h.sent,n.$emit("completed",{form:i,request:u,response:f}),f.ok?n.$emit("uploaded",{form:i,request:u,response:f}):n.$emit("error",{type:"upload",message:"Image upload fail",context:{request:u,response:f}});case 12:case"end":return h.stop()}},t)}));return function(t){return e.apply(this,arguments)}}(),this.outputMime||this.mimeType,this.outputQuality)}}}),gk={class:"avatar-cropper"},yk={key:0,class:"avatar-cropper-mark"},vk=["title"],bk={class:"avatar-cropper-container"},wk={class:"avatar-cropper-image-container"},kk=["src"],xk={class:"avatar-cropper-footer"},Ck=["accept","capture"];(function(n,e){e===void 0&&(e={});var t=e.insertAt;if(n&&typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",t==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(document.createTextNode(n))}})(`.avatar-cropper .avatar-cropper-overlay {
|
|
13
13
|
text-align: center;
|
|
14
14
|
display: flex;
|
|
15
15
|
align-items: center;
|
|
@@ -69,18 +69,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
69
69
|
.avatar-cropper .avatar-cropper-container .avatar-cropper-footer .avatar-cropper-btn:hover {
|
|
70
70
|
background-color: #2aabd2;
|
|
71
71
|
color: #fff; }
|
|
72
|
-
`),Ho.render=function(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",xk,[n.dataUrl?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["avatar-cropper-overlay",{"avatar-cropper-overlay-inline":n.inline}])},[n.inline?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",Ck,[l.createElementVNode("a",{onClick:e[0]||(e[0]=function(){return n.cancel&&n.cancel.apply(n,arguments)}),class:"avatar-cropper-close",title:n.labels.cancel,href:"javascript:;"}," × ",8,Mk)])),l.createElementVNode("div",Sk,[l.createElementVNode("div",Tk,[l.createElementVNode("img",{ref:"img",src:n.dataUrl,alt:"",onLoad:e[1]||(e[1]=l.withModifiers(function(){return n.createCropper&&n.createCropper.apply(n,arguments)},["stop"])),onError:e[2]||(e[2]=function(){return n.onImgElementError&&n.onImgElementError.apply(n,arguments)})},null,40,Dk)]),l.createElementVNode("div",Ak,[l.createElementVNode("button",{onClick:e[3]||(e[3]=l.withModifiers(function(){return n.cancel&&n.cancel.apply(n,arguments)},["stop","prevent"])),class:"avatar-cropper-btn"},l.toDisplayString(n.labels.cancel),1),l.createElementVNode("button",{onClick:e[4]||(e[4]=l.withModifiers(function(){return n.submit&&n.submit.apply(n,arguments)},["stop","prevent"])),class:"avatar-cropper-btn"},l.toDisplayString(n.labels.submit),1)])])],2)):l.createCommentVNode("",!0),n.file?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",{key:1,accept:n.cleanedMimes,capture:n.capture,class:"avatar-cropper-img-input",ref:"input",type:"file",onChange:e[5]||(e[5]=function(){return n.onFileInputChange&&n.onFileInputChange.apply(n,arguments)})},null,40,Ok))])},Ho.install=function(n){n.component("avatar-cropper",Ho)};const Ek={name:"GenericImageCropper",props:{personID:{type:Number,default:1}},components:{AvatarCropper:Ho},data(){return{showCropper:!1,userPicUrl:""}},mounted(){this.getImgUrl(this.personID)},watch:{personID:{immediate:!0,handler(n,e){this.getImgUrl(n)}}},methods:{getImgUrl(n){this.userPicUrl="../../../../src/assets/select-tournament.png"},setShowCropper(){this.showCropper=!0},handleUploading(){this.userPicUrl="./uploads/default.jpeg",this.message="uploading..."},handleUploaded(n){n.response.status===200&&this.getImgUrl(this.personID)},handleCompleted(){this.message="upload completed."},handlerError(n,e,t){console.error(`${n} ${e} ${t}`),this.message="Oops! Something went wrong..."}}},Nk={class:""},_k=["src","alt"];function Bk(n,e,t,r,i,o){const a=l.resolveComponent("avatar-cropper");return l.openBlock(),l.createElementBlock("section",Nk,[l.createElementVNode("img",{class:"h-40 w-96 border-2 border-dashed rounded-lg",src:i.userPicUrl,onError:e[0]||(e[0]=()=>{}),alt:t.personID,onClick:e[1]||(e[1]=s=>o.setShowCropper())},null,40,_k),l.createVNode(a,{onUploading:o.handleUploading,onUploaded:o.handleUploaded,onCompleted:o.handleCompleted,onError:o.handlerError,modelValue:i.showCropper,"onUpdate:modelValue":e[2]||(e[2]=s=>i.showCropper=s),"upload-url":`./uploads/${t.personID}`,"cropper-options":{aspectRatio:8/3,autoCropArea:1,viewMode:1,movable:!0,zoomable:!0}},null,8,["onUploading","onUploaded","onCompleted","onError","modelValue","upload-url"])])}const Tu=Le(Ek,[["render",Bk]]);function st(n){this.content=n}st.prototype={constructor:st,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new st(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new st(t)},addToStart:function(n,e){return new st([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new st(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new st(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=st.from(n),n.size?new st(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=st.from(n),n.size?new st(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=st.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},st.from=function(n){if(n instanceof st)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new st(e)};function Du(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=Du(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Au(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let a=n.child(--i),s=e.child(--o),c=a.nodeSize;if(a==s){t-=c,r-=c;continue}if(!a.sameMarkup(s))return{a:t,b:r};if(a.isText&&a.text!=s.text){let d=0,u=Math.min(a.text.length,s.text.length);for(;d<u&&a.text[a.text.length-d-1]==s.text[s.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(a.content.size||s.content.size){let d=Au(a.content,s.content,t-1,r-1);if(d)return d}t-=c,r-=c}}class Q{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let a=0,s=0;s<t;a++){let c=this.content[a],d=s+c.nodeSize;if(d>e&&r(c,i+s,o||null,a)!==!1&&c.content.size){let u=s+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),r,i+u)}s=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",a=!0;return this.nodesBetween(e,t,(s,c)=>{s.isText?(o+=s.text.slice(Math.max(e,c)-c,t-c),a=!r):s.isLeaf?(i?o+=typeof i=="function"?i(s):i:s.type.spec.leafText&&(o+=s.type.spec.leafText(s)),a=!r):!a&&s.isBlock&&(o+=r,a=!0)},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new Q(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let s=this.content[o],c=a+s.nodeSize;c>e&&((a<e||c>t)&&(s.isText?s=s.cut(Math.max(0,e-a),Math.min(s.text.length,t-a)):s=s.cut(Math.max(0,e-a-1),Math.min(s.content.size,t-a-1))),r.push(s),i+=s.nodeSize),a=c}return new Q(r,i)}cutByIndex(e,t){return e==t?Q.empty:e==0&&t==this.content.length?this:new Q(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new Q(i,o)}addToStart(e){return new Q([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Q(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Du(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Au(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Yo(0,e);if(e==this.size)return Yo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||t>0?Yo(r+1,a):Yo(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return Q.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new Q(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Q.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new Q(t||e,r)}static from(e){if(!e)return Q.empty;if(e instanceof Q)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Q([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Q.empty=new Q([],0);const js={index:0,offset:0};function Yo(n,e){return js.index=n,js.offset=e,js}function jo(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!jo(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!jo(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Be=class mc{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&jo(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return mc.none;if(e instanceof mc)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Be.none=[];class Uo extends Error{}class ie{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Eu(this.content,e+this.openStart,t);return r&&new ie(r,this.openStart,this.openEnd)}removeBetween(e,t){return new ie(Ou(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return ie.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ie(Q.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new ie(e,r,i)}}ie.empty=new ie(Q.empty,0,0);function Ou(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:a,offset:s}=n.findIndex(t);if(i==e||o.isText){if(s!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Ou(o.content,e-i-1,t-i-1)))}function Eu(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),a=n.maybeChild(i);if(o==e||a.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let s=Eu(a.content,e-o-1,t);return s&&n.replaceChild(i,a.copy(s))}function Pk(n,e,t){if(t.openStart>n.depth)throw new Uo("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Uo("Inconsistent open depths");return Nu(n,e,t,0)}function Nu(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=Nu(n,e,t,r+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,s=a.content;return xr(a,s.cut(0,n.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:a,end:s}=Ik(t,n);return xr(o,Bu(n,a,s,e,r))}else return xr(o,Wo(n,e,r))}function _u(n,e){if(!e.type.compatibleContent(n.type))throw new Uo("Cannot join "+e.type.name+" onto "+n.type.name)}function Us(n,e,t){let r=n.node(t);return _u(r,e.node(t)),r}function kr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Wi(n,e,t,r){let i=(e||n).node(t),o=0,a=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(kr(n.nodeAfter,r),o++));for(let s=o;s<a;s++)kr(i.child(s),r);e&&e.depth==t&&e.textOffset&&kr(e.nodeBefore,r)}function xr(n,e){return n.type.checkContent(e),n.copy(e)}function Bu(n,e,t,r,i){let o=n.depth>i&&Us(n,e,i+1),a=r.depth>i&&Us(t,r,i+1),s=[];return Wi(null,n,i,s),o&&a&&e.index(i)==t.index(i)?(_u(o,a),kr(xr(o,Bu(n,e,t,r,i+1)),s)):(o&&kr(xr(o,Wo(n,e,i+1)),s),Wi(e,t,i,s),a&&kr(xr(a,Wo(t,r,i+1)),s)),Wi(r,null,i,s),new Q(s)}function Wo(n,e,t){let r=[];if(Wi(null,n,t,r),n.depth>t){let i=Us(n,e,t+1);kr(xr(i,Wo(n,e,t+1)),r)}return Wi(e,null,t,r),new Q(r)}function Ik(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(Q.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class qi{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Be.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new qo(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let a=e;;){let{index:s,offset:c}=a.content.findIndex(o),d=o-c;if(r.push(a,s,i+c),!d||(a=a.child(s),a.isText))break;o=d-1,i+=c+1}return new qi(t,r,o)}static resolveCached(e,t){for(let i=0;i<Ws.length;i++){let o=Ws[i];if(o.pos==t&&o.doc==e)return o}let r=Ws[qs]=qi.resolve(e,t);return qs=(qs+1)%Rk,r}}let Ws=[],qs=0,Rk=12;class qo{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Vk=Object.create(null);let Cr=class gc{constructor(e,t,r,i=Be.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||Q.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&jo(this.attrs,t||e.defaultAttrs||Vk)&&Be.sameSet(this.marks,r||Be.none)}copy(e=null){return e==this.content?this:new gc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new gc(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return ie.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),s=i.start(a),d=i.node(a).content.cut(i.pos-s,o.pos-s);return new ie(d,i.depth-a,o.depth-a)}replace(e,t,r){return Pk(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return qi.resolveCached(this,e)}resolveNoCache(e){return qi.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Pu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=Q.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Be.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Be.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=Q.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Cr.prototype.text=void 0;class Ko extends Cr{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Pu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ko(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ko(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Pu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Mr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new $k(e,t);if(r.next==null)return Mr.empty;let i=Iu(r);r.next&&r.err("Unexpected trailing text");let o=Uk(jk(i));return Wk(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(a,s){let c=a.matchFragment(e,r);if(c&&(!t||c.validEnd))return Q.from(s.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:u,next:f}=a.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let p=o(f,s.concat(u));if(p)return p}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:c}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||c.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
|
|
73
|
-
`)}}Mr.empty=new Mr(!0);class $k{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Iu(n){let e=[];do e.push(Lk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Lk(n){let e=[];do e.push(Fk(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Fk(n){let e=Yk(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=zk(n,e);else break;return e}function Ru(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function zk(n,e){let t=Ru(n),r=t;return n.eat(",")&&(n.next!="}"?r=Ru(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Hk(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let a=t[o];a.groups.indexOf(e)>-1&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Yk(n){if(n.eat("(")){let e=Iu(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Hk(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function jk(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,s,c){let d={term:c,to:s};return e[a].push(d),d}function i(a,s){a.forEach(c=>c.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((c,d)=>c.concat(o(d,s)),[]);if(a.type=="seq")for(let c=0;;c++){let d=o(a.exprs[c],s);if(c==a.exprs.length-1)return d;i(d,s=t())}else if(a.type=="star"){let c=t();return r(s,c),i(o(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=t();return i(o(a.expr,s),c),i(o(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let c=s;for(let d=0;d<a.min;d++){let u=t();i(o(a.expr,c),u),c=u}if(a.max==-1)i(o(a.expr,c),c);else for(let d=a.min;d<a.max;d++){let u=t();r(c,u),i(o(a.expr,c),u),c=u}return[r(c)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Vu(n,e){return e-n}function $u(n,e){let t=[];return r(e),t.sort(Vu);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:s,to:c}=o[a];!s&&t.indexOf(c)==-1&&r(c)}}}function Uk(n){let e=Object.create(null);return t($u(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:s,to:c})=>{if(!s)return;let d;for(let u=0;u<i.length;u++)i[u][0]==s&&(d=i[u][1]);$u(n,c).forEach(u=>{d||i.push([s,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new Mr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(Vu);o.next.push({type:i[a][0],next:e[s.join(",")]||t(s)})}return o}}function Wk(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:c,next:d}=i.next[s];a.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Lu(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Fu(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function zu(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new qk(n[t]);return e}let Hu=class Zh{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=zu(r.attrs),this.defaultAttrs=Lu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Mr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Fu(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Cr(this,this.computeAttrs(e),Q.from(t),Be.setFrom(r))}createChecked(e=null,t,r){return t=Q.from(t),this.checkContent(t),new Cr(this,this.computeAttrs(e),t,Be.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=Q.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(Q.empty,!0);return o?new Cr(this,e,t.append(o),Be.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Be.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new Zh(o,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class qk{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Go{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=zu(i.attrs),this.excluded=null;let o=Lu(this.attrs);this.instance=o?new Be(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Be(this,Fu(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Go(o,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class Kk{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=st.from(e.nodes),t.marks=st.from(e.marks||{}),this.nodes=Hu.compile(this.spec.nodes,this),this.marks=Go.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;o.contentMatch=r[a]||(r[a]=Mr.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=s=="_"?null:s?Yu(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:Yu(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Hu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Ko(r,r.defaultAttrs,e,Be.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Cr.fromJSON(this,e)}markFromJSON(e){return Be.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Yu(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],a=o;if(o)t.push(o);else for(let s in n.marks){let c=n.marks[s];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class Xr{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new qu(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new qu(this,t,!0);return r.addAll(e,t.from,t.to),ie.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(Jk(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(a.getAttrs){let c=a.getAttrs(t);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let s=t[a];if((s.priority==null?50:s.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Ku(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Ku(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xr(e,Xr.schemaRules(e)))}}const ju={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Gk={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Uu={ol:!0,ul:!0},Qo=1,Jo=2,Ki=4;function Wu(n,e,t){return e!=null?(e?Qo:0)|(e==="full"?Jo:0):n&&n.whitespace=="pre"?Qo|Jo:t&~Ki}class Xo{constructor(e,t,r,i,o,a,s){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=Be.none,this.stashMarks=[],this.match=a||(s&Ki?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(Q.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Qo)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=Q.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(Q.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):Zk(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ju.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class qu{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=Wu(null,t.preserveWhitespace,0)|(r?Ki:0);i?o=new Xo(i.type,i.attrs,Be.none,Be.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new Xo(null,null,Be.none,Be.none,!0,null,a):o=new Xo(e.schema.topNodeType,null,Be.none,Be.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let r=e.getAttribute("style");if(!r)return t();let i=this.readStyles(Xk(r));if(!i)return;let[o,a]=i,s=this.top;for(let c=0;c<a.length;c++)this.removePendingMark(a[c],s);for(let c=0;c<o.length;c++)this.addPendingMark(o[c]);t();for(let c=0;c<o.length;c++)this.removePendingMark(o[c],s);for(let c=0;c<a.length;c++)this.addPendingMark(a[c])}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&Jo||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&Qo)r.options&Jo?t=t.replace(/\r\n?/g,`
|
|
74
|
-
`):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;Uu.hasOwnProperty(r)&&this.parser.normalizeLists&&
|
|
75
|
-
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Be.none,r=Be.none;for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(e[i],e[i+1],this,o);if(!a)break;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(s=>{a.clearMark(s)&&(r=s.addToSet(r))}):t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),a.consuming===!1)o=a;else break}return[t,r]}addElementByRule(e,t,r){let i,o,a;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c)}i&&this.sync(s)&&this.open--,a&&this.removePendingMark(a,s)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,a=r==null?null:e.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,r=o,!a.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let a=Wu(e,i,o.options);o.options&Ki&&o.content.length==0&&(a|=Ki),this.nodes.push(new Xo(e,t,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,c)=>{for(;s>=0;s--){let d=t[s];if(d==""){if(s==t.length-1||s==0)continue;for(;c>=o;c--)if(a(s-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&u.groups.indexOf(d)==-1)return!1;c--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=ex(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let a=i.popFromStashMark(e);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==t)break}}}function Qk(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Uu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Jk(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Xk(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function Ku(n){let e={};for(let t in n)e[t]=n[t];return e}function Zk(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],a=s=>{o.push(s);for(let c=0;c<s.edgeCount;c++){let{type:d,next:u}=s.edge(c);if(d==e||o.indexOf(u)<0&&a(u))return!0}};if(a(i.contentMatch))return!0}}function ex(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class gn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Ks(t).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let s=0,c=0;for(;s<o.length&&c<a.marks.length;){let d=a.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[s][0])||d.type.spec.spanning===!1)break;s++,c++}for(;s<o.length;)i=o.pop()[1];for(;c<a.marks.length;){let d=a.marks[c++],u=this.serializeMark(d,a.isInline,t);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=gn.renderSpec(Ks(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&gn.renderSpec(Ks(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,s=r?e.createElementNS(r,i):e.createElement(i),c=t[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let f=u.indexOf(" ");f>0?s.setAttributeNS(u.slice(0,f),u.slice(f+1),c[u]):s.setAttribute(u,c[u])}}for(let u=d;u<t.length;u++){let f=t[u];if(f===0){if(u<t.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}else{let{dom:p,contentDOM:h}=gn.renderSpec(e,f,r);if(s.appendChild(p),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:s,contentDOM:a}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new gn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Gu(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Gu(e.marks)}}function Gu(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Ks(n){return n.document||window.document}const Qu=65535,Ju=Math.pow(2,16);function tx(n,e){return n+e*Ju}function Xu(n){return n&Qu}function nx(n){return(n-(n&Qu))/Ju}const Zu=1,ef=2,Zo=4,tf=8;class Gs{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&tf)>0}get deletedBefore(){return(this.delInfo&(Zu|Zo))>0}get deletedAfter(){return(this.delInfo&(ef|Zo))>0}get deletedAcross(){return(this.delInfo&Zo)>0}}class Nt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Nt.empty)return Nt.empty}recover(e){let t=0,r=Xu(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+nx(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let c=this.ranges[s]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[s+o],u=this.ranges[s+a],f=c+d;if(e<=f){let p=d?e==c?-1:e==f?1:t:t,h=c+i+(p<0?0:u);if(r)return h;let m=e==(t<0?c:f)?null:tx(s/3,e-c),v=e==c?ef:e==f?Zu:Zo;return(t<0?e!=c:e!=f)&&(v|=tf),new Gs(h,v,m)}i+=u-d}return r?e+i:new Gs(e+i,0,null)}touches(e,t){let r=0,i=Xu(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let c=this.ranges[s]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[s+o],u=c+d;if(e<=u&&s==i*3)return!0;r+=this.ranges[s+a]-d}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),c=a+(this.inverted?0:o),d=this.ranges[i+t],u=this.ranges[i+r];e(s,s+d,c,c+u),o+=u-d}}invert(){return new Nt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Nt.empty:new Nt(e<0?[0,-e,0]:[0,0,e])}}Nt.empty=new Nt([]);class Zr{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Zr(this.maps,this.mirror,e,t)}copy(){return new Zr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Zr;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(e,t);if(s.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new Gs(e,i,null)}}const Qs=Object.create(null);class ut{getMap(){return Nt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Qs[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Qs)throw new RangeError("Duplicate use of step JSON ID "+e);return Qs[e]=t,t.prototype.jsonID=e,t}}class Ke{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Ke(e,null)}static fail(e){return new Ke(null,e)}static fromReplace(e,t,r,i){try{return Ke.ok(e.replace(t,r,i))}catch(o){if(o instanceof Uo)return Ke.fail(o.message);throw o}}}function Js(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Js(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return Q.fromArray(r)}class qn extends ut{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new ie(Js(t.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return Ke.fromReplace(e,this.from,this.to,o)}invert(){return new yn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new qn(t.pos,r.pos,this.mark)}merge(e){return e instanceof qn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new qn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new qn(t.from,t.to,e.markFromJSON(t.mark))}}ut.jsonID("addMark",qn);class yn extends ut{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new ie(Js(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Ke.fromReplace(e,this.from,this.to,r)}invert(){return new qn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new yn(t.pos,r.pos,this.mark)}merge(e){return e instanceof yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new yn(t.from,t.to,e.markFromJSON(t.mark))}}ut.jsonID("removeMark",yn);class Kn extends ut{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ke.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ke.fromReplace(e,this.pos,this.pos+1,new ie(Q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Kn(this.pos,t.marks[i]);return new Kn(this.pos,this.mark)}}return new ei(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Kn(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Kn(t.pos,e.markFromJSON(t.mark))}}ut.jsonID("addNodeMark",Kn);class ei extends ut{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ke.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ke.fromReplace(e,this.pos,this.pos+1,new ie(Q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Kn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ei(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ei(t.pos,e.markFromJSON(t.mark))}}ut.jsonID("removeNodeMark",ei);class lt extends ut{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Xs(e,this.from,this.to)?Ke.fail("Structure replace would overwrite content"):Ke.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Nt([this.from,this.to-this.from,this.slice.size])}invert(e){return new lt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new lt(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof lt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?ie.empty:new ie(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new lt(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?ie.empty:new ie(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new lt(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new lt(t.from,t.to,ie.fromJSON(e,t.slice),!!t.structure)}}ut.jsonID("replace",lt);class nt extends ut{constructor(e,t,r,i,o,a,s=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(e){if(this.structure&&(Xs(e,this.from,this.gapFrom)||Xs(e,this.gapTo,this.to)))return Ke.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ke.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Ke.fromReplace(e,this.from,this.to,r):Ke.fail("Content does not fit in gap")}getMap(){return new Nt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new nt(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new nt(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new nt(t.from,t.to,t.gapFrom,t.gapTo,ie.fromJSON(e,t.slice),t.insert,!!t.structure)}}ut.jsonID("replaceAround",nt);function Xs(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function rx(n,e,t,r){let i=[],o=[],a,s;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let f=c.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let p=Math.max(d,e),h=Math.min(d+c.nodeSize,t),m=r.addToSet(f);for(let v=0;v<f.length;v++)f[v].isInSet(m)||(a&&a.to==p&&a.mark.eq(f[v])?a.to=h:i.push(a=new yn(p,h,f[v])));s&&s.to==p?s.to=h:o.push(s=new qn(p,h,r))}}),i.forEach(c=>n.step(c)),o.forEach(c=>n.step(c))}function ix(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(a,s)=>{if(!a.isInline)return;o++;let c=null;if(r instanceof Go){let d=a.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let d=Math.min(s+a.nodeSize,t);for(let u=0;u<c.length;u++){let f=c[u],p;for(let h=0;h<i.length;h++){let m=i[h];m.step==o-1&&f.eq(i[h].style)&&(p=m)}p?(p.to=d,p.step=o):i.push({style:f,from:Math.max(s,e),to:d,step:o})}}}),i.forEach(a=>n.step(new yn(a.from,a.to,a.style)))}function ox(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],a=e+1;for(let s=0;s<i.childCount;s++){let c=i.child(s),d=a+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new lt(a,d,ie.empty));else{r=u;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new yn(a,d,c.marks[f]));if(c.isText&&!t.spec.code){let f,p=/\r?\n|\r/g,h;for(;f=p.exec(c.text);)h||(h=new ie(Q.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new lt(a+f.index,a+f.index+f[0].length,h))}}a=d}if(!r.validEnd){let s=r.fillBefore(Q.empty,!0);n.replace(a,a,new ie(s,0,0))}for(let s=o.length-1;s>=0;s--)n.step(o[s])}function ax(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function ti(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,a,t))return r;if(r==0||i.type.spec.isolating||!ax(i,o,a))break}return null}function sx(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),s=i.after(o+1),c=a,d=s,u=Q.empty,f=0;for(let m=o,v=!1;m>t;m--)v||r.index(m)>0?(v=!0,u=Q.from(r.node(m).copy(u)),f++):c--;let p=Q.empty,h=0;for(let m=o,v=!1;m>t;m--)v||i.after(m+1)<i.end(m)?(v=!0,p=Q.from(i.node(m).copy(p)),h++):d++;n.step(new nt(c,d,a,s,new ie(u.append(p),f,h),u.size-f,!0))}function Zs(n,e,t=null,r=n){let i=lx(n,e),o=i&&cx(r,e);return o?i.map(nf).concat({type:e,attrs:t}).concat(o.map(nf)):null}function nf(n){return{type:n,attrs:null}}function lx(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(r,i,a)?o:null}function cx(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let c=(a.length?a[a.length-1]:e).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(t.child(d).type);return!c||!c.validEnd?null:a}function dx(n,e,t){let r=Q.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let s=t[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Q.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new nt(i,o,i,o,new ie(r,0,0),t.length,!0))}function ux(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(a,s)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&fx(n.doc,n.mapping.slice(o).map(s),r)){n.clearIncompatible(n.mapping.slice(o).map(s,1),r);let c=n.mapping.slice(o),d=c.map(s,1),u=c.map(s+a.nodeSize,1);return n.step(new nt(d,u,d+1,u-1,new ie(Q.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function fx(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function px(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let a=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new nt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new ie(Q.from(a),0,0),1,!0))}function ni(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=t-2;d>o;d--,u--){let f=i.node(d),p=i.index(d);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(p,f.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let v=r&&r[u]||f;if(!f.canReplace(p+1,f.childCount)||!v.type.validContent(h))return!1}let s=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(s,s,c?c.type:i.node(o+1).type)}function hx(n,e,t=1,r){let i=n.doc.resolve(e),o=Q.empty,a=Q.empty;for(let s=i.depth,c=i.depth-t,d=t-1;s>c;s--,d--){o=Q.from(i.node(s).copy(o));let u=r&&r[d];a=Q.from(u?u.type.create(u.attrs,a):i.node(s).copy(a))}n.step(new lt(e,e,new ie(o.append(a),t,t),!0))}function Gn(n,e){let t=n.resolve(e),r=t.index();return rf(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function rf(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function ea(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):t>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&rf(o,a)&&r.node(i).canReplace(s,s+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function mx(n,e,t){let r=new lt(e-t,e+t,ie.empty,!0);n.step(r)}function gx(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function of(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(s>0?1:0),d=r.node(a),u=!1;if(o==1)u=d.canReplace(c,c,i);else{let f=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=f&&d.canReplaceWith(c,c,f[0])}if(u)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}function el(n,e,t=e,r=ie.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return af(i,o,r)?new lt(e,t,r):new yx(i,o,r).fit()}function af(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class yx{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=Q.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=Q.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let c=new ie(o,a,s);return e>-1?new nt(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new lt(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=tl(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:c,match:d}=this.frontier[s],u,f=null;if(t==1&&(a?d.matchType(a.type)||(f=d.fillBefore(Q.from(a),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:f};if(t==2&&a&&(u=d.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=tl(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new ie(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=tl(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new ie(Gi(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new ie(Gi(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let v=0;v<o.length;v++)this.openFrontierNode(o[v]);let a=this.unplaced,s=r?r.content:a.content,c=a.openStart-e,d=0,u=[],{match:f,type:p}=this.frontier[t];if(i){for(let v=0;v<i.childCount;v++)u.push(i.child(v));f=f.matchFragment(i)}let h=s.size+e-(a.content.size-a.openEnd);for(;d<s.childCount;){let v=s.child(d),w=f.matchType(v.type);if(!w)break;d++,(d>1||c==0||v.content.size)&&(f=w,u.push(sf(v.mark(p.allowedMarks(v.marks)),d==1?c:0,d==s.childCount?h:-1)))}let m=d==s.childCount;m||(h=-1),this.placed=Qi(this.placed,t,Q.from(u)),this.frontier[t].match=f,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let v=0,w=s;v<h;v++){let x=w.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),w=x.content}this.unplaced=m?e==0?ie.empty:new ie(Gi(a.content,e-1,1),e-1,h<0?a.openEnd:e-1):new ie(Gi(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!nl(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=nl(e,t,i,r,o);if(a){for(let s=t-1;s>=0;s--){let{match:c,type:d}=this.frontier[s],u=nl(e,s,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Qi(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Qi(this.placed,this.depth,Q.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(Q.empty,!0);t.childCount&&(this.placed=Qi(this.placed,this.frontier.length,t))}}function Gi(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Gi(n.firstChild.content,e-1,t)))}function Qi(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Qi(n.lastChild.content,e-1,t)))}function tl(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function sf(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,sf(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(Q.empty,!0)))),n.copy(r)}function nl(n,e,t,r,i){let o=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==o.childCount&&!t.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!vx(t,o.content,a)?s:null}function vx(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function bx(n){return n.spec.defining||n.spec.definingForContent}function wx(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(af(i,o,r))return n.step(new lt(e,t,r));let a=cf(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let s=-(i.depth+1);a.unshift(s);for(let p=i.depth,h=i.pos-1;p>0;p--,h--){let m=i.node(p).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(p)>-1?s=p:i.before(p)==h&&a.splice(1,0,-p)}let c=a.indexOf(s),d=[],u=r.openStart;for(let p=r.content,h=0;;h++){let m=p.firstChild;if(d.push(m),h==r.openStart)break;p=m.content}for(let p=u-1;p>=0;p--){let h=d[p],m=bx(h.type);if(m&&!h.sameMarkup(i.node(Math.abs(s)-1)))u=p;else if(m||!h.type.isTextblock)break}for(let p=r.openStart;p>=0;p--){let h=(p+u+1)%(r.openStart+1),m=d[h];if(m)for(let v=0;v<a.length;v++){let w=a[(v+c)%a.length],x=!0;w<0&&(x=!1,w=-w);let C=i.node(w-1),N=i.index(w-1);if(C.canReplaceWith(N,N,m.type,m.marks))return n.replace(i.before(w),x?o.after(w):t,new ie(lf(r.content,0,r.openStart,h),h,r.openEnd))}}let f=n.steps.length;for(let p=a.length-1;p>=0&&(n.replace(e,t,r),!(n.steps.length>f));p--){let h=a[p];h<0||(e=i.before(h),t=o.after(h))}}function lf(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(lf(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(n).append(n);n=a.append(o.matchFragment(a).fillBefore(Q.empty,!0))}return n}function kx(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=gx(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new ie(Q.from(r),0,0))}function xx(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=cf(r,i);for(let a=0;a<o.length;a++){let s=o[a],c=a==o.length-1;if(c&&s==0||r.node(s).type.contentMatch.validEnd)return n.delete(r.start(s),i.end(s));if(s>0&&(c||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return n.delete(r.before(s),i.after(s))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a)return n.delete(r.before(a),t);n.delete(e,t)}function cf(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class ri extends ut{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ke.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Ke.fromReplace(e,this.pos,this.pos+1,new ie(Q.from(i),0,t.isLeaf?0:1))}getMap(){return Nt.empty}invert(e){return new ri(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ri(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ri(t.pos,t.attr,t.value)}}ut.jsonID("attr",ri);class Ji extends ut{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Ke.ok(r)}getMap(){return Nt.empty}invert(e){return new Ji(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Ji(t.attr,t.value)}}ut.jsonID("docAttr",Ji);let ii=class extends Error{};ii=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},ii.prototype=Object.create(Error.prototype),ii.prototype.constructor=ii,ii.prototype.name="TransformError";class Cx{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Zr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new ii(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=ie.empty){let i=el(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new ie(Q.from(r),0,0))}delete(e,t){return this.replace(e,t,ie.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return wx(this,e,t,r),this}replaceRangeWith(e,t,r){return kx(this,e,t,r),this}deleteRange(e,t){return xx(this,e,t),this}lift(e,t){return sx(this,e,t),this}join(e,t=1){return mx(this,e,t),this}wrap(e,t){return dx(this,e,t),this}setBlockType(e,t=e,r,i=null){return ux(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return px(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new ri(e,t,r)),this}setDocAttribute(e,t){return this.step(new Ji(e,t)),this}addNodeMark(e,t){return this.step(new Kn(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Be)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new ei(e,t)),this}split(e,t=1,r){return hx(this,e,t,r),this}addMark(e,t,r){return rx(this,e,t,r),this}removeMark(e,t,r){return ix(this,e,t,r),this}clearIncompatible(e,t,r){return ox(this,e,t,r),this}}const rl=Object.create(null);class ye{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new Mx(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=ie.empty){let r=t.content.lastChild,i=null;for(let s=0;s<t.openEnd;s++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:c,$to:d}=a[s],u=e.mapping.slice(o);e.replaceRange(u.map(c.pos),u.map(d.pos),s?ie.empty:t),s==0&&ff(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:s}=i[o],c=e.mapping.slice(r),d=c.map(a.pos),u=c.map(s.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,t),ff(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new ge(e):oi(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=t<0?oi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):oi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Zt(e.node(0))}static atStart(e){return oi(e,e,0,0,1)||new Zt(e)}static atEnd(e){return oi(e,e,e.content.size,e.childCount,-1)||new Zt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=rl[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in rl)throw new RangeError("Duplicate use of selection JSON ID "+e);return rl[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ge.between(this.$anchor,this.$head).getBookmark()}}ye.prototype.visible=!0;class Mx{constructor(e,t){this.$from=e,this.$to=t}}let df=!1;function uf(n){!df&&!n.parent.inlineContent&&(df=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class ge extends ye{constructor(e,t=e){uf(e),uf(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ye.near(r);let i=e.resolve(t.map(this.anchor));return new ge(i.parent.inlineContent?i:r,r)}replace(e,t=ie.empty){if(super.replace(e,t),t==ie.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ge&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ta(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ge(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=ye.findFrom(t,r,!0)||ye.findFrom(t,-r,!0);if(o)t=o.$head;else return ye.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ye.findFrom(e,-r,!0)||ye.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new ge(e,t)}}ye.jsonID("text",ge);class ta{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ta(e.map(this.anchor),e.map(this.head))}resolve(e){return ge.between(e.resolve(this.anchor),e.resolve(this.head))}}class ue extends ye{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?ye.near(o):new ue(o)}content(){return new ie(Q.from(this.node),0,0)}eq(e){return e instanceof ue&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new il(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new ue(e.resolve(t.anchor))}static create(e,t){return new ue(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}ue.prototype.visible=!1,ye.jsonID("node",ue);class il{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new ta(r,r):new il(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&ue.isSelectable(r)?new ue(t):ye.near(t)}}class Zt extends ye{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=ie.empty){if(t==ie.empty){e.delete(0,e.doc.content.size);let r=ye.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Zt(e)}map(e){return new Zt(e)}eq(e){return e instanceof Zt}getBookmark(){return Sx}}ye.jsonID("all",Zt);const Sx={map(){return this},resolve(n){return new Zt(n)}};function oi(n,e,t,r,i,o=!1){if(e.inlineContent)return ge.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let s=e.child(a);if(s.isAtom){if(!o&&ue.isSelectable(s))return ue.create(n,t-(i<0?s.nodeSize:0))}else{let c=oi(n,s,t+i,i<0?s.childCount:0,i,o);if(c)return c}t+=s.nodeSize*i}return null}function ff(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof lt||i instanceof nt))return;let o=n.mapping.maps[r],a;o.forEach((s,c,d,u)=>{a==null&&(a=u)}),n.setSelection(ye.near(n.doc.resolve(a),t))}const pf=1,na=2,hf=4;class Tx extends Cx{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|pf)&~na,this.storedMarks=null,this}get selectionSet(){return(this.updated&pf)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=na,this}ensureMarks(e){return Be.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&na)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~na,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Be.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let a=this.doc.resolve(t);o=r==t?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(ye.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=hf,this}get scrolledIntoView(){return(this.updated&hf)>0}}function mf(n,e){return!e||!n?n:n.bind(e)}class Xi{constructor(e,t,r){this.name=e,this.init=mf(t.init,r),this.apply=mf(t.apply,r)}}const Dx=[new Xi("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Xi("selection",{init(n,e){return n.selection||ye.atStart(e.doc)},apply(n){return n.selection}}),new Xi("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Xi("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class ol{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Dx.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Xi(r.key,r.spec.state,r))})}}class ai{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let s=this.config.plugins[a];if(s.spec.appendTransaction){let c=i?i[a].n:0,d=i?i[a].state:this,u=c<t.length&&s.spec.appendTransaction.call(s,c?t.slice(c):t,d,r);if(u&&r.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<a?{state:r,n:t.length}:{state:this,n:0})}t.push(u),r=r.applyInner(u),o=!0}i&&(i[a]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new ai(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new Tx(this)}static create(e){let t=new ol(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ai(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new ol(this.schema,e.plugins),r=t.fields,i=new ai(t);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new ol(e.schema,e.plugins),o=new ai(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=Cr.fromJSON(e.schema,t.doc);else if(a.name=="selection")o.selection=ye.fromJSON(o.doc,t.selection);else if(a.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let s in r){let c=r[s],d=c.spec.state;if(c.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,s)){o[a.name]=d.fromJSON.call(c,e,t[s],o);return}}o[a.name]=a.init(e,o)}}),o}}function gf(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=gf(i,e,{})),t[r]=i}return t}class Mt{constructor(e){this.spec=e,this.props={},e.props&&gf(e.props,this,this.props),this.key=e.key?e.key.key:yf("plugin")}getState(e){return e[this.key]}}const al=Object.create(null);function yf(n){return n in al?n+"$"+ ++al[n]:(al[n]=0,n+"$")}class vn{constructor(e="key"){this.key=yf(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const yt=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Zi=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let vf=null;const An=function(n,e,t){let r=vf||(vf=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Sr=function(n,e,t,r){return t&&(bf(n,e,t,r,-1)||bf(n,e,t,r,1))},Ax=/^(img|br|input|textarea|hr)$/i;function bf(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:bn(n))){let o=n.parentNode;if(!o||o.nodeType!=1||sl(n)||Ax.test(n.nodeName)||n.contentEditable=="false")return!1;e=yt(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?bn(n):0}else return!1}}function bn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ox(n,e,t){for(let r=e==0,i=e==bn(n);r||i;){if(n==t)return!0;let o=yt(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==bn(n)}}function sl(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const ra=function(n){return n.focusNode&&Sr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Tr(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function Ex(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Nx(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const wn=typeof navigator<"u"?navigator:null,wf=typeof document<"u"?document:null,Qn=wn&&wn.userAgent||"",ll=/Edge\/(\d+)/.exec(Qn),kf=/MSIE \d/.exec(Qn),cl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qn),St=!!(kf||cl||ll),Jn=kf?document.documentMode:cl?+cl[1]:ll?+ll[1]:0,en=!St&&/gecko\/(\d+)/i.test(Qn);en&&+(/Firefox\/(\d+)/.exec(Qn)||[0,0])[1];const dl=!St&&/Chrome\/(\d+)/.exec(Qn),ft=!!dl,_x=dl?+dl[1]:0,vt=!St&&!!wn&&/Apple Computer/.test(wn.vendor),si=vt&&(/Mobile\/\w+/.test(Qn)||!!wn&&wn.maxTouchPoints>2),Vt=si||(wn?/Mac/.test(wn.platform):!1),Bx=wn?/Win/.test(wn.platform):!1,tn=/Android \d/.test(Qn),eo=!!wf&&"webkitFontSmoothing"in wf.documentElement.style,Px=eo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ix(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function On(n,e){return typeof n=="number"?n:n[e]}function Rx(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function xf(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let a=t||n.dom;a;a=Zi(a)){if(a.nodeType!=1)continue;let s=a,c=s==o.body,d=c?Ix(o):Rx(s),u=0,f=0;if(e.top<d.top+On(r,"top")?f=-(d.top-e.top+On(i,"top")):e.bottom>d.bottom-On(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+On(i,"top")-d.top:e.bottom-d.bottom+On(i,"bottom")),e.left<d.left+On(r,"left")?u=-(d.left-e.left+On(i,"left")):e.right>d.right-On(r,"right")&&(u=e.right-d.right+On(i,"right")),u||f)if(c)o.defaultView.scrollBy(u,f);else{let p=s.scrollLeft,h=s.scrollTop;f&&(s.scrollTop+=f),u&&(s.scrollLeft+=u);let m=s.scrollLeft-p,v=s.scrollTop-h;e={left:e.left-m,top:e.top-v,right:e.right-m,bottom:e.bottom-v}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function Vx(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,a=t+1;a<Math.min(innerHeight,e.bottom);a+=5){let s=n.root.elementFromPoint(o,a);if(!s||s==n.dom||!n.dom.contains(s))continue;let c=s.getBoundingClientRect();if(c.top>=t-20){r=s,i=c.top;break}}return{refDOM:r,refTop:i,stack:Cf(n.dom)}}function Cf(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Zi(r));return e}function $x({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Mf(t,r==0?0:r-e)}function Mf(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:o}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let li=null;function Lx(n){if(n.setActive)return n.setActive();if(li)return n.focus(li);let e=Cf(n);n.focus(li==null?{get preventScroll(){return li={preventScroll:!0},!0}}:void 0),li||(li=!1,Mf(e,0))}function Sf(n,e){let t,r=2e8,i,o=0,a=e.top,s=e.top,c,d;for(let u=n.firstChild,f=0;u;u=u.nextSibling,f++){let p;if(u.nodeType==1)p=u.getClientRects();else if(u.nodeType==3)p=An(u).getClientRects();else continue;for(let h=0;h<p.length;h++){let m=p[h];if(m.top<=a&&m.bottom>=s){a=Math.max(m.bottom,a),s=Math.min(m.top,s);let v=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(v<r){t=u,r=v,i=v&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&v&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!t&&c&&(t=c,i=d,r=0),t&&t.nodeType==3?Fx(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:Sf(t,i)}function Fx(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i<t;i++){r.setEnd(n,i+1),r.setStart(n,i);let o=Xn(r,1);if(o.top!=o.bottom&&ul(e,o))return{node:n,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function ul(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function zx(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function Hx(n,e,t){let{node:r,offset:i}=Sf(e,t),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&t.left>(a.left+a.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function Yx(n,e,t,r){let i=-1;for(let o=e,a=!1;o!=n.dom;){let s=n.docView.nearestDesc(o,!0);if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent&&!a||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!a&&(a=!0,c.left>r.left||c.top>r.top?i=s.posBefore:(c.right<r.left||c.bottom<r.top)&&(i=s.posAfter)),!s.contentDOM&&i<0&&!s.node.isText)return(s.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?s.posBefore:s.posAfter}o=s.dom.parentNode}return i>-1?i:n.docView.posFromDOM(e,t,-1)}function Tf(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=i;;){let a=n.childNodes[o];if(a.nodeType==1){let s=a.getClientRects();for(let c=0;c<s.length;c++){let d=s[c];if(ul(e,d))return Tf(a,e,d)}}if((o=(o+1)%r)==i)break}return n}function jx(n,e){let t=n.dom.ownerDocument,r,i=0,o=Nx(t,e.left,e.top);o&&({node:r,offset:i}=o);let a=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),s;if(!a||!n.dom.contains(a.nodeType!=1?a.parentNode:a)){let d=n.dom.getBoundingClientRect();if(!ul(e,d)||(a=Tf(n.dom,e,d),!a))return null}if(vt)for(let d=a;r&&d;d=Zi(d))d.draggable&&(r=void 0);if(a=zx(a,e),r){if(en&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let d;eo&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?s=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(s=Yx(n,r,i,e))}s==null&&(s=Hx(n,a,e));let c=n.docView.nearestDesc(a,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Df(n){return n.top<n.bottom||n.left<n.right}function Xn(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(Df(r))return r}return Array.prototype.find.call(t,Df)||n.getBoundingClientRect()}const Ux=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Af(n,e,t){let{node:r,offset:i,atom:o}=n.docView.domFromPos(e,t<0?-1:1),a=eo||en;if(r.nodeType==3)if(a&&(Ux.test(r.nodeValue)||(t<0?!i:i==r.nodeValue.length))){let c=Xn(An(r,i,i),t);if(en&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Xn(An(r,i-1,i-1),-1);if(d.top==c.top){let u=Xn(An(r,i,i+1),-1);if(u.top!=c.top)return to(u,u.left<d.left)}}return c}else{let c=i,d=i,u=t<0?1:-1;return t<0&&!i?(d++,u=-1):t>=0&&i==r.nodeValue.length?(c--,u=1):t<0?c--:d++,to(Xn(An(r,c,d),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==bn(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return fl(c.getBoundingClientRect(),!1)}if(o==null&&i<bn(r)){let c=r.childNodes[i];if(c.nodeType==1)return fl(c.getBoundingClientRect(),!0)}return fl(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==bn(r))){let c=r.childNodes[i-1],d=c.nodeType==3?An(c,bn(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return to(Xn(d,1),!1)}if(o==null&&i<bn(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?An(c,0,a?0:1):c.nodeType==1?c:null:null;if(d)return to(Xn(d,-1),!0)}return to(Xn(r.nodeType==3?An(r):r,-t),t>=0)}function to(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function fl(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Of(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function Wx(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return Of(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let s=n.docView.nearestDesc(o,!0);if(!s)break;if(s.node.isBlock){o=s.contentDOM||s.dom;break}o=s.dom.parentNode}let a=Af(n,i.pos,1);for(let s=o.firstChild;s;s=s.nextSibling){let c;if(s.nodeType==1)c=s.getClientRects();else if(s.nodeType==3)c=An(s,0,s.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(t=="up"?a.top-u.top>(u.bottom-a.top)*2:u.bottom-a.bottom>(a.bottom-u.top)*2))return!1}}return!0})}const qx=/[\u0590-\u08ac]/;function Kx(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=n.domSelection();return!qx.test(r.parent.textContent)||!s.modify?t=="left"||t=="backward"?o:a:Of(n,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:f}=n.domSelectionRange(),p=s.caretBidiLevel;s.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:v}=n.domSelectionRange(),w=m&&!h.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==v;try{s.collapse(u,f),c&&(c!=u||d!=f)&&s.extend&&s.extend(c,d)}catch{}return p!=null&&(s.caretBidiLevel=p),w})}let Ef=null,Nf=null,_f=!1;function Gx(n,e,t){return Ef==e&&Nf==t?_f:(Ef=e,Nf=t,_f=t=="up"||t=="down"?Wx(n,e,t):Kx(n,e,t))}const $t=0,Bf=1,Dr=2,kn=3;class no{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=$t,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,a;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>yt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!t||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],s=o+a.size;if(s>e||a instanceof Rf){i=e-o;break}o=s}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Pf&&o.side>=0;r--);if(t<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&t&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?yt(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?yt(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,s=0;;s++){let c=this.children[s],d=a+c.size;if(i==-1&&e<=d){let u=a+c.border;if(e>=u&&t<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,u);e=a;for(let f=s;f>0;f--){let p=this.children[f-1];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(1)){i=yt(p.dom)+1;break}e-=p.size}i==-1&&(i=0)}if(i>-1&&(d>t||s==this.children.length-1)){t=d;for(let u=s+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=yt(f.dom);break}t+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let o=Math.min(e,t),a=Math.max(e,t);for(let p=0,h=0;p<this.children.length;p++){let m=this.children[p],v=h+m.size;if(o>h&&a<v)return m.setSelection(e-h-m.border,t-h-m.border,r,i);h=v}let s=this.domFromPos(e,e?-1:1),c=t==e?s:this.domFromPos(t,t?-1:1),d=r.getSelection(),u=!1;if((en||vt)&&e==t){let{node:p,offset:h}=s;if(p.nodeType==3){if(u=!!(h&&p.nodeValue[h-1]==`
|
|
76
|
-
`),u&&h==p.nodeValue.length)for(let m=p,v;m;m=m.parentNode){if(v=m.nextSibling){v.nodeName=="BR"&&(s=c={node:v.parentNode,offset:yt(v)+1});break}let w=m.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let m=p.childNodes[h-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(en&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let p=d.focusNode.childNodes[d.focusOffset];p&&p.contentEditable=="false"&&(i=!0)}if(!(i||u&&vt)&&Sr(s.node,s.offset,d.anchorNode,d.anchorOffset)&&Sr(c.node,c.offset,d.focusNode,d.focusOffset))return;let f=!1;if((d.extend||e==t)&&!u){d.collapse(s.node,s.offset);try{e!=t&&d.extend(c.node,c.offset),f=!0}catch{}}if(!f){if(e>t){let h=s;s=c,c=h}let p=document.createRange();p.setEnd(c.node,c.offset),p.setStart(s.node,s.offset),d.removeAllRanges(),d.addRange(p)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?e<=a&&t>=r:e<a&&t>r){let s=r+o.border,c=a-o.border;if(e>=s&&t<=c){this.dirty=e==r||t==a?Dr:Bf,e==s&&t==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=kn:o.markDirty(e-s,t-s);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Dr:kn}r=a}this.dirty=Dr}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Dr:Bf;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Pf extends no{constructor(e,t,r,i){let o,a=t.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(a.nodeType!=1){let s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==$t&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Qx extends no{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Ar extends no{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],a=o&&o(t,i,r);return(!a||!a.dom)&&(a=gn.renderSpec(document,t.type.spec.toDOM(t,r))),new Ar(e,t,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&kn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=kn&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=$t){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=$t}}slice(e,t,r){let i=Ar.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;t<a&&(o=ml(o,t,a,r)),e>0&&(o=ml(o,0,e,r));for(let s=0;s<o.length;s++)o[s].parent=i;return i.children=o,i}}class Zn extends no{constructor(e,t,r,i,o,a,s,c,d){super(e,[],o,a),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=s}static create(e,t,r,i,o,a){let s=o.nodeViews[t.type.name],c,d=s&&s(t,o,()=>{if(!c)return a;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=d&&d.dom,f=d&&d.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=gn.renderSpec(document,t.type.spec.toDOM(t)));!f&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let p=u;return u=Lf(u,r,t),d?c=new Jx(e,t,r,i,u,f||null,p,d,o,a+1):t.isText?new ia(e,t,r,i,u,p,o):new Zn(e,t,r,i,u,f||null,p,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Q.empty)}return e}matchesNode(e,t,r){return this.dirty==$t&&e.eq(this.node)&&hl(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,a=o&&o.pos>-1?o:null,s=o&&o.pos<0,c=new Zx(this,a&&a.node,e);n1(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!f&&c.syncToMarks(u==this.node.childCount?Be.none:this.node.child(u).marks,r,e),c.placeWidget(d,e,i)},(d,u,f,p)=>{c.syncToMarks(d.marks,r,e);let h;c.findNodeMatch(d,u,f,p)||s&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(h=c.findIndexWithChild(o.node))>-1&&c.updateNodeAt(d,u,f,h,e)||c.updateNextNode(d,u,f,e,p,i)||c.addNode(d,u,f,e,i),i+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Dr)&&(a&&this.protectLocalComposition(e,a),Vf(this.contentDOM,this.children,e),si&&r1(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ge)||r<t||i>t+this.node.content.size)return null;let o=e.domSelectionRange(),a=i1(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let s=a.nodeValue,c=o1(this.node.content,s,r-t,i-t);return c<0?null:{node:a,pos:c,text:s}}else return{node:a,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new Qx(this,o,t,i);e.input.compositionNodes.push(a),this.children=ml(this.children,r,r+i.length,e,a)}update(e,t,r,i){return this.dirty==kn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=$t}updateOuterDeco(e){if(hl(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=$f(this.dom,this.nodeDOM,pl(this.outerDeco,this.node,t),pl(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function If(n,e,t,r,i){Lf(r,e,n);let o=new Zn(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ia extends Zn{constructor(e,t,r,i,o,a,s){super(e,t,r,i,o,null,a,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==kn||this.dirty!=$t&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=$t||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=$t,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new ia(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=kn)}get domAtom(){return!1}}class Rf extends no{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==$t&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Jx extends Zn{constructor(e,t,r,i,o,a,s,c,d,u){super(e,t,r,i,o,a,s,d,u),this.spec=c}update(e,t,r,i){if(this.dirty==kn)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Vf(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o<e.length;o++){let a=e[o],s=a.dom;if(s.parentNode==n){for(;s!=r;)r=Ff(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(s,r);if(a instanceof Ar){let c=r?r.previousSibling:n.lastChild;Vf(a.contentDOM,a.children,t),r=c?c.nextSibling:n.firstChild}}for(;r;)r=Ff(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const ro=function(n){n&&(this.nodeName=n)};ro.prototype=Object.create(null);const Or=[new ro];function pl(n,e,t){if(n.length==0)return Or;let r=t?Or[0]:new ro,i=[r];for(let o=0;o<n.length;o++){let a=n[o].type.attrs;if(a){a.nodeName&&i.push(r=new ro(a.nodeName));for(let s in a){let c=a[s];c!=null&&(t&&i.length==1&&i.push(r=new ro(e.isInline?"span":"div")),s=="class"?r.class=(r.class?r.class+" ":"")+c:s=="style"?r.style=(r.style?r.style+";":"")+c:s!="nodeName"&&(r[s]=c))}}}return i}function $f(n,e,t,r){if(t==Or&&r==Or)return e;let i=e;for(let o=0;o<r.length;o++){let a=r[o],s=t[o];if(o){let c;s&&s.nodeName==a.nodeName&&i!=n&&(c=i.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(i),s=Or[0]),i=c}Xx(i,s||Or[0],a)}return i}function Xx(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&n.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&n.classList.add(i[o]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)n.style.removeProperty(i[1])}t.style&&(n.style.cssText+=t.style)}}function Lf(n,e,t){return $f(n,n,Or,pl(e,t,n.nodeType!=1))}function hl(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function Ff(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Zx{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=e1(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let i=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=$t,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let s=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){s=c;break}}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{let c=Ar.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,r))o=this.top.children.indexOf(a,this.index);else for(let s=this.index,c=Math.min(this.top.children.length,s+5);s<c;s++){let d=this.top.children[s];if(d.matchesNode(e,t,r)&&!this.preMatch.matched.has(d)){o=s;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,r,i,o){let a=this.top.children[i];return a.dirty==kn&&a.dom==a.contentDOM&&(a.dirty=Dr),a.update(e,t,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,o,a){for(let s=this.index;s<this.top.children.length;s++){let c=this.top.children[s];if(c instanceof Zn){let d=this.preMatch.matched.get(c);if(d!=null&&d!=o)return!1;let u=c.dom,f,p=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=kn&&hl(t,c.outerDeco));if(!p&&c.update(e,t,r,i))return this.destroyBetween(this.index,s),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!p&&(f=this.recreateWrapper(c,e,t,r,i,a)))return this.top.children[this.index]=f,f.contentDOM&&(f.dirty=Dr,f.updateChildren(i,a+1),f.dirty=$t),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,o,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=Zn.create(this.top,t,r,i,o,a);if(s.contentDOM){s.children=e.children,e.children=[];for(let c of s.children)c.parent=s}return e.destroy(),s}addNode(e,t,r,i,o){let a=Zn.create(this.top,e,t,r,i,o);a.contentDOM&&a.updateChildren(i,o+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new Pf(this.top,e,t,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Ar;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ia)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((vt||ft)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Rf(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function e1(n,e){let t=e,r=t.children.length,i=n.childCount,o=new Map,a=[];e:for(;i>0;){let s;for(;;)if(r){let d=t.children[r-1];if(d instanceof Ar)t=d,r=d.children.length;else{s=d,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let c=s.node;if(c){if(c!=n.child(i-1))break;--i,o.set(s,i),a.push(s)}}return{index:i,matched:o,matches:a.reverse()}}function t1(n,e){return n.type.side-e.type.side}function n1(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let d=0;d<n.childCount;d++){let u=n.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let a=0,s=[],c=null;for(let d=0;;){let u,f;for(;a<i.length&&i[a].to==o;){let w=i[a++];w.widget&&(u?(f||(f=[u])).push(w):u=w)}if(u)if(f){f.sort(t1);for(let w=0;w<f.length;w++)t(f[w],d,!!c)}else t(u,d,!!c);let p,h;if(c)h=-1,p=c,c=null;else if(d<n.childCount)h=d,p=n.child(d++);else break;for(let w=0;w<s.length;w++)s[w].to<=o&&s.splice(w--,1);for(;a<i.length&&i[a].from<=o&&i[a].to>o;)s.push(i[a++]);let m=o+p.nodeSize;if(p.isText){let w=m;a<i.length&&i[a].from<w&&(w=i[a].from);for(let x=0;x<s.length;x++)s[x].to<w&&(w=s[x].to);w<m&&(c=p.cut(w-o),p=p.cut(0,w-o),m=w,h=-1)}let v=p.isInline&&!p.isLeaf?s.filter(w=>!w.inline):s.slice();r(p,v,e.forChild(o,p),h),o=m}}function r1(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function i1(n,e){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0){if(n.childNodes.length>e&&n.childNodes[e].nodeType==3)return n.childNodes[e];n=n.childNodes[e-1],e=bn(n)}else if(n.nodeType==1&&e<n.childNodes.length)n=n.childNodes[e],e=0;else return null}}function o1(n,e,t,r){for(let i=0,o=0;i<n.childCount&&o<=r;){let a=n.child(i++),s=o;if(o+=a.nodeSize,!a.isText)continue;let c=a.text;for(;i<n.childCount;){let d=n.child(i++);if(o+=d.nodeSize,!d.isText)break;c+=d.text}if(o>=t){if(o>=r&&c.slice(r-e.length-s,r-s)==e)return r-e.length;let d=s<r?c.lastIndexOf(e,r-s-1):-1;if(d>=0&&d+e.length+s>=t)return s+d;if(t==r&&c.length>=r+e.length-s&&c.slice(r-s,r-s+e.length)==e)return r}}return-1}function ml(n,e,t,r,i){let o=[];for(let a=0,s=0;a<n.length;a++){let c=n[a],d=s,u=s+=c.size;d>=t||u<=e?o.push(c):(d<e&&o.push(c.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>t&&o.push(c.slice(t-d,c.size,r)))}return o}function gl(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let s=r.resolve(a),c,d;if(ra(t)){for(c=s;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&ue.isSelectable(u)&&i.parent&&!(u.isInline&&Ox(t.focusNode,t.focusOffset,i.dom))){let f=i.posBefore;d=new ue(a==f?s:r.resolve(f))}}else{let u=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null;c=r.resolve(u)}if(!d){let u=e=="pointer"||n.state.selection.head<s.pos&&!o?1:-1;d=vl(n,c,s,u)}return d}function zf(n){return n.editable?n.hasFocus():Kf(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function En(n,e=!1){let t=n.state.selection;if(Uf(n,t),!!zf(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&ft){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Sr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)s1(n);else{let{anchor:r,head:i}=t,o,a;Hf&&!(t instanceof ge)&&(t.$from.parent.inlineContent||(o=Yf(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=Yf(n,t.to))),n.docView.setSelection(r,i,n.root,e),Hf&&(o&&jf(o),a&&jf(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&a1(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const Hf=vt||ft&&_x<63;function Yf(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(vt&&i&&i.contentEditable=="false")return yl(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return yl(i);if(o)return yl(o)}}function yl(n){return n.contentEditable="true",vt&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function jf(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function a1(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!zf(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function s1(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,yt(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&St&&Jn<=11&&(r.disabled=!0,r.disabled=!1)}function Uf(n,e){if(e instanceof ue){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Wf(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Wf(n)}function Wf(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function vl(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||ge.between(e,t,r)}function qf(n){return n.editable&&!n.hasFocus()?!1:Kf(n)}function Kf(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function l1(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Sr(e.node,e.offset,t.anchorNode,t.anchorOffset)}function bl(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ye.findFrom(o,e)}function er(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Gf(n,e,t){let r=n.state.selection;if(r instanceof ge)if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return er(n,new ge(r.$anchor,a))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=bl(n.state,e);return i&&i instanceof ue?er(n,i):!1}else if(!(Vt&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let s=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=n.docView.descAt(s))&&!a.contentDOM?ue.isSelectable(o)?er(n,new ue(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):eo?er(n,new ge(n.state.doc.resolve(e<0?s:s+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof ue&&r.node.isInline)return er(n,new ge(e>0?r.$to:r.$from));{let i=bl(n.state,e);return i?er(n,i):!1}}}function oa(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function io(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function ci(n,e){return e<0?c1(n):d1(n)}function c1(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(en&&t.nodeType==1&&r<oa(t)&&io(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let s=t.childNodes[r-1];if(io(s,-1))i=t,o=--r;else if(s.nodeType==3)t=s,r=t.nodeValue.length;else break}}else{if(Qf(t))break;{let s=t.previousSibling;for(;s&&io(s,-1);)i=t.parentNode,o=yt(s),s=s.previousSibling;if(s)t=s,r=oa(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?wl(n,t,r):i&&wl(n,i,o)}function d1(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=oa(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let s=t.childNodes[r];if(io(s,1))o=t,a=++r;else break}else{if(Qf(t))break;{let s=t.nextSibling;for(;s&&io(s,1);)o=s.parentNode,a=yt(s)+1,s=s.nextSibling;if(s)t=s,r=0,i=oa(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&wl(n,o,a)}function Qf(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function u1(n,e){for(;n&&e==n.childNodes.length&&!sl(n);)e=yt(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function f1(n,e){for(;n&&!e&&!sl(n);)e=yt(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function wl(n,e,t){if(e.nodeType!=3){let o,a;(a=u1(e,t))?(e=a,t=0):(o=f1(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(ra(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&En(n)},50)}function Jf(n,e){let t=n.state.doc.resolve(e);if(!(ft||Bx)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<t.end()){let o=n.coordsAtPos(e+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Xf(n,e,t){let r=n.state.selection;if(r instanceof ge&&!r.empty||t.indexOf("s")>-1||Vt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=bl(n.state,e);if(a&&a instanceof ue)return er(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,s=r instanceof Zt?ye.near(a,e):ye.findFrom(a,e);return s?er(n,s):!1}return!1}function Zf(n,e){if(!(n.state.selection instanceof ge))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let a=n.state.tr;return e<0?a.delete(t.pos-o.nodeSize,t.pos):a.delete(t.pos,t.pos+o.nodeSize),n.dispatch(a),!0}return!1}function ep(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function p1(n){if(!vt||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;ep(n,r,"true"),setTimeout(()=>ep(n,r,"false"),20)}return!1}function h1(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function m1(n,e){let t=e.keyCode,r=h1(e);if(t==8||Vt&&t==72&&r=="c")return Zf(n,-1)||ci(n,-1);if(t==46&&!e.shiftKey||Vt&&t==68&&r=="c")return Zf(n,1)||ci(n,1);if(t==13||t==27)return!0;if(t==37||Vt&&t==66&&r=="c"){let i=t==37?Jf(n,n.state.selection.from)=="ltr"?-1:1:-1;return Gf(n,i,r)||ci(n,i)}else if(t==39||Vt&&t==70&&r=="c"){let i=t==39?Jf(n,n.state.selection.from)=="ltr"?1:-1:1;return Gf(n,i,r)||ci(n,i)}else{if(t==38||Vt&&t==80&&r=="c")return Xf(n,-1,r)||ci(n,-1);if(t==40||Vt&&t==78&&r=="c")return p1(n)||Xf(n,1,r)||ci(n,1);if(r==(Vt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function tp(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let a=n.someProp("clipboardSerializer")||gn.fromSchema(n.state.schema),s=cp(),c=s.createElement("div");c.appendChild(a.serializeFragment(r,{document:s}));let d=c.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=sp[d.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let m=s.createElement(u[h]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),f++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(t)}`);let p=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,`
|
|
77
|
-
|
|
78
|
-
`);return{dom:c,text:
|
|
79
|
-
`))),0,0):ie.empty;let f=n.someProp("clipboardTextParser",p=>p(e,i,r,n));if(f)s=f;else{let p=i.marks(),{schema:h}=n.state,m=gn.fromSchema(h);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(v=>{let w=a.appendChild(document.createElement("p"));v&&w.appendChild(m.serializeNode(h.text(v,p)))})}}else n.someProp("transformPastedHTML",f=>{t=f(t,n)}),a=v1(t),eo&&b1(a);let d=a&&a.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let p=a.firstChild;for(;p&&p.nodeType!=1;)p=p.nextSibling;if(!p)break;a=p}if(s||(s=(n.someProp("clipboardParser")||n.someProp("domParser")||Xr.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(p){return p.nodeName=="BR"&&!p.nextSibling&&p.parentNode&&!g1.test(p.parentNode.nodeName)?{ignore:!0}:null}})),u)s=w1(ap(s,+u[1],+u[2]),u[4]);else if(s=ie.maxOpen(y1(s.content,i),!0),s.openStart||s.openEnd){let f=0,p=0;for(let h=s.content.firstChild;f<s.openStart&&!h.type.spec.isolating;f++,h=h.firstChild);for(let h=s.content.lastChild;p<s.openEnd&&!h.type.spec.isolating;p++,h=h.lastChild);s=ap(s,f,p)}return n.someProp("transformPasted",f=>{s=f(s,n)}),s}const g1=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function y1(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,a=[];if(n.forEach(s=>{if(!a)return;let c=i.findWrapping(s.type),d;if(!c)return a=null;if(d=a.length&&o.length&&ip(c,o,s,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=op(a[a.length-1],o.length));let u=rp(s,c);a.push(u),i=i.matchType(u.type),o=c}}),a)return Q.from(a)}return n}function rp(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,Q.from(n));return n}function ip(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=ip(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(Q.from(rp(t,n,i+1))))}}function op(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,op(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(Q.empty,!0);return n.copy(t.append(r))}function kl(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,s=a.content;return n.childCount>1&&(o=0),i<r-1&&(s=kl(s,e,t,r,i+1,o)),i>=t&&(s=e<0?a.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(Q.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(s))}function ap(n,e,t){return e<n.openStart&&(n=new ie(kl(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new ie(kl(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const sp={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let lp=null;function cp(){return lp||(lp=document.implementation.createHTMLDocument("title"))}function v1(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=cp().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&sp[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=n,i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function b1(n){let e=n.querySelectorAll(ft?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function w1(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:a}=n;for(let s=r.length-2;s>=0;s-=2){let c=t.nodes[r[s]];if(!c||c.hasRequiredAttrs())break;i=Q.from(c.create(r[s+1],i)),o++,a++}return new ie(i,o,a)}const bt={},wt={},k1={touchstart:!0,touchmove:!0};class x1{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function C1(n){for(let e in bt){let t=bt[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{S1(n,r)&&!Cl(n,r)&&(n.editable||!(r.type in wt))&&t(n,r)},k1[e]?{passive:!0}:void 0)}vt&&n.dom.addEventListener("input",()=>null),xl(n)}function tr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function M1(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function xl(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Cl(n,r))})}function Cl(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function S1(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function T1(n,e){!Cl(n,e)&&bt[e.type]&&(n.editable||!(e.type in wt))&&bt[e.type](n,e)}wt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!up(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(tn&&ft&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),si&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Tr(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||m1(n,t)?t.preventDefault():tr(n,"key")},wt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},wt.keypress=(n,e)=>{let t=e;if(up(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Vt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof ge)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function aa(n){return{left:n.clientX,top:n.clientY}}function D1(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Ml(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(n.someProp(e,s=>a>o.depth?s(n,t,o.nodeAfter,o.before(a),i,!0):s(n,t,o.node(a),o.before(a),i,!1)))return!0;return!1}function di(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function A1(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&ue.isSelectable(r)?(di(n,new ue(t),"pointer"),!0):!1}function O1(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof ue&&(r=t.node);let o=n.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let s=a>o.depth?o.nodeAfter:o.node(a);if(ue.isSelectable(s)){r&&t.$from.depth>0&&a>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(a);break}}return i!=null?(di(n,ue.create(n.state.doc,i),"pointer"),!0):!1}function E1(n,e,t,r,i){return Ml(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?O1(n,t):A1(n,t))}function N1(n,e,t,r){return Ml(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function _1(n,e,t,r){return Ml(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||B1(n,t,r)}function B1(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(di(n,ge.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)di(n,ge.create(r,s+1,s+1+a.content.size),"pointer");else if(ue.isSelectable(a))di(n,ue.create(r,s),"pointer");else continue;return!0}}function Sl(n){return sa(n)}const dp=Vt?"metaKey":"ctrlKey";bt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Sl(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&D1(t,n.input.lastClick)&&!t[dp]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let a=n.posAtCoords(aa(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new P1(n,a,t,!!r)):(o=="doubleClick"?N1:_1)(n,a.pos,a.inside,t)?t.preventDefault():tr(n,"pointer"))};class P1{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[dp],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,a=u.depth?u.before():0}const s=i?null:r.target,c=s?e.docView.nearestDesc(s,!0):null;this.target=c?c.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof ue&&d.from<=a&&d.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&en&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),tr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>En(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(aa(e))),this.updateAllowDefault(e),this.allowDefault||!t?tr(this.view,"pointer"):E1(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||vt&&this.mightDrag&&!this.mightDrag.node.isAtom||ft&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(di(this.view,ye.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):tr(this.view,"pointer")}move(e){this.updateAllowDefault(e),tr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}bt.touchstart=n=>{n.input.lastTouch=Date.now(),Sl(n),tr(n,"pointer")},bt.touchmove=n=>{n.input.lastTouch=Date.now(),tr(n,"pointer")},bt.contextmenu=n=>Sl(n);function up(n,e){return n.composing?!0:vt&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const I1=tn?5e3:-1;wt.compositionstart=wt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),sa(n,!0),n.markCursor=null;else if(sa(n),en&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){n.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}n.input.composing=!0}fp(n,I1)},wt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,fp(n,20))};function fp(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>sa(n),e))}function pp(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=R1());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function R1(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function sa(n,e=!1){if(!(tn&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),pp(n),e||n.docView&&n.docView.dirty){let t=gl(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function V1(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const oo=St&&Jn<15||si&&Px<604;bt.copy=wt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=oo?null:t.clipboardData,a=r.content(),{dom:s,text:c}=tp(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",c)):V1(n,s),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function $1(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function L1(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?ao(n,r.value,null,i,e):ao(n,r.textContent,r.innerHTML,i,e)},50)}function ao(n,e,t,r,i){let o=np(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,o||ie.empty)))return!0;if(!o)return!1;let a=$1(o),s=a?n.state.tr.replaceSelectionWith(a,r):n.state.tr.replaceSelection(o);return n.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function hp(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}wt.paste=(n,e)=>{let t=e;if(n.composing&&!tn)return;let r=oo?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&ao(n,hp(r),r.getData("text/html"),i,t)?t.preventDefault():L1(n,t)};class mp{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const gp=Vt?"altKey":"ctrlKey";bt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(aa(t)),a;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof ue?i.to-1:i.to))){if(r&&r.mightDrag)a=ue.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let u=n.docView.nearestDesc(t.target,!0);u&&u.node.type.spec.draggable&&u!=n.docView&&(a=ue.create(n.state.doc,u.posBefore))}}let s=(a||n.state.selection).content(),{dom:c,text:d}=tp(n,s);t.dataTransfer.clearData(),t.dataTransfer.setData(oo?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",oo||t.dataTransfer.setData("text/plain",d),n.dragging=new mp(s,!t[gp],a)},bt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},wt.dragover=wt.dragenter=(n,e)=>e.preventDefault(),wt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(aa(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",m=>{a=m(a,n)}):a=np(n,hp(t.dataTransfer),oo?null:t.dataTransfer.getData("text/html"),!1,o);let s=!!(r&&!t[gp]);if(n.someProp("handleDrop",m=>m(n,t,a||ie.empty,s))){t.preventDefault();return}if(!a)return;t.preventDefault();let c=a?of(n.state.doc,o.pos,a):o.pos;c==null&&(c=o.pos);let d=n.state.tr;if(s){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),f=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,p=d.doc;if(f?d.replaceRangeWith(u,u,a.content.firstChild):d.replaceRange(u,u,a),d.doc.eq(p))return;let h=d.doc.resolve(u);if(f&&ue.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new ue(h));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((v,w,x,C)=>m=C),d.setSelection(vl(n,h,d.doc.resolve(m)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))},bt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&En(n)},20))},bt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},bt.beforeinput=(n,e)=>{if(ft&&tn&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Tr(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in wt)bt[n]=wt[n];function so(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class la{constructor(e,t){this.toDOM=e,this.spec=t||Er,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new Lt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof la&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&so(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class nr{constructor(e,t){this.attrs=e,this.spec=t||Er}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new Lt(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof nr&&so(this.attrs,e.attrs)&&so(this.spec,e.spec)}static is(e){return e.type instanceof nr}destroy(){}}class Tl{constructor(e,t){this.attrs=e,this.spec=t||Er}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=o.pos?null:new Lt(o.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof Tl&&so(this.attrs,e.attrs)&&so(this.spec,e.spec)}destroy(){}}class Lt{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Lt(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Lt(e,e,new la(t,r))}static inline(e,t,r,i){return new Lt(e,t,new nr(r,i))}static node(e,t,r,i){return new Lt(e,t,new Tl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof nr}get widget(){return this.type instanceof la}}const ui=[],Er={};class Ze{constructor(e,t){this.local=e.length?e:ui,this.children=t.length?t:ui}static create(e,t){return t.length?ca(t,e,0,Er):pt}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&r.push(s.copy(s.from+i,s.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let s=this.children[a]+1;this.children[a+2].findInner(e-s,t-s,r,i+s,o)}}map(e,t,r){return this==pt||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Er)}mapInner(e,t,r,i,o){let a;for(let s=0;s<this.local.length;s++){let c=this.local[s].map(e,r,i);c&&c.type.valid(t,c)?(a||(a=[])).push(c):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?F1(this.children,a||[],e,t,r,i,o):a?new Ze(a.sort(Nr),ui):pt}add(e,t){return t.length?this==pt?Ze.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((s,c)=>{let d=c+r,u;if(u=vp(t,s,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(s,u,d+1):i.splice(o,0,c,c+s.nodeSize,ca(u,s,d+1,Er)),o+=3}});let a=yp(o?bp(t):t,-r);for(let s=0;s<a.length;s++)a[s].type.valid(e,a[s])||a.splice(s--,1);return new Ze(a.length?this.local.concat(a).sort(Nr):this.local,i||this.children)}remove(e){return e.length==0||this==pt?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,s=r[o]+t,c=r[o+1]+t;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>s&&f.to<c&&(e[u]=null,(a||(a=[])).push(f));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(a,s+1);d!=pt?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<e.length;o++)if(a=e[o])for(let s=0;s<i.length;s++)i[s].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(s--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ze(i,r):pt}forChild(e,t){if(this==pt)return this;if(t.isLeaf)return Ze.empty;let r,i;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(r=this.children[s+2]);break}let o=e+1,a=o+t.content.size;for(let s=0;s<this.local.length;s++){let c=this.local[s];if(c.from<a&&c.to>o&&c.type instanceof nr){let d=Math.max(o,c.from)-o,u=Math.min(a,c.to)-o;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let s=new Ze(i.sort(Nr),ui);return r?new rr([s,r]):s}return r||pt}eq(e){if(this==e)return!0;if(!(e instanceof Ze)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Dl(this.localsInner(e))}localsInner(e){if(this==pt)return ui;if(e.inlineContent||!this.local.some(nr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof nr||t.push(this.local[r]);return t}}Ze.empty=new Ze([],[]),Ze.removeOverlap=Dl;const pt=Ze.empty;class rr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Er));return rr.from(r)}forChild(e,t){if(t.isLeaf)return Ze.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=pt&&(o instanceof rr?r=r.concat(o.members):r.push(o))}return rr.from(r)}eq(e){if(!(e instanceof rr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let a=0;a<o.length;a++)t.push(o[a])}}return t?Dl(r?t:t.sort(Nr)):ui}static from(e){switch(e.length){case 0:return pt;case 1:return e[0];default:return new rr(e.every(t=>t instanceof Ze)?e:e.reduce((t,r)=>t.concat(r instanceof Ze?r:r.members),[]))}}}function F1(n,e,t,r,i,o,a){let s=n.slice();for(let d=0,u=o;d<t.maps.length;d++){let f=0;t.maps[d].forEach((p,h,m,v)=>{let w=v-m-(h-p);for(let x=0;x<s.length;x+=3){let C=s[x+1];if(C<0||p>C+u-f)continue;let N=s[x]+u-f;h>=N?s[x+1]=p<=N?-2:-1:m>=i&&w&&(s[x]+=w,s[x+1]+=w)}f+=w}),u=t.maps[d].map(u,-1)}let c=!1;for(let d=0;d<s.length;d+=3)if(s[d+1]<0){if(s[d+1]==-2){c=!0,s[d+1]=-1;continue}let u=t.map(n[d]+o),f=u-i;if(f<0||f>=r.content.size){c=!0;continue}let p=t.map(n[d+1]+o,-1),h=p-i,{index:m,offset:v}=r.content.findIndex(f),w=r.maybeChild(m);if(w&&v==f&&v+w.nodeSize==h){let x=s[d+2].mapInner(t,w,u+1,n[d]+o+1,a);x!=pt?(s[d]=f,s[d+1]=h,s[d+2]=x):(s[d+1]=-2,c=!0)}else c=!0}if(c){let d=z1(s,n,e,t,i,o,a),u=ca(d,r,0,a);e=u.local;for(let f=0;f<s.length;f+=3)s[f+1]<0&&(s.splice(f,3),f-=3);for(let f=0,p=0;f<u.children.length;f+=3){let h=u.children[f];for(;p<s.length&&s[p]<h;)p+=3;s.splice(p,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ze(e.sort(Nr),s)}function yp(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new Lt(i.from+e,i.to+e,i.type))}return t}function z1(n,e,t,r,i,o,a){function s(c,d){for(let u=0;u<c.local.length;u++){let f=c.local[u].map(r,i,d);f?t.push(f):a.onRemove&&a.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)s(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&s(n[c+2],e[c]+o+1);return t}function vp(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,a;o<n.length;o++)(a=n[o])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[o]=null);return i}function bp(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function ca(n,e,t,r){let i=[],o=!1;e.forEach((s,c)=>{let d=vp(n,s,c+t);if(d){o=!0;let u=ca(d,s,t+c+1,r);u!=pt&&i.push(c,c+s.nodeSize,u)}});let a=yp(o?bp(n):n,-t).sort(Nr);for(let s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new Ze(a,i):pt}function Nr(n,e){return n.from-e.from||n.to-e.to}function Dl(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),wp(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),wp(e,i,r.copy(o.from,r.to)));break}}}return e}function wp(n,e,t){for(;e<n.length&&Nr(t,n[e])>0;)e++;n.splice(e,0,t)}function Al(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=pt&&e.push(r)}),n.cursorWrapper&&e.push(Ze.create(n.state.doc,[n.cursorWrapper.deco])),rr.from(e)}const H1={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Y1=St&&Jn<=11;class j1{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class U1{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new j1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);St&&Jn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Y1&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,H1)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(qf(this.view)){if(this.suppressingSelectionUpdates)return En(this.view);if(St&&Jn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Sr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let o=e.focusNode;o;o=Zi(o))t.add(o);for(let o=e.anchorNode;o;o=Zi(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&qf(e)&&!this.ignoreSelectionChange(r),o=-1,a=-1,s=!1,c=[];if(e.editable)for(let u=0;u<t.length;u++){let f=this.registerMutation(t[u],c);f&&(o=o<0?f.from:Math.min(f.from,o),a=a<0?f.to:Math.max(f.to,a),f.typeOver&&(s=!0))}if(en&&c.length>1){let u=c.filter(f=>f.nodeName=="BR");if(u.length==2){let f=u[0],p=u[1];f.parentNode&&f.parentNode.parentNode==p.parentNode?p.remove():f.remove()}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ra(r)&&(d=gl(e))&&d.eq(ye.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,En(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,a),W1(e)),this.handleDOMChange(o,a,s,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||En(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)t.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(St&&Jn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:p}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(o=p)}let a=i&&i.parentNode==e.target?yt(i)+1:0,s=r.localPosFromDOM(e.target,a,-1),c=o&&o.parentNode==e.target?yt(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:s,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let kp=new WeakMap,xp=!1;function W1(n){if(!kp.has(n)&&(kp.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=en,xp)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),xp=!0}}function q1(n){let e;function t(c){c.preventDefault(),c.stopImmediatePropagation(),e=c.getTargetRanges()[0]}n.dom.addEventListener("beforeinput",t,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",t,!0);let r=e.startContainer,i=e.startOffset,o=e.endContainer,a=e.endOffset,s=n.domAtPos(n.state.selection.anchor);return Sr(s.node,s.offset,o,a)&&([r,i,o,a]=[o,a,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}function K1(n,e,t){let{node:r,fromOffset:i,toOffset:o,from:a,to:s}=n.docView.parseRange(e,t),c=n.domSelectionRange(),d,u=c.anchorNode;if(u&&n.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],ra(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ft&&n.input.lastKeyCode===8)for(let w=o;w>i;w--){let x=r.childNodes[w-1],C=x.pmViewDesc;if(x.nodeName=="BR"&&!C){o=w;break}if(!C||C.size)break}let f=n.state.doc,p=n.someProp("domParser")||Xr.fromSchema(n.state.schema),h=f.resolve(a),m=null,v=p.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:G1,context:h});if(d&&d[0].pos!=null){let w=d[0].pos,x=d[1]&&d[1].pos;x==null&&(x=w),m={anchor:w+a,head:x+a}}return{doc:v,sel:m,from:a,to:s}}function G1(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(vt&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||vt&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Q1=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function J1(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let I=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,M=gl(n,I);if(M&&!n.state.selection.eq(M)){if(ft&&tn&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",H=>H(n,Tr(13,"Enter"))))return;let B=n.state.tr.setSelection(M);I=="pointer"?B.setMeta("pointer",!0):I=="key"&&B.scrollIntoView(),o&&B.setMeta("composition",o),n.dispatch(B)}return}let a=n.state.doc.resolve(e),s=a.sharedDepth(t);e=a.before(s+1),t=n.state.doc.resolve(t).after(s+1);let c=n.state.selection,d=K1(n,e,t),u=n.state.doc,f=u.slice(d.from,d.to),p,h;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(p=n.state.selection.to,h="end"):(p=n.state.selection.from,h="start"),n.input.lastKeyCode=null;let m=eC(f.content,d.doc.content,d.from,p,h);if((si&&n.input.lastIOSEnter>Date.now()-225||tn)&&i.some(I=>I.nodeType==1&&!Q1.test(I.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",I=>I(n,Tr(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ge&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let I=Cp(n,n.state.doc,d.sel);if(I&&!I.eq(n.state.selection)){let M=n.state.tr.setSelection(I);o&&M.setMeta("composition",o),n.dispatch(M)}}return}if(ft&&n.cursorWrapper&&d.sel&&d.sel.anchor==n.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let I=m.endB-m.start;d.sel={anchor:d.sel.anchor+I,head:d.sel.anchor+I}}n.input.domChangeCount++,n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof ge&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),St&&Jn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)==" "&&(m.start--,m.endA--,m.endB--);let v=d.doc.resolveNoCache(m.start-d.from),w=d.doc.resolveNoCache(m.endB-d.from),x=u.resolve(m.start),C=v.sameParent(w)&&v.parent.inlineContent&&x.end()>=m.endA,N;if((si&&n.input.lastIOSEnter>Date.now()-225&&(!C||i.some(I=>I.nodeName=="DIV"||I.nodeName=="P"))||!C&&v.pos<d.doc.content.size&&!v.sameParent(w)&&(N=ye.findFrom(d.doc.resolve(v.pos+1),1,!0))&&N.head==w.pos)&&n.someProp("handleKeyDown",I=>I(n,Tr(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&Z1(u,m.start,m.endA,v,w)&&n.someProp("handleKeyDown",I=>I(n,Tr(8,"Backspace")))){tn&&ft&&n.domObserver.suppressSelectionUpdates();return}ft&&tn&&m.endB==m.start&&(n.input.lastAndroidDelete=Date.now()),tn&&!C&&v.start()!=w.start()&&w.parentOffset==0&&v.depth==w.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,w=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(I){return I(n,Tr(13,"Enter"))})},20));let y=m.start,_=m.endA,k,E,j;if(C){if(v.pos==w.pos)St&&Jn<=11&&v.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>En(n),20)),k=n.state.tr.delete(y,_),E=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(j=X1(v.parent.content.cut(v.parentOffset,w.parentOffset),x.parent.content.cut(x.parentOffset,m.endA-x.start()))))k=n.state.tr,j.type=="add"?k.addMark(y,_,j.mark):k.removeMark(y,_,j.mark);else if(v.parent.child(v.index()).isText&&v.index()==w.index()-(w.textOffset?0:1)){let I=v.parent.textBetween(v.parentOffset,w.parentOffset);if(n.someProp("handleTextInput",M=>M(n,y,_,I)))return;k=n.state.tr.insertText(I,y,_)}}if(k||(k=n.state.tr.replace(y,_,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let I=Cp(n,k.doc,d.sel);I&&!(ft&&tn&&n.composing&&I.empty&&(m.start!=m.endB||n.input.lastAndroidDelete<Date.now()-100)&&(I.head==y||I.head==k.mapping.map(_)-1)||St&&I.empty&&I.head==y)&&k.setSelection(I)}E&&k.ensureMarks(E),o&&k.setMeta("composition",o),n.dispatch(k.scrollIntoView())}function Cp(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:vl(n,e.resolve(t.anchor),e.resolve(t.head))}function X1(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,a,s,c;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<t.length;u++)o=t[u].removeFromSet(o);if(i.length==1&&o.length==0)s=i[0],a="add",c=u=>u.mark(s.addToSet(u.marks));else if(i.length==0&&o.length==1)s=o[0],a="remove",c=u=>u.mark(s.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(Q.from(d).eq(n))return{mark:s,type:a}}function Z1(n,e,t,r,i){if(!r.parent.isTextblock||t-e<=i.pos-r.pos||Ol(r,!0,!1)<i.pos)return!1;let o=n.resolve(e);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=n.resolve(Ol(o,!0,!0));return!a.parent.isTextblock||a.pos>t||Ol(a,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Ol(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function eC(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a,b:s}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(a,s));r-=a+c-o}if(a<o&&n.size<e.size){let c=r<=o&&r>=a?o-r:0;o-=c,o&&o<e.size&&Mp(e.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-a),a=o}else if(s<o){let c=r<=o&&r>=s?o-r:0;o-=c,o&&o<n.size&&Mp(n.textBetween(o-1,o+1))&&(o+=c?1:-1),a=o+(a-s),s=o}return{start:o,endA:a,endB:s}}function Mp(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class tC{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new x1,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Op),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Dp(this),Tp(this),this.nodeViews=Ap(this),this.docView=If(this.state.doc,Sp(this),Al(this),this.dom,this),this.domObserver=new U1(this,(r,i,o,a)=>J1(this,r,i,o,a)),this.domObserver.start(),C1(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&xl(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Op),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,a=!1;e.storedMarks&&this.composing&&(pp(this),a=!0),this.state=e;let s=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Ap(this);rC(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&xl(this),this.editable=Dp(this),Tp(this);let c=Al(this),d=Sp(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,d,c);(f||!e.selection.eq(i.selection))&&(a=!0);let p=u=="preserve"&&a&&this.dom.style.overflowAnchor==null&&Vx(this);if(a){this.domObserver.stop();let h=f&&(St||ft)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&nC(i.selection,e.selection);if(f){let m=ft?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=If(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&l1(this))?En(this,h):(Uf(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():p&&$x(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof ue){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&xf(this,t.getBoundingClientRect(),e)}else xf(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}updateDraggedNode(e,t){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new mp(e.slice,e.move,i<0?void 0:ue.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let s=this.directPlugins[a].props[e];if(s!=null&&(i=t?t(s):s))return i}let o=this.state.plugins;if(o)for(let a=0;a<o.length;a++){let s=o[a].props[e];if(s!=null&&(i=t?t(s):s))return i}}hasFocus(){if(St){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Lx(this.dom),En(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return jx(this,e)}coordsAtPos(e,t=1){return Af(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Gx(this,t||this.state,e)}pasteHTML(e,t){return ao(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ao(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(M1(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Al(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return T1(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return vt&&this.root.nodeType===11&&Ex(this.dom.ownerDocument)==this.dom?q1(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Sp(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Lt.node(0,n.state.doc.content.size,e)]}function Tp(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Lt.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Dp(n){return!n.someProp("editable",e=>e(n.state)===!1)}function nC(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Ap(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function rC(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function Op(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var ir={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},da={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},iC=typeof navigator<"u"&&/Mac/.test(navigator.platform),oC=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ct=0;ct<10;ct++)ir[48+ct]=ir[96+ct]=String(ct);for(var ct=1;ct<=24;ct++)ir[ct+111]="F"+ct;for(var ct=65;ct<=90;ct++)ir[ct]=String.fromCharCode(ct+32),da[ct]=String.fromCharCode(ct);for(var El in ir)da.hasOwnProperty(El)||(da[El]=ir[El]);function aC(n){var e=iC&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||oC&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?da:ir)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const sC=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function lC(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,a;for(let s=0;s<e.length-1;s++){let c=e[s];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))sC?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function cC(n){let e=Object.create(null);for(let t in n)e[lC(t)]=n[t];return e}function Nl(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function dC(n){return new Mt({props:{handleKeyDown:Ep(n)}})}function Ep(n){let e=cC(n);return function(t,r){let i=aC(r),o,a=e[Nl(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let s=e[Nl(i,r,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=ir[r.keyCode])&&o!=i){let s=e[Nl(o,r)];if(s&&s(t.state,t.dispatch,t))return!0}}return!1}}const uC=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function fC(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const pC=(n,e,t)=>{let r=fC(n,t);if(!r)return!1;let i=Np(r);if(!i){let a=r.blockRange(),s=a&&ti(a);return s==null?!1:(e&&e(n.tr.lift(a,s).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Pp(n,i,e))return!0;if(r.parent.content.size==0&&(fi(o,"end")||ue.isSelectable(o))){let a=el(n.doc,r.before(),r.after(),ie.empty);if(a&&a.slice.size<a.to-a.from){if(e){let s=n.tr.step(a);s.setSelection(fi(o,"end")?ye.findFrom(s.doc.resolve(s.mapping.map(i.pos,-1)),-1):ue.create(s.doc,i.pos-o.nodeSize)),e(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function fi(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const hC=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=Np(r)}let a=o&&o.nodeBefore;return!a||!ue.isSelectable(a)?!1:(e&&e(n.tr.setSelection(ue.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function Np(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function mC(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const gC=(n,e,t)=>{let r=mC(n,t);if(!r)return!1;let i=_p(r);if(!i)return!1;let o=i.nodeAfter;if(Pp(n,i,e))return!0;if(r.parent.content.size==0&&(fi(o,"start")||ue.isSelectable(o))){let a=el(n.doc,r.before(),r.after(),ie.empty);if(a&&a.slice.size<a.to-a.from){if(e){let s=n.tr.step(a);s.setSelection(fi(o,"start")?ye.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):ue.create(s.doc,s.mapping.map(i.pos))),e(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},yC=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=_p(r)}let a=o&&o.nodeAfter;return!a||!ue.isSelectable(a)?!1:(e&&e(n.tr.setSelection(ue.create(n.doc,o.pos)).scrollIntoView()),!0)};function _p(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const vC=(n,e)=>{let t=n.selection,r=t instanceof ue,i;if(r){if(t.node.isTextblock||!Gn(n.doc,t.from))return!1;i=t.from}else if(i=ea(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(ue.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},bC=(n,e)=>{let t=n.selection,r;if(t instanceof ue){if(t.node.isTextblock||!Gn(n.doc,t.to))return!1;r=t.to}else if(r=ea(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},wC=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&ti(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},kC=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
80
|
-
`).scrollIntoView()),!0)};function Bp(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const xC=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),a=Bp(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let s=t.after(),c=n.tr.replaceWith(s,s,a.createAndFill());c.setSelection(ye.near(c.doc.resolve(s),1)),e(c.scrollIntoView())}return!0},CC=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Zt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Bp(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=n.tr.insert(a,o.createAndFill());s.setSelection(ge.create(s.doc,a+1)),e(s.scrollIntoView())}return!0},MC=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(ni(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&ti(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},SC=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(ue.create(n.doc,i))),!0)};function TC(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Gn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Pp(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(TC(n,e,t))return!0;let s=e.parent.canReplace(e.index(),e.index()+1);if(s&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(t){let f=e.pos+i.nodeSize,p=Q.empty;for(let v=o.length-1;v>=0;v--)p=Q.from(o[v].create(null,p));p=Q.from(r.copy(p));let h=n.tr.step(new nt(e.pos-1,f,e.pos,f,new ie(p,1,0),o.length,!0)),m=f+2*o.length;Gn(h.doc,m)&&h.join(m),t(h.scrollIntoView())}return!0}let c=ye.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),u=d&&ti(d);if(u!=null&&u>=e.depth)return t&&t(n.tr.lift(d,u).scrollIntoView()),!0;if(s&&fi(i,"start",!0)&&fi(r,"end")){let f=r,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let h=i,m=1;for(;!h.isTextblock;h=h.firstChild)m++;if(f.canReplace(f.childCount,f.childCount,h.content)){if(t){let v=Q.empty;for(let x=p.length-1;x>=0;x--)v=Q.from(p[x].copy(v));let w=n.tr.step(new nt(e.pos-p.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new ie(v,p.length,0),0,!0));t(w.scrollIntoView())}return!0}}return!1}function Ip(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(ge.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const DC=Ip(-1),AC=Ip(1);function OC(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),s=a&&Zs(a,n,e);return s?(r&&r(t.tr.wrap(a,s).scrollIntoView()),!0):!1}}function Rp(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:s}}=t.selection.ranges[o];t.doc.nodesBetween(a,s,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)i=!0;else{let u=t.doc.resolve(d),f=u.index();i=u.parent.canReplaceWith(f,f+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:c}}=t.selection.ranges[a];o.setBlockType(s,c,n,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function EC(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),s=!1,c=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(n)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let u=t.doc.resolve(a.start-2);c=new qo(u,u,a.depth),a.endIndex<a.parent.childCount&&(a=new qo(i,t.doc.resolve(o.end(a.depth)),a.depth)),s=!0}let d=Zs(c,n,e,a);return d?(r&&r(NC(t.tr,a,d,s,n).scrollIntoView()),!0):!1}}function NC(n,e,t,r,i){let o=Q.empty;for(let u=t.length-1;u>=0;u--)o=Q.from(t[u].type.create(t[u].attrs,o));n.step(new nt(e.start-(r?2:0),e.end,e.start,e.end,new ie(o,0,0),t.length,!0));let a=0;for(let u=0;u<t.length;u++)t[u].type==i&&(a=u+1);let s=t.length-a,c=e.start+t.length-(r?2:0),d=e.parent;for(let u=e.startIndex,f=e.endIndex,p=!0;u<f;u++,p=!1)!p&&ni(n.doc,c,s)&&(n.split(c,s),c+=2*s),c+=d.child(u).nodeSize;return n}function _C(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?BC(e,t,n,o):PC(e,t,o):!0:!1}}function BC(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new nt(o-1,a,o,a,new ie(Q.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new qo(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const s=ti(r);if(s==null)return!1;i.lift(r,s);let c=i.mapping.map(o,-1)-1;return Gn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function PC(n,e,t){let r=n.tr,i=t.parent;for(let h=t.end,m=t.endIndex-1,v=t.startIndex;m>v;m--)h-=i.child(m).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(t.start),a=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let s=t.startIndex==0,c=t.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(s?0:1),u+1,a.content.append(c?Q.empty:Q.from(i))))return!1;let f=o.pos,p=f+a.nodeSize;return r.step(new nt(f-(s?1:0),p+(c?1:0),f+1,p-1,new ie((s?Q.empty:Q.from(i.copy(Q.empty))).append(c?Q.empty:Q.from(i.copy(Q.empty))),s?0:1,c?0:1),s?0:1)),e(r.scrollIntoView()),!0}function IC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==n);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let s=o.parent,c=s.child(a-1);if(c.type!=n)return!1;if(t){let d=c.lastChild&&c.lastChild.type==s.type,u=Q.from(d?n.create():null),f=new ie(Q.from(n.create(null,Q.from(s.type.create(null,u)))),d?3:1,0),p=o.start,h=o.end;t(e.tr.step(new nt(p-(d?3:1),h,p,h,f,1,!0)).scrollIntoView())}return!0}}function ua(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class fa{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([s,c])=>[s,(...u)=>{const f=c(...u)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s=[],c=!!e,d=e||o.tr,u=()=>(!c&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(d),s.every(p=>p===!0)),f={...Object.fromEntries(Object.entries(r).map(([p,h])=>[p,(...v)=>{const w=this.buildProps(d,t),x=h(...v)(w);return s.push(x),f}])),run:u};return f}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([c,d])=>[c,(...u)=>d(...u)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s={tr:e,editor:i,view:a,state:ua({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,d])=>[c,(...u)=>d(...u)(s)]))}};return s}}class RC{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function ce(n,e,t){return n.config[e]===void 0&&n.parent?ce(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?ce(n.parent,e,t):null}):n.config[e]}function pa(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Vp(n){const e=[],{nodeExtensions:t,markExtensions:r}=pa(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},c=ce(a,"addGlobalAttributes",s);if(!c)return;c().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([p,h])=>{e.push({type:f,name:p,attribute:{...o,...h}})})})})}),i.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},c=ce(a,"addAttributes",s);if(!c)return;const d=c();Object.entries(d).forEach(([u,f])=>{const p={...o,...f};typeof(p==null?void 0:p.default)=="function"&&(p.default=p.default()),p!=null&&p.isRequired&&(p==null?void 0:p.default)===void 0&&delete p.default,e.push({type:a.name,name:u,attribute:p})})}),e}function rt(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Ge(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const s=o?o.split(" "):[],c=r[i]?r[i].split(" "):[],d=s.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function _l(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Ge(t,r),{})}function $p(n){return typeof n=="function"}function ve(n,e=void 0,...t){return $p(n)?e?n.bind(e)(...t):n(...t):n}function VC(n={}){return Object.keys(n).length===0&&n.constructor===Object}function $C(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Lp(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(t):$C(t.getAttribute(a.name));return s==null?o:{...o,[a.name]:s}},{});return{...r,...i}}}}function Fp(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&VC(t)?!1:t!=null))}function LC(n,e){var t;const r=Vp(n),{nodeExtensions:i,markExtensions:o}=pa(n),a=(t=i.find(d=>ce(d,"topNode")))===null||t===void 0?void 0:t.name,s=Object.fromEntries(i.map(d=>{const u=r.filter(x=>x.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},p=n.reduce((x,C)=>{const N=ce(C,"extendNodeSchema",f);return{...x,...N?N(d):{}}},{}),h=Fp({...p,content:ve(ce(d,"content",f)),marks:ve(ce(d,"marks",f)),group:ve(ce(d,"group",f)),inline:ve(ce(d,"inline",f)),atom:ve(ce(d,"atom",f)),selectable:ve(ce(d,"selectable",f)),draggable:ve(ce(d,"draggable",f)),code:ve(ce(d,"code",f)),defining:ve(ce(d,"defining",f)),isolating:ve(ce(d,"isolating",f)),attrs:Object.fromEntries(u.map(x=>{var C;return[x.name,{default:(C=x==null?void 0:x.attribute)===null||C===void 0?void 0:C.default}]}))}),m=ve(ce(d,"parseHTML",f));m&&(h.parseDOM=m.map(x=>Lp(x,u)));const v=ce(d,"renderHTML",f);v&&(h.toDOM=x=>v({node:x,HTMLAttributes:_l(x,u)}));const w=ce(d,"renderText",f);return w&&(h.toText=w),[d.name,h]})),c=Object.fromEntries(o.map(d=>{const u=r.filter(w=>w.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},p=n.reduce((w,x)=>{const C=ce(x,"extendMarkSchema",f);return{...w,...C?C(d):{}}},{}),h=Fp({...p,inclusive:ve(ce(d,"inclusive",f)),excludes:ve(ce(d,"excludes",f)),group:ve(ce(d,"group",f)),spanning:ve(ce(d,"spanning",f)),code:ve(ce(d,"code",f)),attrs:Object.fromEntries(u.map(w=>{var x;return[w.name,{default:(x=w==null?void 0:w.attribute)===null||x===void 0?void 0:x.default}]}))}),m=ve(ce(d,"parseHTML",f));m&&(h.parseDOM=m.map(w=>Lp(w,u)));const v=ce(d,"renderHTML",f);return v&&(h.toDOM=w=>v({mark:w,HTMLAttributes:_l(w,u)})),[d.name,h]}));return new Kk({topNode:a,nodes:s,marks:c})}function Bl(n,e){return e.nodes[n]||e.marks[n]||null}function zp(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const FC=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,a,s)=>{var c,d;const u=((d=(c=i.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:i,pos:o,parent:a,index:s}))||i.textContent||"%leaf%";t+=u.slice(0,Math.max(0,r-o))}),t};function Pl(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class ha{constructor(e){this.find=e.find,this.handler=e.handler}}const zC=(n,e)=>{if(Pl(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Il(n){var e;const{editor:t,from:r,to:i,text:o,rules:a,plugin:s}=n,{view:c}=t;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(p=>p.type.spec.code))return!1;let u=!1;const f=FC(d)+o;return a.forEach(p=>{if(u)return;const h=zC(f,p.find);if(!h)return;const m=c.state.tr,v=ua({state:c.state,transaction:m}),w={from:r-(h[0].length-o.length),to:i},{commands:x,chain:C,can:N}=new fa({editor:t,state:v});p.handler({state:v,range:w,match:h,commands:x,chain:C,can:N})===null||!m.steps.length||(m.setMeta(s,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function HC(n){const{editor:e,rules:t}=n,r=new Mt({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,s){return Il({editor:e,from:o,to:a,text:s,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Il({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Il({editor:e,from:a.pos,to:a.pos,text:`
|
|
81
|
-
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
82
|
-
|
|
83
|
-
`,textSerializers:a={}}=t||{};let s="",c=!0;return n.nodesBetween(r,i,(d,u,f,p)=>{var h;const m=a==null?void 0:a[d.type.name];m?(d.isBlock&&!c&&(s+=o,c=!0),f&&(s+=m({node:d,pos:u,parent:f,index:p,range:e}))):d.isText?(s+=(h=d==null?void 0:d.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,i-u),c=!1):d.isBlock&&!c&&(s+=o,c=!0)}),s}function Yp(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const QC=ht.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Mt({key:new vn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,a=Math.min(...o.map(u=>u.$from.pos)),s=Math.max(...o.map(u=>u.$to.pos)),c=Yp(t);return Hp(r,{from:a,to:s},{textSerializers:c})}}})]}}),JC=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),XC=(n=!1)=>({commands:e})=>e.setContent("",n),ZC=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:a})=>{n.doc.nodesBetween(o.pos,a.pos,(s,c)=>{if(s.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(c)),p=d.resolve(u.map(c+s.nodeSize)),h=f.blockRange(p);if(!h)return;const m=ti(h);if(s.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,v)}(m||m===0)&&e.lift(h,m)})}),!0},eM=n=>e=>n(e),tM=()=>({state:n,dispatch:e})=>CC(n,e),nM=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,o.content),r.setSelection(new ge(r.doc.resolve(a-1))),!0},rM=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const s=i.before(o),c=i.after(o);n.delete(s,c).scrollIntoView()}return!0}return!1},iM=n=>({tr:e,state:t,dispatch:r})=>{const i=rt(n,t.schema),o=e.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const c=o.before(a),d=o.after(a);e.delete(c,d).scrollIntoView()}return!0}return!1},oM=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},aM=()=>({state:n,dispatch:e})=>uC(n,e),sM=()=>({commands:n})=>n.keyboardShortcut("Enter"),lM=()=>({state:n,dispatch:e})=>xC(n,e);function ga(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Pl(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Vl(n,e,t={}){return n.find(r=>r.type===e&&ga(r.attrs,t))}function cM(n,e,t={}){return!!Vl(n,e,t)}function $l(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=Vl([...r.node.marks],e,t);if(!i)return;let o=r.index,a=n.start()+r.offset,s=o+1,c=a+r.node.nodeSize;for(Vl([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,a-=n.parent.child(o).nodeSize;for(;s<n.parent.childCount&&cM([...n.parent.child(s).marks],e,t);)c+=n.parent.child(s).nodeSize,s+=1;return{from:a,to:c}}function or(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const dM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=or(n,r.schema),{doc:a,selection:s}=t,{$from:c,from:d,to:u}=s;if(i){const f=$l(c,o,e);if(f&&f.from<=d&&f.to>=u){const p=ge.create(a,f.from,f.to);t.setSelection(p)}}return!0},uM=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Ll(n){return n instanceof ge}function Nn(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function jp(n,e=null){if(!e)return null;const t=ye.atStart(n),r=ye.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?ge.create(n,Nn(0,i,o),Nn(n.content.size,i,o)):ge.create(n,Nn(e,i,o),Nn(e,i,o))}function Fl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const fM=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{Fl()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Ll(t.state.selection))return a(),!0;const s=jp(i.doc,n)||t.state.selection,c=t.state.selection.eq(s);return o&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},pM=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),hM=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e);function Up(n){const e=`<body>${n}</body>`;return new window.DOMParser().parseFromString(e,"text/html").body}function ya(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?Q.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),ya("",e,t)}if(typeof n=="string"){const r=Xr.fromSchema(e);return t.slice?r.parseSlice(Up(n),t.parseOptions).content:r.parse(Up(n),t.parseOptions)}return ya("",e,t)}function mM(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof lt||i instanceof nt))return;const o=n.mapping.maps[r];let a=0;o.forEach((s,c,d,u)=>{a===0&&(a=u)}),n.setSelection(ye.near(n.doc.resolve(a),t))}const gM=n=>n.toString().startsWith("<"),yM=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=ya(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(a.toString()==="<>")return!0;let{from:s,to:c}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},d=!0,u=!0;if((gM(a)?a:[a]).forEach(p=>{p.check(),d=d?p.isText&&p.marks.length===0:!1,u=u?p.isBlock:!1}),s===c&&u){const{parent:p}=r.doc.resolve(s);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(s-=1,c+=1)}d?Array.isArray(e)?r.insertText(e.map(p=>p.text||"").join(""),s,c):typeof e=="object"&&e&&e.text?r.insertText(e.text,s,c):r.insertText(e,s,c):r.replaceWith(s,c,a),t.updateSelection&&mM(r,r.steps.length-1,-1)}return!0},vM=()=>({state:n,dispatch:e})=>vC(n,e),bM=()=>({state:n,dispatch:e})=>bC(n,e),wM=()=>({state:n,dispatch:e})=>pC(n,e),kM=()=>({state:n,dispatch:e})=>gC(n,e),xM=()=>({tr:n,state:e,dispatch:t})=>{try{const r=ea(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},CM=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ea(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function zl(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function MM(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,a;for(let s=0;s<e.length-1;s+=1){const c=e[s];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))Fl()||zl()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const SM=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=MM(n).split(/-(?!$)/),a=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,s))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function lo(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?rt(e,n.schema):null,s=[];n.doc.nodesBetween(r,i,(f,p)=>{if(f.isText)return;const h=Math.max(r,p),m=Math.min(i,p+f.nodeSize);s.push({node:f,from:h,to:m})});const c=i-r,d=s.filter(f=>a?a.name===f.node.type.name:!0).filter(f=>ga(f.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((f,p)=>f+p.to-p.from,0)>=c}const TM=(n,e={})=>({state:t,dispatch:r})=>{const i=rt(n,t.schema);return lo(t,i,e)?wC(t,r):!1},DM=()=>({state:n,dispatch:e})=>MC(n,e),AM=n=>({state:e,dispatch:t})=>{const r=rt(n,e.schema);return _C(r)(e,t)},OM=()=>({state:n,dispatch:e})=>kC(n,e);function va(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Wp(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const EM=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const s=va(typeof n=="string"?n:n.name,r.schema);return s?(s==="node"&&(o=rt(n,r.schema)),s==="mark"&&(a=or(n,r.schema)),i&&t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{o&&o===d.type&&t.setNodeMarkup(u,void 0,Wp(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(f=>{a===f.type&&t.addMark(u,u+d.nodeSize,a.create(Wp(f.attrs,e)))})})}),!0):!1},NM=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),_M=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),BM=()=>({state:n,dispatch:e})=>hC(n,e),PM=()=>({state:n,dispatch:e})=>yC(n,e),IM=()=>({state:n,dispatch:e})=>SC(n,e),RM=()=>({state:n,dispatch:e})=>AC(n,e),VM=()=>({state:n,dispatch:e})=>DC(n,e);function qp(n,e,t={}){return ya(n,e,{slice:!1,parseOptions:t})}const $M=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,s=qp(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,s).setMeta("preventUpdate",!e),!0};function ba(n,e){const t=or(e,n.schema),{from:r,to:i,empty:o}=n.selection,a=[];o?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,c=>{a.push(...c.marks)});const s=a.find(c=>c.type.name===t.name);return s?{...s.attrs}:{}}function LM(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function FM(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Hl(n){return e=>FM(e.$from,n)}function zM(n,e){const t=gn.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function HM(n,e){const t={from:0,to:n.content.size};return Hp(n,t,e)}function YM(n,e){const t=rt(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,s=>{o.push(s)});const a=o.reverse().find(s=>s.type.name===t.name);return a?{...a.attrs}:{}}function jM(n,e){const t=va(typeof e=="string"?e:e.name,n.schema);return t==="node"?YM(n,e):t==="mark"?ba(n,e):{}}function Kp(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=$l(o,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,o)=>{r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function wa(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Yl(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?or(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>ga(f.attrs,t,{strict:!1}));let a=0;const s=[];if(i.forEach(({$from:f,$to:p})=>{const h=f.pos,m=p.pos;n.doc.nodesBetween(h,m,(v,w)=>{if(!v.isText&&!v.marks.length)return;const x=Math.max(h,w),C=Math.min(m,w+v.nodeSize),N=C-x;a+=N,s.push(...v.marks.map(y=>({mark:y,from:x,to:C})))})}),a===0)return!1;const c=s.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>ga(f.mark.attrs,t,{strict:!1})).reduce((f,p)=>f+p.to-p.from,0),d=s.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,p)=>f+p.to-p.from,0);return(c>0?c+d:c)>=a}function UM(n,e,t={}){if(!e)return lo(n,null,t)||Yl(n,null,t);const r=va(e,n.schema);return r==="node"?lo(n,e,t):r==="mark"?Yl(n,e,t):!1}function Gp(n,e){const{nodeExtensions:t}=pa(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ve(ce(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function WM(n){var e;const t=(e=n.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=n.toJSON();return JSON.stringify(t)===JSON.stringify(r)}function qM(n){return n instanceof ue}function Qp(n,e,t){const i=n.state.doc.content.size,o=Nn(e,0,i),a=Nn(t,0,i),s=n.coordsAtPos(o),c=n.coordsAtPos(a,-1),d=Math.min(s.top,c.top),u=Math.max(s.bottom,c.bottom),f=Math.min(s.left,c.left),p=Math.max(s.right,c.right),h=p-f,m=u-d,x={top:d,bottom:u,left:f,right:p,width:h,height:m,x:f,y:d};return{...x,toJSON:()=>x}}function KM(n,e,t){var r;const{selection:i}=e;let o=null;if(Ll(i)&&(o=i.$cursor),o){const s=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(s)||!s.some(c=>c.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:s,$to:c})=>{let d=s.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(s.pos,c.pos,(u,f,p)=>{if(d)return!1;if(u.isInline){const h=!p||p.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(v=>v.type.excludes(t));d=h&&m}return!d}),d})}const GM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:s}=o,c=or(n,r.schema);if(i)if(a){const d=ba(r,c);t.addStoredMark(c.create({...d,...e}))}else s.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(p,h)=>{const m=Math.max(h,u),v=Math.min(h+p.nodeSize,f);p.marks.find(x=>x.type===c)?p.marks.forEach(x=>{c===x.type&&t.addMark(m,v,c.create({...x.attrs,...e}))}):t.addMark(m,v,c.create(e))})});return KM(r,t,c)},QM=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),JM=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=rt(n,t.schema);return o.isTextblock?i().command(({commands:a})=>Rp(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>Rp(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},XM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Nn(n,0,r.content.size),o=ue.create(r,i);e.setSelection(o)}return!0},ZM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=ge.atStart(r).from,s=ge.atEnd(r).to,c=Nn(i,a,s),d=Nn(o,a,s),u=ge.create(r,c,d);e.setSelection(u)}return!0},eS=n=>({state:e,dispatch:t})=>{const r=rt(n,e.schema);return IC(r)(e,t)};function Jp(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e==null?void 0:e.includes(i.type.name));n.tr.ensureMarks(r)}}const tS=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:s,$to:c}=o,d=i.extensionManager.attributes,u=wa(d,s.node().type.name,s.node().attrs);if(o instanceof ue&&o.node.isBlock)return!s.parentOffset||!ni(a,s.pos)?!1:(r&&(n&&Jp(t,i.extensionManager.splittableMarks),e.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(r){const f=c.parentOffset===c.parent.content.size;o instanceof ge&&e.deleteSelection();const p=s.depth===0?void 0:LM(s.node(-1).contentMatchAt(s.indexAfter(-1)));let h=f&&p?[{type:p,attrs:u}]:void 0,m=ni(e.doc,e.mapping.map(s.pos),1,h);if(!h&&!m&&ni(e.doc,e.mapping.map(s.pos),1,p?[{type:p}]:void 0)&&(m=!0,h=p?[{type:p,attrs:u}]:void 0),m&&(e.split(e.mapping.map(s.pos),1,h),p&&!f&&!s.parentOffset&&s.parent.type!==p)){const v=e.mapping.map(s.before()),w=e.doc.resolve(v);s.node(-1).canReplaceWith(w.index(),w.index()+1,p)&&e.setNodeMarkup(e.mapping.map(s.before()),p)}n&&Jp(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},nS=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=rt(n,t.schema),{$from:s,$to:c}=t.selection,d=t.selection.node;if(d&&d.isBlock||s.depth<2||!s.sameParent(c))return!1;const u=s.node(-1);if(u.type!==a)return!1;const f=i.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==a||s.index(-2)!==s.node(-2).childCount-1)return!1;if(r){let w=Q.empty;const x=s.index(-1)?1:s.index(-2)?2:3;for(let E=s.depth-x;E>=s.depth-3;E-=1)w=Q.from(s.node(E).copy(w));const C=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,N=wa(f,s.node().type.name,s.node().attrs),y=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(N))||void 0;w=w.append(Q.from(a.createAndFill(null,y)||void 0));const _=s.before(s.depth-(x-1));e.replace(_,s.after(-C),new ie(w,4-x,0));let k=-1;e.doc.nodesBetween(_,e.doc.content.size,(E,j)=>{if(k>-1)return!1;E.isTextblock&&E.content.size===0&&(k=j+1)}),k>-1&&e.setSelection(ge.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const p=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,h=wa(f,u.type.name,u.attrs),m=wa(f,s.node().type.name,s.node().attrs);e.delete(s.pos,c.pos);const v=p?[{type:a,attrs:h},{type:p,attrs:m}]:[{type:a,attrs:h}];if(!ni(e.doc,s.pos,2))return!1;if(r){const{selection:w,storedMarks:x}=t,{splittableMarks:C}=i.extensionManager,N=x||w.$to.parentOffset&&w.$from.marks();if(e.split(s.pos,2,v).scrollIntoView(),!N||!r)return!0;const y=N.filter(_=>C.includes(_.type.name));e.ensureMarks(y)}return!0},jl=(n,e)=>{const t=Hl(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Gn(n.doc,t.pos)&&n.join(t.pos),!0},Ul=(n,e)=>{const t=Hl(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Gn(n.doc,r)&&n.join(r),!0};var rS=Object.freeze({__proto__:null,blur:JC,clearContent:XC,clearNodes:ZC,command:eM,createParagraphNear:tM,cut:nM,deleteCurrentNode:rM,deleteNode:iM,deleteRange:oM,deleteSelection:aM,enter:sM,exitCode:lM,extendMarkRange:dM,first:uM,focus:fM,forEach:pM,insertContent:hM,insertContentAt:yM,joinUp:vM,joinDown:bM,joinBackward:wM,joinForward:kM,joinItemBackward:xM,joinItemForward:CM,keyboardShortcut:SM,lift:TM,liftEmptyBlock:DM,liftListItem:AM,newlineInCode:OM,resetAttributes:EM,scrollIntoView:NM,selectAll:_M,selectNodeBackward:BM,selectNodeForward:PM,selectParentNode:IM,selectTextblockEnd:RM,selectTextblockStart:VM,setContent:$M,setMark:GM,setMeta:QM,setNode:JM,setNodeSelection:XM,setTextSelection:ZM,sinkListItem:eS,splitBlock:tS,splitListItem:nS,toggleList:(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:s,chain:c,commands:d,can:u})=>{const{extensions:f,splittableMarks:p}=i.extensionManager,h=rt(n,a.schema),m=rt(e,a.schema),{selection:v,storedMarks:w}=a,{$from:x,$to:C}=v,N=x.blockRange(C),y=w||v.$to.parentOffset&&v.$from.marks();if(!N)return!1;const _=Hl(k=>Gp(k.type.name,f))(v);if(N.depth>=1&&_&&N.depth-_.depth<=1){if(_.node.type===h)return d.liftListItem(m);if(Gp(_.node.type.name,f)&&h.validContent(_.node.content)&&s)return c().command(()=>(o.setNodeMarkup(_.pos,h),!0)).command(()=>jl(o,h)).command(()=>Ul(o,h)).run()}return!t||!y||!s?c().command(()=>u().wrapInList(h,r)?!0:d.clearNodes()).wrapInList(h,r).command(()=>jl(o,h)).command(()=>Ul(o,h)).run():c().command(()=>{const k=u().wrapInList(h,r),E=y.filter(j=>p.includes(j.type.name));return o.ensureMarks(E),k?!0:d.clearNodes()}).wrapInList(h,r).command(()=>jl(o,h)).command(()=>Ul(o,h)).run()},toggleMark:(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=or(n,r.schema);return Yl(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},toggleNode:(n,e,t={})=>({state:r,commands:i})=>{const o=rt(n,r.schema),a=rt(e,r.schema);return lo(r,o,t)?i.setNode(a):i.setNode(o,t)},toggleWrap:(n,e={})=>({state:t,commands:r})=>{const i=rt(n,t.schema);return lo(t,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const a=n.tr,s=o.transform;for(let c=s.steps.length-1;c>=0;c-=1)a.step(s.steps[c].invert(s.docs[c]));if(o.text){const c=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,n.schema.text(o.text,c))}else a.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:s}=t,c=or(n,r.schema),{$from:d,empty:u,ranges:f}=s;if(!i)return!0;if(u&&a){let{from:p,to:h}=s;const m=(o=d.marks().find(w=>w.type===c))===null||o===void 0?void 0:o.attrs,v=$l(d,c,m);v&&(p=v.from,h=v.to),t.removeMark(p,h,c)}else f.forEach(p=>{t.removeMark(p.$from.pos,p.$to.pos,c)});return t.removeStoredMark(c),!0},updateAttributes:(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const s=va(typeof n=="string"?n:n.name,r.schema);return s?(s==="node"&&(o=rt(n,r.schema)),s==="mark"&&(a=or(n,r.schema)),i&&t.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(d,u,(f,p)=>{o&&o===f.type&&t.setNodeMarkup(p,void 0,{...f.attrs,...e}),a&&f.marks.length&&f.marks.forEach(h=>{if(a===h.type){const m=Math.max(p,d),v=Math.min(p+f.nodeSize,u);t.addMark(m,v,a.create({...h.attrs,...e}))}})})}),!0):!1},wrapIn:(n,e={})=>({state:t,dispatch:r})=>{const i=rt(n,t.schema);return OC(i,e)(t,r)},wrapInList:(n,e={})=>({state:t,dispatch:r})=>{const i=rt(n,t.schema);return EC(i,e)(t,r)}});const iS=ht.create({name:"commands",addCommands(){return{...rS}}}),oS=ht.create({name:"editable",addProseMirrorPlugins(){return[new Mt({key:new vn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),aS=ht.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Mt({key:new vn("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),sS=ht.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:c,doc:d}=s,{empty:u,$anchor:f}=c,{pos:p,parent:h}=f,m=f.parent.isTextblock?s.doc.resolve(p-1):f,v=m.parent.type.spec.isolating,w=f.pos-f.parentOffset,x=v&&m.parent.childCount===1?w===f.pos:ye.atStart(d).from===p;return!u||!x||!h.type.isTextblock||h.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Fl()||zl()?o:i},addProseMirrorPlugins(){return[new Mt({key:new vn("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(m=>m.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,s=ye.atStart(e.doc).from,c=ye.atEnd(e.doc).to;if(i||!(o===s&&a===c)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const f=t.tr,p=ua({state:t,transaction:f}),{commands:h}=new fa({editor:this.editor,state:p});if(h.clearNodes(),!!f.steps.length)return f}})]}}),lS=ht.create({name:"tabindex",addProseMirrorPlugins(){return[new Mt({key:new vn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var cS=Object.freeze({__proto__:null,ClipboardTextSerializer:QC,Commands:iS,Editable:oS,FocusEvents:aS,Keymap:sS,Tabindex:lS});const dS=`.ProseMirror {
|
|
72
|
+
`),Ho.render=function(n,e,t,r,i,o){return l.openBlock(),l.createElementBlock("div",gk,[n.dataUrl?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(["avatar-cropper-overlay",{"avatar-cropper-overlay-inline":n.inline}])},[n.inline?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",yk,[l.createElementVNode("a",{onClick:e[0]||(e[0]=function(){return n.cancel&&n.cancel.apply(n,arguments)}),class:"avatar-cropper-close",title:n.labels.cancel,href:"javascript:;"}," × ",8,vk)])),l.createElementVNode("div",bk,[l.createElementVNode("div",wk,[l.createElementVNode("img",{ref:"img",src:n.dataUrl,alt:"",onLoad:e[1]||(e[1]=l.withModifiers(function(){return n.createCropper&&n.createCropper.apply(n,arguments)},["stop"])),onError:e[2]||(e[2]=function(){return n.onImgElementError&&n.onImgElementError.apply(n,arguments)})},null,40,kk)]),l.createElementVNode("div",xk,[l.createElementVNode("button",{onClick:e[3]||(e[3]=l.withModifiers(function(){return n.cancel&&n.cancel.apply(n,arguments)},["stop","prevent"])),class:"avatar-cropper-btn"},l.toDisplayString(n.labels.cancel),1),l.createElementVNode("button",{onClick:e[4]||(e[4]=l.withModifiers(function(){return n.submit&&n.submit.apply(n,arguments)},["stop","prevent"])),class:"avatar-cropper-btn"},l.toDisplayString(n.labels.submit),1)])])],2)):l.createCommentVNode("",!0),n.file?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("input",{key:1,accept:n.cleanedMimes,capture:n.capture,class:"avatar-cropper-img-input",ref:"input",type:"file",onChange:e[5]||(e[5]=function(){return n.onFileInputChange&&n.onFileInputChange.apply(n,arguments)})},null,40,Ck))])},Ho.install=function(n){n.component("avatar-cropper",Ho)};const Tk={name:"GenericImageCropper",props:{personID:{type:Number,default:1}},components:{AvatarCropper:Ho},data(){return{showCropper:!1,userPicUrl:""}},mounted(){this.getImgUrl(this.personID)},watch:{personID:{immediate:!0,handler(n){this.getImgUrl(n)}}},methods:{getImgUrl(){this.userPicUrl="../../../../src/assets/select-tournament.png"},setShowCropper(){this.showCropper=!0},handleUploading(){this.message="uploading..."},handleUploaded(n){n.response.status===200&&(this.userPicUrl=`http://localhost/uploads/${this.personID}.png`)},handleCompleted(){this.message="upload completed."},handlerError(n,e,t){console.error(`${n} ${e} ${t}`),this.message="Oops! Something went wrong..."}}},Mk={class:""},Sk=["src","alt"];function Dk(n,e,t,r,i,o){const a=l.resolveComponent("avatar-cropper");return l.openBlock(),l.createElementBlock("section",Mk,[l.createElementVNode("img",{class:"h-40 w-96 border-2 border-dashed rounded-lg",src:i.userPicUrl,onError:e[0]||(e[0]=()=>{}),alt:t.personID,onClick:e[1]||(e[1]=s=>o.setShowCropper())},null,40,Sk),l.createVNode(a,{onUploading:o.handleUploading,onUploaded:o.handleUploaded,onCompleted:o.handleCompleted,onError:o.handlerError,modelValue:i.showCropper,"onUpdate:modelValue":e[2]||(e[2]=s=>i.showCropper=s),"upload-url":`http://localhost/api/upload/${t.personID}`,"cropper-options":{aspectRatio:8/3,autoCropArea:1,viewMode:1,movable:!0,zoomable:!0}},null,8,["onUploading","onUploaded","onCompleted","onError","modelValue","upload-url"])])}const Su=Pe(Tk,[["render",Dk]]);function st(n){this.content=n}st.prototype={constructor:st,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new st(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new st(t)},addToStart:function(n,e){return new st([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new st(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new st(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=st.from(n),n.size?new st(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=st.from(n),n.size?new st(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=st.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},st.from=function(n){if(n instanceof st)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new st(e)};function Du(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let a=0;i.text[a]==o.text[a];a++)t++;return t}if(i.content.size||o.content.size){let a=Du(i.content,o.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Au(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let a=n.child(--i),s=e.child(--o),c=a.nodeSize;if(a==s){t-=c,r-=c;continue}if(!a.sameMarkup(s))return{a:t,b:r};if(a.isText&&a.text!=s.text){let d=0,u=Math.min(a.text.length,s.text.length);for(;d<u&&a.text[a.text.length-d-1]==s.text[s.text.length-d-1];)d++,t--,r--;return{a:t,b:r}}if(a.content.size||s.content.size){let d=Au(a.content,s.content,t-1,r-1);if(d)return d}t-=c,r-=c}}class J{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let a=0,s=0;s<t;a++){let c=this.content[a],d=s+c.nodeSize;if(d>e&&r(c,i+s,o||null,a)!==!1&&c.content.size){let u=s+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,t-u),r,i+u)}s=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",a=!0;return this.nodesBetween(e,t,(s,c)=>{let d=s.isText?s.text.slice(Math.max(e,c)-c,t-c):s.isLeaf?i?typeof i=="function"?i(s):i:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&d||s.isTextblock)&&r&&(a?a=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new J(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,a=0;a<t;o++){let s=this.content[o],c=a+s.nodeSize;c>e&&((a<e||c>t)&&(s.isText?s=s.cut(Math.max(0,e-a),Math.min(s.text.length,t-a)):s=s.cut(Math.max(0,e-a-1),Math.min(s.content.size,t-a-1))),r.push(s),i+=s.nodeSize),a=c}return new J(r,i)}cutByIndex(e,t){return e==t?J.empty:e==0&&t==this.content.length?this:new J(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new J(i,o)}addToStart(e){return new J([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new J(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Du(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Au(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Yo(0,e);if(e==this.size)return Yo(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),a=i+o.nodeSize;if(a>=e)return a==e||t>0?Yo(r+1,a):Yo(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return J.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new J(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return J.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new J(t||e,r)}static from(e){if(!e)return J.empty;if(e instanceof J)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new J([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}J.empty=new J([],0);const Ws={index:0,offset:0};function Yo(n,e){return Ws.index=n,Ws.offset=e,Ws}function jo(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!jo(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!jo(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Be=class vc{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&jo(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return vc.none;if(e instanceof vc)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Be.none=[];class Uo extends Error{}class oe{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Nu(this.content,e+this.openStart,t);return r&&new oe(r,this.openStart,this.openEnd)}removeBetween(e,t){return new oe(Eu(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return oe.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new oe(J.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new oe(e,r,i)}}oe.empty=new oe(J.empty,0,0);function Eu(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:a,offset:s}=n.findIndex(t);if(i==e||o.isText){if(s!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(Eu(o.content,e-i-1,t-i-1)))}function Nu(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),a=n.maybeChild(i);if(o==e||a.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let s=Nu(a.content,e-o-1,t);return s&&n.replaceChild(i,a.copy(s))}function Ak(n,e,t){if(t.openStart>n.depth)throw new Uo("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Uo("Inconsistent open depths");return Ou(n,e,t,0)}function Ou(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=Ou(n,e,t,r+1);return o.copy(o.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,s=a.content;return Tr(a,s.cut(0,n.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:a,end:s}=Ek(t,n);return Tr(o,Bu(n,a,s,e,r))}else return Tr(o,Wo(n,e,r))}function _u(n,e){if(!e.type.compatibleContent(n.type))throw new Uo("Cannot join "+e.type.name+" onto "+n.type.name)}function qs(n,e,t){let r=n.node(t);return _u(r,e.node(t)),r}function Cr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Wi(n,e,t,r){let i=(e||n).node(t),o=0,a=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Cr(n.nodeAfter,r),o++));for(let s=o;s<a;s++)Cr(i.child(s),r);e&&e.depth==t&&e.textOffset&&Cr(e.nodeBefore,r)}function Tr(n,e){return n.type.checkContent(e),n.copy(e)}function Bu(n,e,t,r,i){let o=n.depth>i&&qs(n,e,i+1),a=r.depth>i&&qs(t,r,i+1),s=[];return Wi(null,n,i,s),o&&a&&e.index(i)==t.index(i)?(_u(o,a),Cr(Tr(o,Bu(n,e,t,r,i+1)),s)):(o&&Cr(Tr(o,Wo(n,e,i+1)),s),Wi(e,t,i,s),a&&Cr(Tr(a,Wo(t,r,i+1)),s)),Wi(r,null,i,s),new J(s)}function Wo(n,e,t){let r=[];if(Wi(null,n,t,r),n.depth>t){let i=qs(n,e,t+1);Cr(Tr(i,Wo(n,e,t+1)),r)}return Wi(e,null,t,r),new J(r)}function Ek(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(J.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class qi{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Be.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let s=r;r=i,i=s}let o=r.marks;for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!i||!o[a].isInSet(i.marks))&&(o=o[a--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new qo(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let a=e;;){let{index:s,offset:c}=a.content.findIndex(o),d=o-c;if(r.push(a,s,i+c),!d||(a=a.child(s),a.isText))break;o=d-1,i+=c+1}return new qi(t,r,o)}static resolveCached(e,t){for(let i=0;i<Ks.length;i++){let o=Ks[i];if(o.pos==t&&o.doc==e)return o}let r=Ks[Gs]=qi.resolve(e,t);return Gs=(Gs+1)%Nk,r}}let Ks=[],Gs=0,Nk=12;class qo{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Ok=Object.create(null);let Mr=class bc{constructor(e,t,r,i=Be.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||J.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&jo(this.attrs,t||e.defaultAttrs||Ok)&&Be.sameSet(this.marks,r||Be.none)}copy(e=null){return e==this.content?this:new bc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new bc(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return oe.empty;let i=this.resolve(e),o=this.resolve(t),a=r?0:i.sharedDepth(t),s=i.start(a),d=i.node(a).content.cut(i.pos-s,o.pos-s);return new oe(d,i.depth-a,o.depth-a)}replace(e,t,r){return Ak(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return qi.resolveCached(this,e)}resolveNoCache(e){return qi.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Pu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=J.empty,i=0,o=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,o),s=a&&a.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let c=i;c<o;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),a=o&&o.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Be.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Be.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=J.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Mr.prototype.text=void 0;class Ko extends Mr{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Pu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ko(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ko(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Pu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Sr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new _k(e,t);if(r.next==null)return Sr.empty;let i=Iu(r);r.next&&r.err("Unexpected trailing text");let o=$k(Lk(i));return Fk(o,r),o}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function o(a,s){let c=a.matchFragment(e,r);if(c&&(!t||c.validEnd))return J.from(s.map(d=>d.createAndFill()));for(let d=0;d<a.next.length;d++){let{type:u,next:p}=a.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let f=o(p,s.concat(u));if(f)return f}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let a=[];for(let s=i;s.type;s=s.via)a.push(s.type);return a.reverse()}for(let a=0;a<o.next.length;a++){let{type:s,next:c}=o.next[a];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!i.type||c.validEnd)&&(r.push({match:s.contentMatch,type:s,via:i}),t[s.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)o+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return o}).join(`
|
|
73
|
+
`)}}Sr.empty=new Sr(!0);class _k{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Iu(n){let e=[];do e.push(Bk(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Bk(n){let e=[];do e.push(Pk(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Pk(n){let e=Vk(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Ik(n,e);else break;return e}function Ru(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Ik(n,e){let t=Ru(n),r=t;return n.eat(",")&&(n.next!="}"?r=Ru(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Rk(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let a=t[o];a.groups.indexOf(e)>-1&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Vk(n){if(n.eat("(")){let e=Iu(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Rk(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Lk(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(a,s,c){let d={term:c,to:s};return e[a].push(d),d}function i(a,s){a.forEach(c=>c.to=s)}function o(a,s){if(a.type=="choice")return a.exprs.reduce((c,d)=>c.concat(o(d,s)),[]);if(a.type=="seq")for(let c=0;;c++){let d=o(a.exprs[c],s);if(c==a.exprs.length-1)return d;i(d,s=t())}else if(a.type=="star"){let c=t();return r(s,c),i(o(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=t();return i(o(a.expr,s),c),i(o(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(s)].concat(o(a.expr,s));if(a.type=="range"){let c=s;for(let d=0;d<a.min;d++){let u=t();i(o(a.expr,c),u),c=u}if(a.max==-1)i(o(a.expr,c),c);else for(let d=a.min;d<a.max;d++){let u=t();r(c,u),i(o(a.expr,c),u),c=u}return[r(c)]}else{if(a.type=="name")return[r(s,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Vu(n,e){return e-n}function Lu(n,e){let t=[];return r(e),t.sort(Vu);function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let a=0;a<o.length;a++){let{term:s,to:c}=o[a];!s&&t.indexOf(c)==-1&&r(c)}}}function $k(n){let e=Object.create(null);return t(Lu(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:s,to:c})=>{if(!s)return;let d;for(let u=0;u<i.length;u++)i[u][0]==s&&(d=i[u][1]);Lu(n,c).forEach(u=>{d||i.push([s,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new Sr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let s=i[a][1].sort(Vu);o.next.push({type:i[a][0],next:e[s.join(",")]||t(s)})}return o}}function Fk(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],o=!i.validEnd,a=[];for(let s=0;s<i.next.length;s++){let{type:c,next:d}=i.next[s];a.push(c.name),o&&!(c.isText||c.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function $u(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Fu(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function zu(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new zk(n[t]);return e}let Hu=class Zh{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=zu(r.attrs),this.defaultAttrs=$u(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Sr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Fu(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Mr(this,this.computeAttrs(e),J.from(t),Be.setFrom(r))}createChecked(e=null,t,r){return t=J.from(t),this.checkContent(t),new Mr(this,this.computeAttrs(e),t,Be.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=J.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(J.empty,!0);return o?new Mr(this,e,t.append(o),Be.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Be.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,a)=>r[o]=new Zh(o,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class zk{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Go{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=zu(i.attrs),this.excluded=null;let o=$u(this.attrs);this.instance=o?new Be(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Be(this,Fu(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,a)=>r[o]=new Go(o,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class Hk{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=st.from(e.nodes),t.marks=st.from(e.marks||{}),this.nodes=Hu.compile(this.spec.nodes,this),this.marks=Go.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],a=o.spec.content||"",s=o.spec.marks;o.contentMatch=r[a]||(r[a]=Sr.parse(a,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=s=="_"?null:s?Yu(this,s.split(" ")):s==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],a=o.spec.excludes;o.excluded=a==null?[o]:a==""?[]:Yu(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Hu){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Ko(r,r.defaultAttrs,e,Be.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Mr.fromJSON(this,e)}markFromJSON(e){return Be.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function Yu(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],a=o;if(o)t.push(o);else for(let s in n.marks){let c=n.marks[s];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class ti{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new qu(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new qu(this,t,!0);return r.addAll(e,t.from,t.to),oe.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(Uk(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let a=o.getAttrs(e);if(a===!1)continue;o.attrs=a||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let a=this.styles[o],s=a.style;if(!(s.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(a.getAttrs){let c=a.getAttrs(t);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let s=t[a];if((s.priority==null?50:s.priority)<o)break}t.splice(a,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Ku(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(a=>{r(a=Ku(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ti(e,ti.schemaRules(e)))}}const ju={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Yk={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Uu={ol:!0,ul:!0},Jo=1,Qo=2,Ki=4;function Wu(n,e,t){return e!=null?(e?Jo:0)|(e==="full"?Qo:0):n&&n.whitespace=="pre"?Jo|Qo:t&~Ki}class Xo{constructor(e,t,r,i,o,a,s){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=s,this.content=[],this.activeMarks=Be.none,this.stashMarks=[],this.match=a||(s&Ki?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(J.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Jo)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=J.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(J.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):qk(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!ju.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class qu{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i=t.topNode,o,a=Wu(null,t.preserveWhitespace,0)|(r?Ki:0);i?o=new Xo(i.type,i.attrs,Be.none,Be.none,!0,t.topMatch||i.type.contentMatch,a):r?o=new Xo(null,null,Be.none,Be.none,!0,null,a):o=new Xo(e.schema.topNodeType,null,Be.none,Be.none,!0,null,a),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let r=e.getAttribute("style");if(!r)return t();let i=this.readStyles(Wk(r));if(!i)return;let[o,a]=i,s=this.top;for(let c=0;c<a.length;c++)this.removePendingMark(a[c],s);for(let c=0;c<o.length;c++)this.addPendingMark(o[c]);t();for(let c=0;c<o.length;c++)this.removePendingMark(o[c],s);for(let c=0;c<a.length;c++)this.addPendingMark(a[c])}addTextNode(e){let t=e.nodeValue,r=this.top;if(r.options&Qo||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(r.options&Jo)r.options&Qo?t=t.replace(/\r\n?/g,`
|
|
74
|
+
`):t=t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r=e.nodeName.toLowerCase(),i;Uu.hasOwnProperty(r)&&this.parser.normalizeLists&&jk(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,t));if(o?o.ignore:Yk.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let a,s=this.top,c=this.needsBlock;if(ju.hasOwnProperty(r))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),a=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),a&&this.sync(s),this.needsBlock=c}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
75
|
+
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Be.none,r=Be.none;for(let i=0;i<e.length;i+=2)for(let o=void 0;;){let a=this.parser.matchStyle(e[i],e[i+1],this,o);if(!a)break;if(a.ignore)return null;if(a.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(s=>{a.clearMark(s)&&(r=s.addToSet(r))}):t=this.parser.schema.marks[a.mark].create(a.attrs).addToSet(t),a.consuming===!1)o=a;else break}return[t,r]}addElementByRule(e,t,r){let i,o,a;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(a=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(a));let s=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c)}i&&this.sync(s)&&this.open--,a&&this.removePendingMark(a,s)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,a=r==null?null:e.childNodes[r];o!=a;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],a=o.findWrapping(e);if(a&&(!t||t.length>a.length)&&(t=a,r=o,!a.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)(!t.type||t.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let a=Wu(e,i,o.options);o.options&Ki&&o.content.length==0&&(a|=Ki),this.nodes.push(new Xo(e,t,o.activeMarks,o.pendingMarks,r,null,a)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),a=(s,c)=>{for(;s>=0;s--){let d=t[s];if(d==""){if(s==t.length-1||s==0)continue;for(;c>=o;c--)if(a(s-1,c))return!0;return!1}else{let u=c>0||c==0&&i?this.nodes[c].type:r&&c>=o?r.node(c-o).type:null;if(!u||u.name!=d&&u.groups.indexOf(d)==-1)return!1;c--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=Kk(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let a=i.popFromStashMark(e);a&&i.type&&i.type.allowsMarkType(a.type)&&(i.activeMarks=a.addToSet(i.activeMarks))}if(i==t)break}}}function jk(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Uu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Uk(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Wk(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function Ku(n){let e={};for(let t in n)e[t]=n[t];return e}function qk(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],a=s=>{o.push(s);for(let c=0;c<s.edgeCount;c++){let{type:d,next:u}=s.edge(c);if(d==e||o.indexOf(u)<0&&a(u))return!0}};if(a(i.contentMatch))return!0}}function Kk(n,e){for(let t=0;t<e.length;t++)if(n.eq(e[t]))return e[t]}class yn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Js(t).createDocumentFragment());let i=r,o=[];return e.forEach(a=>{if(o.length||a.marks.length){let s=0,c=0;for(;s<o.length&&c<a.marks.length;){let d=a.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(o[s][0])||d.type.spec.spanning===!1)break;s++,c++}for(;s<o.length;)i=o.pop()[1];for(;c<a.marks.length;){let d=a.marks[c++],u=this.serializeMark(d,a.isInline,t);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=yn.renderSpec(Js(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&yn.renderSpec(Js(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let a,s=r?e.createElementNS(r,i):e.createElement(i),c=t[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let u in c)if(c[u]!=null){let p=u.indexOf(" ");p>0?s.setAttributeNS(u.slice(0,p),u.slice(p+1),c[u]):s.setAttribute(u,c[u])}}for(let u=d;u<t.length;u++){let p=t[u];if(p===0){if(u<t.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}else{let{dom:f,contentDOM:h}=yn.renderSpec(e,p,r);if(s.appendChild(f),h){if(a)throw new RangeError("Multiple content holes");a=h}}}return{dom:s,contentDOM:a}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new yn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Gu(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Gu(e.marks)}}function Gu(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Js(n){return n.document||window.document}const Ju=65535,Qu=Math.pow(2,16);function Gk(n,e){return n+e*Qu}function Xu(n){return n&Ju}function Jk(n){return(n-(n&Ju))/Qu}const Zu=1,ep=2,Zo=4,tp=8;class Qs{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&tp)>0}get deletedBefore(){return(this.delInfo&(Zu|Zo))>0}get deletedAfter(){return(this.delInfo&(ep|Zo))>0}get deletedAcross(){return(this.delInfo&Zo)>0}}class Ot{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Ot.empty)return Ot.empty}recover(e){let t=0,r=Xu(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+Jk(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let c=this.ranges[s]-(this.inverted?i:0);if(c>e)break;let d=this.ranges[s+o],u=this.ranges[s+a],p=c+d;if(e<=p){let f=d?e==c?-1:e==p?1:t:t,h=c+i+(f<0?0:u);if(r)return h;let m=e==(t<0?c:p)?null:Gk(s/3,e-c),y=e==c?ep:e==p?Zu:Zo;return(t<0?e!=c:e!=p)&&(y|=tp),new Qs(h,y,m)}i+=u-d}return r?e+i:new Qs(e+i,0,null)}touches(e,t){let r=0,i=Xu(t),o=this.inverted?2:1,a=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let c=this.ranges[s]-(this.inverted?r:0);if(c>e)break;let d=this.ranges[s+o],u=c+d;if(e<=u&&s==i*3)return!0;r+=this.ranges[s+a]-d}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let a=this.ranges[i],s=a-(this.inverted?o:0),c=a+(this.inverted?0:o),d=this.ranges[i+t],u=this.ranges[i+r];e(s,s+d,c,c+u),o+=u-d}}invert(){return new Ot(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Ot.empty:new Ot(e<0?[0,-e,0]:[0,0,e])}}Ot.empty=new Ot([]);class ni{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new ni(this.maps,this.mirror,e,t)}copy(){return new ni(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new ni;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let a=this.maps[o],s=a.mapResult(e,t);if(s.recover!=null){let c=this.getMirror(o);if(c!=null&&c>o&&c<this.to){o=c,e=this.maps[c].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new Qs(e,i,null)}}const Xs=Object.create(null);class pt{getMap(){return Ot.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Xs[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Xs)throw new RangeError("Duplicate use of step JSON ID "+e);return Xs[e]=t,t.prototype.jsonID=e,t}}class Ke{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Ke(e,null)}static fail(e){return new Ke(null,e)}static fromReplace(e,t,r,i){try{return Ke.ok(e.replace(t,r,i))}catch(o){if(o instanceof Uo)return Ke.fail(o.message);throw o}}}function Zs(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Zs(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return J.fromArray(r)}class Kn extends pt{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new oe(Zs(t.content,(a,s)=>!a.isAtom||!s.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return Ke.fromReplace(e,this.from,this.to,o)}invert(){return new vn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Kn(t.pos,r.pos,this.mark)}merge(e){return e instanceof Kn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Kn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Kn(t.from,t.to,e.markFromJSON(t.mark))}}pt.jsonID("addMark",Kn);class vn extends pt{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new oe(Zs(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Ke.fromReplace(e,this.from,this.to,r)}invert(){return new Kn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new vn(t.pos,r.pos,this.mark)}merge(e){return e instanceof vn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new vn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new vn(t.from,t.to,e.markFromJSON(t.mark))}}pt.jsonID("removeMark",vn);class Gn extends pt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ke.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ke.fromReplace(e,this.pos,this.pos+1,new oe(J.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Gn(this.pos,t.marks[i]);return new Gn(this.pos,this.mark)}}return new ri(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Gn(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Gn(t.pos,e.markFromJSON(t.mark))}}pt.jsonID("addNodeMark",Gn);class ri extends pt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ke.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ke.fromReplace(e,this.pos,this.pos+1,new oe(J.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Gn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ri(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ri(t.pos,e.markFromJSON(t.mark))}}pt.jsonID("removeNodeMark",ri);class lt extends pt{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&el(e,this.from,this.to)?Ke.fail("Structure replace would overwrite content"):Ke.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ot([this.from,this.to-this.from,this.slice.size])}invert(e){return new lt(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new lt(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof lt)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?oe.empty:new oe(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new lt(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?oe.empty:new oe(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new lt(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new lt(t.from,t.to,oe.fromJSON(e,t.slice),!!t.structure)}}pt.jsonID("replace",lt);class tt extends pt{constructor(e,t,r,i,o,a,s=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=a,this.structure=s}apply(e){if(this.structure&&(el(e,this.from,this.gapFrom)||el(e,this.gapTo,this.to)))return Ke.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ke.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Ke.fromReplace(e,this.from,this.to,r):Ke.fail("Content does not fit in gap")}getMap(){return new Ot([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new tt(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new tt(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new tt(t.from,t.to,t.gapFrom,t.gapTo,oe.fromJSON(e,t.slice),t.insert,!!t.structure)}}pt.jsonID("replaceAround",tt);function el(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let a=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function Qk(n,e,t,r){let i=[],o=[],a,s;n.doc.nodesBetween(e,t,(c,d,u)=>{if(!c.isInline)return;let p=c.marks;if(!r.isInSet(p)&&u.type.allowsMarkType(r.type)){let f=Math.max(d,e),h=Math.min(d+c.nodeSize,t),m=r.addToSet(p);for(let y=0;y<p.length;y++)p[y].isInSet(m)||(a&&a.to==f&&a.mark.eq(p[y])?a.to=h:i.push(a=new vn(f,h,p[y])));s&&s.to==f?s.to=h:o.push(s=new Kn(f,h,r))}}),i.forEach(c=>n.step(c)),o.forEach(c=>n.step(c))}function Xk(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(a,s)=>{if(!a.isInline)return;o++;let c=null;if(r instanceof Go){let d=a.marks,u;for(;u=r.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let d=Math.min(s+a.nodeSize,t);for(let u=0;u<c.length;u++){let p=c[u],f;for(let h=0;h<i.length;h++){let m=i[h];m.step==o-1&&p.eq(i[h].style)&&(f=m)}f?(f.to=d,f.step=o):i.push({style:p,from:Math.max(s,e),to:d,step:o})}}}),i.forEach(a=>n.step(new vn(a.from,a.to,a.style)))}function Zk(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],a=e+1;for(let s=0;s<i.childCount;s++){let c=i.child(s),d=a+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new lt(a,d,oe.empty));else{r=u;for(let p=0;p<c.marks.length;p++)t.allowsMarkType(c.marks[p].type)||n.step(new vn(a,d,c.marks[p]));if(c.isText&&!t.spec.code){let p,f=/\r?\n|\r/g,h;for(;p=f.exec(c.text);)h||(h=new oe(J.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new lt(a+p.index,a+p.index+p[0].length,h))}}a=d}if(!r.validEnd){let s=r.fillBefore(J.empty,!0);n.replace(a,a,new oe(s,0,0))}for(let s=o.length-1;s>=0;s--)n.step(o[s])}function ex(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function ii(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(o,a,t))return r;if(r==0||i.type.spec.isolating||!ex(i,o,a))break}return null}function tx(n,e,t){let{$from:r,$to:i,depth:o}=e,a=r.before(o+1),s=i.after(o+1),c=a,d=s,u=J.empty,p=0;for(let m=o,y=!1;m>t;m--)y||r.index(m)>0?(y=!0,u=J.from(r.node(m).copy(u)),p++):c--;let f=J.empty,h=0;for(let m=o,y=!1;m>t;m--)y||i.after(m+1)<i.end(m)?(y=!0,f=J.from(i.node(m).copy(f)),h++):d++;n.step(new tt(c,d,a,s,new oe(u.append(f),p,h),u.size-p,!0))}function tl(n,e,t=null,r=n){let i=nx(n,e),o=i&&rx(r,e);return o?i.map(np).concat({type:e,attrs:t}).concat(o.map(np)):null}function np(n){return{type:n,attrs:null}}function nx(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.contentMatchAt(r).findWrapping(e);if(!o)return null;let a=o.length?o[0]:e;return t.canReplaceWith(r,i,a)?o:null}function rx(n,e){let{parent:t,startIndex:r,endIndex:i}=n,o=t.child(r),a=e.contentMatch.findWrapping(o.type);if(!a)return null;let c=(a.length?a[a.length-1]:e).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(t.child(d).type);return!c||!c.validEnd?null:a}function ix(n,e,t){let r=J.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let s=t[a].type.contentMatch.matchFragment(r);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=J.from(t[a].type.create(t[a].attrs,r))}let i=e.start,o=e.end;n.step(new tt(i,o,i,o,new oe(r,0,0),t.length,!0))}function ox(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(a,s)=>{if(a.isTextblock&&!a.hasMarkup(r,i)&&ax(n.doc,n.mapping.slice(o).map(s),r)){n.clearIncompatible(n.mapping.slice(o).map(s,1),r);let c=n.mapping.slice(o),d=c.map(s,1),u=c.map(s+a.nodeSize,1);return n.step(new tt(d,u,d+1,u-1,new oe(J.from(r.create(i,null,a.marks)),0,0),1,!0)),!1}})}function ax(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function sx(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let a=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,a);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new tt(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new oe(J.from(a),0,0),1,!0))}function oi(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,a=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=t-2;d>o;d--,u--){let p=i.node(d),f=i.index(d);if(p.type.spec.isolating)return!1;let h=p.content.cutByIndex(f,p.childCount),m=r&&r[u+1];m&&(h=h.replaceChild(0,m.type.create(m.attrs)));let y=r&&r[u]||p;if(!p.canReplace(f+1,p.childCount)||!y.type.validContent(h))return!1}let s=i.indexAfter(o),c=r&&r[0];return i.node(o).canReplaceWith(s,s,c?c.type:i.node(o+1).type)}function lx(n,e,t=1,r){let i=n.doc.resolve(e),o=J.empty,a=J.empty;for(let s=i.depth,c=i.depth-t,d=t-1;s>c;s--,d--){o=J.from(i.node(s).copy(o));let u=r&&r[d];a=J.from(u?u.type.create(u.attrs,a):i.node(s).copy(a))}n.step(new lt(e,e,new oe(o.append(a),t,t),!0))}function Jn(n,e){let t=n.resolve(e),r=t.index();return rp(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function rp(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function ea(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,a,s=r.index(i);if(i==r.depth?(o=r.nodeBefore,a=r.nodeAfter):t>0?(o=r.node(i+1),s++,a=r.node(i).maybeChild(s)):(o=r.node(i).maybeChild(s-1),a=r.node(i+1)),o&&!o.isTextblock&&rp(o,a)&&r.node(i).canReplace(s,s+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function cx(n,e,t){let r=new lt(e-t,e+t,oe.empty,!0);n.step(r)}function dx(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function ip(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let o=0;o<t.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(t.openStart==0&&t.size?2:1);o++)for(let a=r.depth;a>=0;a--){let s=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(s>0?1:0),d=r.node(a),u=!1;if(o==1)u=d.canReplace(c,c,i);else{let p=d.contentMatchAt(c).findWrapping(i.firstChild.type);u=p&&d.canReplaceWith(c,c,p[0])}if(u)return s==0?r.pos:s<0?r.before(a+1):r.after(a+1)}return null}function nl(n,e,t=e,r=oe.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return op(i,o,r)?new lt(e,t,r):new ux(i,o,r).fit()}function op(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class ux{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=J.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=J.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,a=r.depth,s=i.depth;for(;a&&s&&o.childCount==1;)o=o.firstChild.content,a--,s--;let c=new oe(o,a,s);return e>-1?new tt(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new lt(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=rl(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let a=i.firstChild;for(let s=this.depth;s>=0;s--){let{type:c,match:d}=this.frontier[s],u,p=null;if(t==1&&(a?d.matchType(a.type)||(p=d.fillBefore(J.from(a),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:s,parent:o,inject:p};if(t==2&&a&&(u=d.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:s,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=rl(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new oe(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=rl(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new oe(Gi(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new oe(Gi(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let y=0;y<o.length;y++)this.openFrontierNode(o[y]);let a=this.unplaced,s=r?r.content:a.content,c=a.openStart-e,d=0,u=[],{match:p,type:f}=this.frontier[t];if(i){for(let y=0;y<i.childCount;y++)u.push(i.child(y));p=p.matchFragment(i)}let h=s.size+e-(a.content.size-a.openEnd);for(;d<s.childCount;){let y=s.child(d),w=p.matchType(y.type);if(!w)break;d++,(d>1||c==0||y.content.size)&&(p=w,u.push(ap(y.mark(f.allowedMarks(y.marks)),d==1?c:0,d==s.childCount?h:-1)))}let m=d==s.childCount;m||(h=-1),this.placed=Ji(this.placed,t,J.from(u)),this.frontier[t].match=p,m&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,w=s;y<h;y++){let x=w.lastChild;this.frontier.push({type:x.type,match:x.contentMatchAt(x.childCount)}),w=x.content}this.unplaced=m?e==0?oe.empty:new oe(Gi(a.content,e-1,1),e-1,h<0?a.openEnd:e-1):new oe(Gi(a.content,e,d),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!il(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=il(e,t,i,r,o);if(a){for(let s=t-1;s>=0;s--){let{match:c,type:d}=this.frontier[s],u=il(e,s,d,c,!0);if(!u||u.childCount)continue e}return{depth:t,fit:a,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ji(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ji(this.placed,this.depth,J.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(J.empty,!0);t.childCount&&(this.placed=Ji(this.placed,this.frontier.length,t))}}function Gi(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Gi(n.firstChild.content,e-1,t)))}function Ji(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ji(n.lastChild.content,e-1,t)))}function rl(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function ap(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,ap(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(J.empty,!0)))),n.copy(r)}function il(n,e,t,r,i){let o=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==o.childCount&&!t.compatibleContent(o.type))return null;let s=r.fillBefore(o.content,!0,a);return s&&!px(t,o.content,a)?s:null}function px(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function fx(n){return n.spec.defining||n.spec.definingForContent}function hx(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),o=n.doc.resolve(t);if(op(i,o,r))return n.step(new lt(e,t,r));let a=lp(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let s=-(i.depth+1);a.unshift(s);for(let f=i.depth,h=i.pos-1;f>0;f--,h--){let m=i.node(f).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;a.indexOf(f)>-1?s=f:i.before(f)==h&&a.splice(1,0,-f)}let c=a.indexOf(s),d=[],u=r.openStart;for(let f=r.content,h=0;;h++){let m=f.firstChild;if(d.push(m),h==r.openStart)break;f=m.content}for(let f=u-1;f>=0;f--){let h=d[f],m=fx(h.type);if(m&&!h.sameMarkup(i.node(Math.abs(s)-1)))u=f;else if(m||!h.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let h=(f+u+1)%(r.openStart+1),m=d[h];if(m)for(let y=0;y<a.length;y++){let w=a[(y+c)%a.length],x=!0;w<0&&(x=!1,w=-w);let C=i.node(w-1),N=i.index(w-1);if(C.canReplaceWith(N,N,m.type,m.marks))return n.replace(i.before(w),x?o.after(w):t,new oe(sp(r.content,0,r.openStart,h),h,r.openEnd))}}let p=n.steps.length;for(let f=a.length-1;f>=0&&(n.replace(e,t,r),!(n.steps.length>p));f--){let h=a[f];h<0||(e=i.before(h),t=o.after(h))}}function sp(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(sp(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),a=o.fillBefore(n).append(n);n=a.append(o.matchFragment(a).fillBefore(J.empty,!0))}return n}function mx(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=dx(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new oe(J.from(r),0,0))}function gx(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=lp(r,i);for(let a=0;a<o.length;a++){let s=o[a],c=a==o.length-1;if(c&&s==0||r.node(s).type.contentMatch.validEnd)return n.delete(r.start(s),i.end(s));if(s>0&&(c||r.node(s-1).canReplace(r.index(s-1),i.indexAfter(s-1))))return n.delete(r.before(s),i.after(s))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a)return n.delete(r.before(a),t);n.delete(e,t)}function lp(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(o<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class ai extends pt{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ke.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Ke.fromReplace(e,this.pos,this.pos+1,new oe(J.from(i),0,t.isLeaf?0:1))}getMap(){return Ot.empty}invert(e){return new ai(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ai(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new ai(t.pos,t.attr,t.value)}}pt.jsonID("attr",ai);class Qi extends pt{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Ke.ok(r)}getMap(){return Ot.empty}invert(e){return new Qi(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Qi(t.attr,t.value)}}pt.jsonID("docAttr",Qi);let si=class extends Error{};si=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},si.prototype=Object.create(Error.prototype),si.prototype.constructor=si,si.prototype.name="TransformError";class yx{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ni}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new si(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=oe.empty){let i=nl(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new oe(J.from(r),0,0))}delete(e,t){return this.replace(e,t,oe.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return hx(this,e,t,r),this}replaceRangeWith(e,t,r){return mx(this,e,t,r),this}deleteRange(e,t){return gx(this,e,t),this}lift(e,t){return tx(this,e,t),this}join(e,t=1){return cx(this,e,t),this}wrap(e,t){return ix(this,e,t),this}setBlockType(e,t=e,r,i=null){return ox(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return sx(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new ai(e,t,r)),this}setDocAttribute(e,t){return this.step(new Qi(e,t)),this}addNodeMark(e,t){return this.step(new Gn(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Be)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new ri(e,t)),this}split(e,t=1,r){return lx(this,e,t,r),this}addMark(e,t,r){return Qk(this,e,t,r),this}removeMark(e,t,r){return Xk(this,e,t,r),this}clearIncompatible(e,t,r){return Zk(this,e,t,r),this}}const ol=Object.create(null);class ve{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new vx(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=oe.empty){let r=t.content.lastChild,i=null;for(let s=0;s<t.openEnd;s++)i=r,r=r.lastChild;let o=e.steps.length,a=this.ranges;for(let s=0;s<a.length;s++){let{$from:c,$to:d}=a[s],u=e.mapping.slice(o);e.replaceRange(u.map(c.pos),u.map(d.pos),s?oe.empty:t),s==0&&up(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:a,$to:s}=i[o],c=e.mapping.slice(r),d=c.map(a.pos),u=c.map(s.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,t),up(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new ye(e):li(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let a=t<0?li(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):li(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new tn(e.node(0))}static atStart(e){return li(e,e,0,0,1)||new tn(e)}static atEnd(e){return li(e,e,e.content.size,e.childCount,-1)||new tn(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ol[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in ol)throw new RangeError("Duplicate use of selection JSON ID "+e);return ol[e]=t,t.prototype.jsonID=e,t}getBookmark(){return ye.between(this.$anchor,this.$head).getBookmark()}}ve.prototype.visible=!0;class vx{constructor(e,t){this.$from=e,this.$to=t}}let cp=!1;function dp(n){!cp&&!n.parent.inlineContent&&(cp=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class ye extends ve{constructor(e,t=e){dp(e),dp(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ve.near(r);let i=e.resolve(t.map(this.anchor));return new ye(i.parent.inlineContent?i:r,r)}replace(e,t=oe.empty){if(super.replace(e,t),t==oe.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ye&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ta(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ye(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=ve.findFrom(t,r,!0)||ve.findFrom(t,-r,!0);if(o)t=o.$head;else return ve.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ve.findFrom(e,-r,!0)||ve.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new ye(e,t)}}ve.jsonID("text",ye);class ta{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ta(e.map(this.anchor),e.map(this.head))}resolve(e){return ye.between(e.resolve(this.anchor),e.resolve(this.head))}}class pe extends ve{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?ve.near(o):new pe(o)}content(){return new oe(J.from(this.node),0,0)}eq(e){return e instanceof pe&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new al(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new pe(e.resolve(t.anchor))}static create(e,t){return new pe(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}pe.prototype.visible=!1,ve.jsonID("node",pe);class al{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new ta(r,r):new al(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&pe.isSelectable(r)?new pe(t):ve.near(t)}}class tn extends ve{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=oe.empty){if(t==oe.empty){e.delete(0,e.doc.content.size);let r=ve.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new tn(e)}map(e){return new tn(e)}eq(e){return e instanceof tn}getBookmark(){return bx}}ve.jsonID("all",tn);const bx={map(){return this},resolve(n){return new tn(n)}};function li(n,e,t,r,i,o=!1){if(e.inlineContent)return ye.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let s=e.child(a);if(s.isAtom){if(!o&&pe.isSelectable(s))return pe.create(n,t-(i<0?s.nodeSize:0))}else{let c=li(n,s,t+i,i<0?s.childCount:0,i,o);if(c)return c}t+=s.nodeSize*i}return null}function up(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof lt||i instanceof tt))return;let o=n.mapping.maps[r],a;o.forEach((s,c,d,u)=>{a==null&&(a=u)}),n.setSelection(ve.near(n.doc.resolve(a),t))}const pp=1,na=2,fp=4;class wx extends yx{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|pp)&~na,this.storedMarks=null,this}get selectionSet(){return(this.updated&pp)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=na,this}ensureMarks(e){return Be.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&na)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~na,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Be.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let a=this.doc.resolve(t);o=r==t?a.marks():a.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(ve.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=fp,this}get scrolledIntoView(){return(this.updated&fp)>0}}function hp(n,e){return!e||!n?n:n.bind(e)}class Xi{constructor(e,t,r){this.name=e,this.init=hp(t.init,r),this.apply=hp(t.apply,r)}}const kx=[new Xi("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Xi("selection",{init(n,e){return n.selection||ve.atStart(e.doc)},apply(n){return n.selection}}),new Xi("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Xi("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class sl{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=kx.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Xi(r.key,r.spec.state,r))})}}class ci{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let a=0;a<this.config.plugins.length;a++){let s=this.config.plugins[a];if(s.spec.appendTransaction){let c=i?i[a].n:0,d=i?i[a].state:this,u=c<t.length&&s.spec.appendTransaction.call(s,c?t.slice(c):t,d,r);if(u&&r.filterTransaction(u,a)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let p=0;p<this.config.plugins.length;p++)i.push(p<a?{state:r,n:t.length}:{state:this,n:0})}t.push(u),r=r.applyInner(u),o=!0}i&&(i[a]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new ci(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new wx(this)}static create(e){let t=new sl(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ci(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new sl(this.schema,e.plugins),r=t.fields,i=new ci(t);for(let o=0;o<r.length;o++){let a=r[o].name;i[a]=this.hasOwnProperty(a)?this[a]:r[o].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new sl(e.schema,e.plugins),o=new ci(i);return i.fields.forEach(a=>{if(a.name=="doc")o.doc=Mr.fromJSON(e.schema,t.doc);else if(a.name=="selection")o.selection=ve.fromJSON(o.doc,t.selection);else if(a.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let s in r){let c=r[s],d=c.spec.state;if(c.key==a.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(t,s)){o[a.name]=d.fromJSON.call(c,e,t[s],o);return}}o[a.name]=a.init(e,o)}}),o}}function mp(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=mp(i,e,{})),t[r]=i}return t}class Mt{constructor(e){this.spec=e,this.props={},e.props&&mp(e.props,this,this.props),this.key=e.key?e.key.key:gp("plugin")}getState(e){return e[this.key]}}const ll=Object.create(null);function gp(n){return n in ll?n+"$"+ ++ll[n]:(ll[n]=0,n+"$")}class bn{constructor(e="key"){this.key=gp(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const bt=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Zi=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let yp=null;const En=function(n,e,t){let r=yp||(yp=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Dr=function(n,e,t,r){return t&&(vp(n,e,t,r,-1)||vp(n,e,t,r,1))},xx=/^(img|br|input|textarea|hr)$/i;function vp(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:wn(n))){let o=n.parentNode;if(!o||o.nodeType!=1||cl(n)||xx.test(n.nodeName)||n.contentEditable=="false")return!1;e=bt(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?wn(n):0}else return!1}}function wn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Cx(n,e,t){for(let r=e==0,i=e==wn(n);r||i;){if(n==t)return!0;let o=bt(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==wn(n)}}function cl(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const ra=function(n){return n.focusNode&&Dr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Ar(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function Tx(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Mx(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const kn=typeof navigator<"u"?navigator:null,bp=typeof document<"u"?document:null,Qn=kn&&kn.userAgent||"",dl=/Edge\/(\d+)/.exec(Qn),wp=/MSIE \d/.exec(Qn),ul=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Qn),St=!!(wp||ul||dl),Xn=wp?document.documentMode:ul?+ul[1]:dl?+dl[1]:0,nn=!St&&/gecko\/(\d+)/i.test(Qn);nn&&+(/Firefox\/(\d+)/.exec(Qn)||[0,0])[1];const pl=!St&&/Chrome\/(\d+)/.exec(Qn),ft=!!pl,Sx=pl?+pl[1]:0,wt=!St&&!!kn&&/Apple Computer/.test(kn.vendor),di=wt&&(/Mobile\/\w+/.test(Qn)||!!kn&&kn.maxTouchPoints>2),zt=di||(kn?/Mac/.test(kn.platform):!1),Dx=kn?/Win/.test(kn.platform):!1,rn=/Android \d/.test(Qn),eo=!!bp&&"webkitFontSmoothing"in bp.documentElement.style,Ax=eo?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ex(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Nn(n,e){return typeof n=="number"?n:n[e]}function Nx(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function kp(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let a=t||n.dom;a;a=Zi(a)){if(a.nodeType!=1)continue;let s=a,c=s==o.body,d=c?Ex(o):Nx(s),u=0,p=0;if(e.top<d.top+Nn(r,"top")?p=-(d.top-e.top+Nn(i,"top")):e.bottom>d.bottom-Nn(r,"bottom")&&(p=e.bottom-e.top>d.bottom-d.top?e.top+Nn(i,"top")-d.top:e.bottom-d.bottom+Nn(i,"bottom")),e.left<d.left+Nn(r,"left")?u=-(d.left-e.left+Nn(i,"left")):e.right>d.right-Nn(r,"right")&&(u=e.right-d.right+Nn(i,"right")),u||p)if(c)o.defaultView.scrollBy(u,p);else{let f=s.scrollLeft,h=s.scrollTop;p&&(s.scrollTop+=p),u&&(s.scrollLeft+=u);let m=s.scrollLeft-f,y=s.scrollTop-h;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}if(c||/^(fixed|sticky)$/.test(getComputedStyle(a).position))break}}function Ox(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,a=t+1;a<Math.min(innerHeight,e.bottom);a+=5){let s=n.root.elementFromPoint(o,a);if(!s||s==n.dom||!n.dom.contains(s))continue;let c=s.getBoundingClientRect();if(c.top>=t-20){r=s,i=c.top;break}}return{refDOM:r,refTop:i,stack:xp(n.dom)}}function xp(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Zi(r));return e}function _x({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Cp(t,r==0?0:r-e)}function Cp(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:o}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let ui=null;function Bx(n){if(n.setActive)return n.setActive();if(ui)return n.focus(ui);let e=xp(n);n.focus(ui==null?{get preventScroll(){return ui={preventScroll:!0},!0}}:void 0),ui||(ui=!1,Cp(e,0))}function Tp(n,e){let t,r=2e8,i,o=0,a=e.top,s=e.top,c,d;for(let u=n.firstChild,p=0;u;u=u.nextSibling,p++){let f;if(u.nodeType==1)f=u.getClientRects();else if(u.nodeType==3)f=En(u).getClientRects();else continue;for(let h=0;h<f.length;h++){let m=f[h];if(m.top<=a&&m.bottom>=s){a=Math.max(m.bottom,a),s=Math.min(m.top,s);let y=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(y<r){t=u,r=y,i=y&&t.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&y&&(o=p+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!c&&m.left<=e.left&&m.right>=e.left&&(c=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!t&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=p+1)}}return!t&&c&&(t=c,i=d,r=0),t&&t.nodeType==3?Px(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:Tp(t,i)}function Px(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i<t;i++){r.setEnd(n,i+1),r.setStart(n,i);let o=Zn(r,1);if(o.top!=o.bottom&&fl(e,o))return{node:n,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function fl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function Ix(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left<n.getBoundingClientRect().left?t:n}function Rx(n,e,t){let{node:r,offset:i}=Tp(e,t),o=-1;if(r.nodeType==1&&!r.firstChild){let a=r.getBoundingClientRect();o=a.left!=a.right&&t.left>(a.left+a.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function Vx(n,e,t,r){let i=-1;for(let o=e,a=!1;o!=n.dom;){let s=n.docView.nearestDesc(o,!0);if(!s)return null;if(s.dom.nodeType==1&&(s.node.isBlock&&s.parent&&!a||!s.contentDOM)){let c=s.dom.getBoundingClientRect();if(s.node.isBlock&&s.parent&&!a&&(a=!0,c.left>r.left||c.top>r.top?i=s.posBefore:(c.right<r.left||c.bottom<r.top)&&(i=s.posAfter)),!s.contentDOM&&i<0&&!s.node.isText)return(s.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?s.posBefore:s.posAfter}o=s.dom.parentNode}return i>-1?i:n.docView.posFromDOM(e,t,-1)}function Mp(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=i;;){let a=n.childNodes[o];if(a.nodeType==1){let s=a.getClientRects();for(let c=0;c<s.length;c++){let d=s[c];if(fl(e,d))return Mp(a,e,d)}}if((o=(o+1)%r)==i)break}return n}function Lx(n,e){let t=n.dom.ownerDocument,r,i=0,o=Mx(t,e.left,e.top);o&&({node:r,offset:i}=o);let a=(n.root.elementFromPoint?n.root:t).elementFromPoint(e.left,e.top),s;if(!a||!n.dom.contains(a.nodeType!=1?a.parentNode:a)){let d=n.dom.getBoundingClientRect();if(!fl(e,d)||(a=Mp(n.dom,e,d),!a))return null}if(wt)for(let d=a;r&&d;d=Zi(d))d.draggable&&(r=void 0);if(a=Ix(a,e),r){if(nn&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],p;u.nodeName=="IMG"&&(p=u.getBoundingClientRect()).right<=e.left&&p.bottom>e.top&&i++}let d;eo&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?s=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(s=Vx(n,r,i,e))}s==null&&(s=Rx(n,a,e));let c=n.docView.nearestDesc(a,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Sp(n){return n.top<n.bottom||n.left<n.right}function Zn(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(Sp(r))return r}return Array.prototype.find.call(t,Sp)||n.getBoundingClientRect()}const $x=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Dp(n,e,t){let{node:r,offset:i,atom:o}=n.docView.domFromPos(e,t<0?-1:1),a=eo||nn;if(r.nodeType==3)if(a&&($x.test(r.nodeValue)||(t<0?!i:i==r.nodeValue.length))){let c=Zn(En(r,i,i),t);if(nn&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Zn(En(r,i-1,i-1),-1);if(d.top==c.top){let u=Zn(En(r,i,i+1),-1);if(u.top!=c.top)return to(u,u.left<d.left)}}return c}else{let c=i,d=i,u=t<0?1:-1;return t<0&&!i?(d++,u=-1):t>=0&&i==r.nodeValue.length?(c--,u=1):t<0?c--:d++,to(Zn(En(r,c,d),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==wn(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return hl(c.getBoundingClientRect(),!1)}if(o==null&&i<wn(r)){let c=r.childNodes[i];if(c.nodeType==1)return hl(c.getBoundingClientRect(),!0)}return hl(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==wn(r))){let c=r.childNodes[i-1],d=c.nodeType==3?En(c,wn(c)-(a?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return to(Zn(d,1),!1)}if(o==null&&i<wn(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?En(c,0,a?0:1):c.nodeType==1?c:null:null;if(d)return to(Zn(d,-1),!0)}return to(Zn(r.nodeType==3?En(r):r,-t),t>=0)}function to(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function hl(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Ap(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function Fx(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return Ap(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let s=n.docView.nearestDesc(o,!0);if(!s)break;if(s.node.isBlock){o=s.contentDOM||s.dom;break}o=s.dom.parentNode}let a=Dp(n,i.pos,1);for(let s=o.firstChild;s;s=s.nextSibling){let c;if(s.nodeType==1)c=s.getClientRects();else if(s.nodeType==3)c=En(s,0,s.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(t=="up"?a.top-u.top>(u.bottom-a.top)*2:u.bottom-a.bottom>(a.bottom-u.top)*2))return!1}}return!0})}const zx=/[\u0590-\u08ac]/;function Hx(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,a=i==r.parent.content.size,s=n.domSelection();return!zx.test(r.parent.textContent)||!s.modify?t=="left"||t=="backward"?o:a:Ap(n,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:p}=n.domSelectionRange(),f=s.caretBidiLevel;s.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:m,focusOffset:y}=n.domSelectionRange(),w=m&&!h.contains(m.nodeType==1?m:m.parentNode)||c==m&&d==y;try{s.collapse(u,p),c&&(c!=u||d!=p)&&s.extend&&s.extend(c,d)}catch{}return f!=null&&(s.caretBidiLevel=f),w})}let Ep=null,Np=null,Op=!1;function Yx(n,e,t){return Ep==e&&Np==t?Op:(Ep=e,Np=t,Op=t=="up"||t=="down"?Fx(n,e,t):Hx(n,e,t))}const Ht=0,_p=1,Er=2,xn=3;class no{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=Ht,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,a;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(a)+a.size:this.posAtStart}else{let o,a;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((a=o.pmViewDesc)&&a.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(a):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=t>bt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),a;if(o&&(!t||o.node))if(r&&(a=o.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let a=this.children[r],s=o+a.size;if(s>e||a instanceof Ip){i=e-o;break}o=s}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Bp&&o.side>=0;r--);if(t<=0){let o,a=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,a=!1);return o&&t&&a&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?bt(o.dom)+1:0}}else{let o,a=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,a=!1);return o&&a&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?bt(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let a=r,s=0;;s++){let c=this.children[s],d=a+c.size;if(i==-1&&e<=d){let u=a+c.border;if(e>=u&&t<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,t,u);e=a;for(let p=s;p>0;p--){let f=this.children[p-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=bt(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(d>t||s==this.children.length-1)){t=d;for(let u=s+1;u<this.children.length;u++){let p=this.children[u];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){o=bt(p.dom);break}t+=p.size}o==-1&&(o=this.contentDOM.childNodes.length);break}a=d}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let o=Math.min(e,t),a=Math.max(e,t);for(let f=0,h=0;f<this.children.length;f++){let m=this.children[f],y=h+m.size;if(o>h&&a<y)return m.setSelection(e-h-m.border,t-h-m.border,r,i);h=y}let s=this.domFromPos(e,e?-1:1),c=t==e?s:this.domFromPos(t,t?-1:1),d=r.getSelection(),u=!1;if((nn||wt)&&e==t){let{node:f,offset:h}=s;if(f.nodeType==3){if(u=!!(h&&f.nodeValue[h-1]==`
|
|
76
|
+
`),u&&h==f.nodeValue.length)for(let m=f,y;m;m=m.parentNode){if(y=m.nextSibling){y.nodeName=="BR"&&(s=c={node:y.parentNode,offset:bt(y)+1});break}let w=m.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let m=f.childNodes[h-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(nn&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let f=d.focusNode.childNodes[d.focusOffset];f&&f.contentEditable=="false"&&(i=!0)}if(!(i||u&&wt)&&Dr(s.node,s.offset,d.anchorNode,d.anchorOffset)&&Dr(c.node,c.offset,d.focusNode,d.focusOffset))return;let p=!1;if((d.extend||e==t)&&!u){d.collapse(s.node,s.offset);try{e!=t&&d.extend(c.node,c.offset),p=!0}catch{}}if(!p){if(e>t){let h=s;s=c,c=h}let f=document.createRange();f.setEnd(c.node,c.offset),f.setStart(s.node,s.offset),d.removeAllRanges(),d.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],a=r+o.size;if(r==a?e<=a&&t>=r:e<a&&t>r){let s=r+o.border,c=a-o.border;if(e>=s&&t<=c){this.dirty=e==r||t==a?Er:_p,e==s&&t==c&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=xn:o.markDirty(e-s,t-s);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Er:xn}r=a}this.dirty=Er}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Er:_p;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class Bp extends no{constructor(e,t,r,i){let o,a=t.type.toDOM;if(typeof a=="function"&&(a=a(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(a.nodeType!=1){let s=document.createElement("span");s.appendChild(a),a=s}a.contentEditable="false",a.classList.add("ProseMirror-widget")}super(e,[],a,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==Ht&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class jx extends no{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Nr extends no{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],a=o&&o(t,i,r);return(!a||!a.dom)&&(a=yn.renderSpec(document,t.type.spec.toDOM(t,r))),new Nr(e,t,a.dom,a.contentDOM||a.dom)}parseRule(){return this.dirty&xn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=xn&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ht){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Ht}}slice(e,t,r){let i=Nr.create(this.parent,this.mark,!0,r),o=this.children,a=this.size;t<a&&(o=yl(o,t,a,r)),e>0&&(o=yl(o,0,e,r));for(let s=0;s<o.length;s++)o[s].parent=i;return i.children=o,i}}class er extends no{constructor(e,t,r,i,o,a,s,c,d){super(e,[],o,a),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=s}static create(e,t,r,i,o,a){let s=o.nodeViews[t.type.name],c,d=s&&s(t,o,()=>{if(!c)return a;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=d&&d.dom,p=d&&d.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:p}=yn.renderSpec(document,t.type.spec.toDOM(t)));!p&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Lp(u,r,t),d?c=new Ux(e,t,r,i,u,p||null,f,d,o,a+1):t.isText?new ia(e,t,r,i,u,f,o):new er(e,t,r,i,u,p||null,f,o,a+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>J.empty)}return e}matchesNode(e,t,r){return this.dirty==Ht&&e.eq(this.node)&&gl(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,a=o&&o.pos>-1?o:null,s=o&&o.pos<0,c=new qx(this,a&&a.node,e);Jx(this.node,this.innerDeco,(d,u,p)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!p&&c.syncToMarks(u==this.node.childCount?Be.none:this.node.child(u).marks,r,e),c.placeWidget(d,e,i)},(d,u,p,f)=>{c.syncToMarks(d.marks,r,e);let h;c.findNodeMatch(d,u,p,f)||s&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(h=c.findIndexWithChild(o.node))>-1&&c.updateNodeAt(d,u,p,h,e)||c.updateNextNode(d,u,p,e,f,i)||c.addNode(d,u,p,e,i),i+=d.nodeSize}),c.syncToMarks([],r,e),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Er)&&(a&&this.protectLocalComposition(e,a),Rp(this.contentDOM,this.children,e),di&&Qx(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ye)||r<t||i>t+this.node.content.size)return null;let o=e.domSelectionRange(),a=Xx(o.focusNode,o.focusOffset);if(!a||!this.dom.contains(a.parentNode))return null;if(this.node.inlineContent){let s=a.nodeValue,c=Zx(this.node.content,s,r-t,i-t);return c<0?null:{node:a,pos:c,text:s}}else return{node:a,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let a=new jx(this,o,t,i);e.input.compositionNodes.push(a),this.children=yl(this.children,r,r+i.length,e,a)}update(e,t,r,i){return this.dirty==xn||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ht}updateOuterDeco(e){if(gl(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Vp(this.dom,this.nodeDOM,ml(this.outerDeco,this.node,t),ml(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Pp(n,e,t,r,i){Lp(r,e,n);let o=new er(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ia extends er{constructor(e,t,r,i,o,a,s){super(e,t,r,i,o,null,a,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==xn||this.dirty!=Ht&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ht||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ht,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new ia(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=xn)}get domAtom(){return!1}}class Ip extends no{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ht&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Ux extends er{constructor(e,t,r,i,o,a,s,c,d,u){super(e,t,r,i,o,a,s,d,u),this.spec=c}update(e,t,r,i){if(this.dirty==xn)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Rp(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o<e.length;o++){let a=e[o],s=a.dom;if(s.parentNode==n){for(;s!=r;)r=$p(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(s,r);if(a instanceof Nr){let c=r?r.previousSibling:n.lastChild;Rp(a.contentDOM,a.children,t),r=c?c.nextSibling:n.firstChild}}for(;r;)r=$p(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const ro=function(n){n&&(this.nodeName=n)};ro.prototype=Object.create(null);const Or=[new ro];function ml(n,e,t){if(n.length==0)return Or;let r=t?Or[0]:new ro,i=[r];for(let o=0;o<n.length;o++){let a=n[o].type.attrs;if(a){a.nodeName&&i.push(r=new ro(a.nodeName));for(let s in a){let c=a[s];c!=null&&(t&&i.length==1&&i.push(r=new ro(e.isInline?"span":"div")),s=="class"?r.class=(r.class?r.class+" ":"")+c:s=="style"?r.style=(r.style?r.style+";":"")+c:s!="nodeName"&&(r[s]=c))}}}return i}function Vp(n,e,t,r){if(t==Or&&r==Or)return e;let i=e;for(let o=0;o<r.length;o++){let a=r[o],s=t[o];if(o){let c;s&&s.nodeName==a.nodeName&&i!=n&&(c=i.parentNode)&&c.nodeName.toLowerCase()==a.nodeName||(c=document.createElement(a.nodeName),c.pmIsDeco=!0,c.appendChild(i),s=Or[0]),i=c}Wx(i,s||Or[0],a)}return i}function Wx(n,e,t){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in t)&&n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&n.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&n.classList.add(i[o]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)n.style.removeProperty(i[1])}t.style&&(n.style.cssText+=t.style)}}function Lp(n,e,t){return Vp(n,n,Or,ml(e,t,n.nodeType!=1))}function gl(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function $p(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class qx{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Kx(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let i=0,o=this.stack.length>>1,a=Math.min(o,e.length);for(;i<a&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Ht,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let s=-1;for(let c=this.index;c<Math.min(this.index+3,this.top.children.length);c++){let d=this.top.children[c];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){s=c;break}}if(s>-1)s>this.index&&(this.changed=!0,this.destroyBetween(this.index,s)),this.top=this.top.children[this.index];else{let c=Nr.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,a;if(i>=this.preMatch.index&&(a=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,r))o=this.top.children.indexOf(a,this.index);else for(let s=this.index,c=Math.min(this.top.children.length,s+5);s<c;s++){let d=this.top.children[s];if(d.matchesNode(e,t,r)&&!this.preMatch.matched.has(d)){o=s;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,r,i,o){let a=this.top.children[i];return a.dirty==xn&&a.dom==a.contentDOM&&(a.dirty=Er),a.update(e,t,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,o,a){for(let s=this.index;s<this.top.children.length;s++){let c=this.top.children[s];if(c instanceof er){let d=this.preMatch.matched.get(c);if(d!=null&&d!=o)return!1;let u=c.dom,p,f=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=xn&&gl(t,c.outerDeco));if(!f&&c.update(e,t,r,i))return this.destroyBetween(this.index,s),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!f&&(p=this.recreateWrapper(c,e,t,r,i,a)))return this.top.children[this.index]=p,p.contentDOM&&(p.dirty=Er,p.updateChildren(i,a+1),p.dirty=Ht),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,o,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=er.create(this.top,t,r,i,o,a);if(s.contentDOM){s.children=e.children,e.children=[];for(let c of s.children)c.parent=s}return e.destroy(),s}addNode(e,t,r,i,o){let a=er.create(this.top,e,t,r,i,o);a.contentDOM&&a.updateChildren(i,o+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new Bp(this.top,e,t,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Nr;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ia)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((wt||ft)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Ip(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Kx(n,e){let t=e,r=t.children.length,i=n.childCount,o=new Map,a=[];e:for(;i>0;){let s;for(;;)if(r){let d=t.children[r-1];if(d instanceof Nr)t=d,r=d.children.length;else{s=d,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let c=s.node;if(c){if(c!=n.child(i-1))break;--i,o.set(s,i),a.push(s)}}return{index:i,matched:o,matches:a.reverse()}}function Gx(n,e){return n.type.side-e.type.side}function Jx(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let d=0;d<n.childCount;d++){let u=n.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let a=0,s=[],c=null;for(let d=0;;){let u,p;for(;a<i.length&&i[a].to==o;){let w=i[a++];w.widget&&(u?(p||(p=[u])).push(w):u=w)}if(u)if(p){p.sort(Gx);for(let w=0;w<p.length;w++)t(p[w],d,!!c)}else t(u,d,!!c);let f,h;if(c)h=-1,f=c,c=null;else if(d<n.childCount)h=d,f=n.child(d++);else break;for(let w=0;w<s.length;w++)s[w].to<=o&&s.splice(w--,1);for(;a<i.length&&i[a].from<=o&&i[a].to>o;)s.push(i[a++]);let m=o+f.nodeSize;if(f.isText){let w=m;a<i.length&&i[a].from<w&&(w=i[a].from);for(let x=0;x<s.length;x++)s[x].to<w&&(w=s[x].to);w<m&&(c=f.cut(w-o),f=f.cut(0,w-o),m=w,h=-1)}else for(;a<i.length&&i[a].to<m;)a++;let y=f.isInline&&!f.isLeaf?s.filter(w=>!w.inline):s.slice();r(f,y,e.forChild(o,f),h),o=m}}function Qx(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function Xx(n,e){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0){if(n.childNodes.length>e&&n.childNodes[e].nodeType==3)return n.childNodes[e];n=n.childNodes[e-1],e=wn(n)}else if(n.nodeType==1&&e<n.childNodes.length)n=n.childNodes[e],e=0;else return null}}function Zx(n,e,t,r){for(let i=0,o=0;i<n.childCount&&o<=r;){let a=n.child(i++),s=o;if(o+=a.nodeSize,!a.isText)continue;let c=a.text;for(;i<n.childCount;){let d=n.child(i++);if(o+=d.nodeSize,!d.isText)break;c+=d.text}if(o>=t){if(o>=r&&c.slice(r-e.length-s,r-s)==e)return r-e.length;let d=s<r?c.lastIndexOf(e,r-s-1):-1;if(d>=0&&d+e.length+s>=t)return s+d;if(t==r&&c.length>=r+e.length-s&&c.slice(r-s,r-s+e.length)==e)return r}}return-1}function yl(n,e,t,r,i){let o=[];for(let a=0,s=0;a<n.length;a++){let c=n[a],d=s,u=s+=c.size;d>=t||u<=e?o.push(c):(d<e&&o.push(c.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>t&&o.push(c.slice(t-d,c.size,r)))}return o}function vl(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let s=r.resolve(a),c,d;if(ra(t)){for(c=s;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&pe.isSelectable(u)&&i.parent&&!(u.isInline&&Cx(t.focusNode,t.focusOffset,i.dom))){let p=i.posBefore;d=new pe(a==p?s:r.resolve(p))}}else{let u=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null;c=r.resolve(u)}if(!d){let u=e=="pointer"||n.state.selection.head<s.pos&&!o?1:-1;d=wl(n,c,s,u)}return d}function Fp(n){return n.editable?n.hasFocus():qp(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function On(n,e=!1){let t=n.state.selection;if(jp(n,t),!!Fp(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&ft){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Dr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)t1(n);else{let{anchor:r,head:i}=t,o,a;zp&&!(t instanceof ye)&&(t.$from.parent.inlineContent||(o=Hp(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=Hp(n,t.to))),n.docView.setSelection(r,i,n.root,e),zp&&(o&&Yp(o),a&&Yp(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&e1(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const zp=wt||ft&&Sx<63;function Hp(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(wt&&i&&i.contentEditable=="false")return bl(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return bl(i);if(o)return bl(o)}}function bl(n){return n.contentEditable="true",wt&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Yp(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function e1(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Fp(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function t1(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,bt(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&St&&Xn<=11&&(r.disabled=!0,r.disabled=!1)}function jp(n,e){if(e instanceof pe){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Up(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Up(n)}function Up(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function wl(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||ye.between(e,t,r)}function Wp(n){return n.editable&&!n.hasFocus()?!1:qp(n)}function qp(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function n1(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Dr(e.node,e.offset,t.anchorNode,t.anchorOffset)}function kl(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ve.findFrom(o,e)}function tr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function Kp(n,e,t){let r=n.state.selection;if(r instanceof ye)if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let a=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return tr(n,new ye(r.$anchor,a))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=kl(n.state,e);return i&&i instanceof pe?tr(n,i):!1}else if(!(zt&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!o||o.isText)return!1;let s=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(a=n.docView.descAt(s))&&!a.contentDOM?pe.isSelectable(o)?tr(n,new pe(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):eo?tr(n,new ye(n.state.doc.resolve(e<0?s:s+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof pe&&r.node.isInline)return tr(n,new ye(e>0?r.$to:r.$from));{let i=kl(n.state,e);return i?tr(n,i):!1}}}function oa(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function io(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function pi(n,e){return e<0?r1(n):i1(n)}function r1(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,a=!1;for(nn&&t.nodeType==1&&r<oa(t)&&io(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let s=t.childNodes[r-1];if(io(s,-1))i=t,o=--r;else if(s.nodeType==3)t=s,r=t.nodeValue.length;else break}}else{if(Gp(t))break;{let s=t.previousSibling;for(;s&&io(s,-1);)i=t.parentNode,o=bt(s),s=s.previousSibling;if(s)t=s,r=oa(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?xl(n,t,r):i&&xl(n,i,o)}function i1(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=oa(t),o,a;for(;;)if(r<i){if(t.nodeType!=1)break;let s=t.childNodes[r];if(io(s,1))o=t,a=++r;else break}else{if(Gp(t))break;{let s=t.nextSibling;for(;s&&io(s,1);)o=s.parentNode,a=bt(s)+1,s=s.nextSibling;if(s)t=s,r=0,i=oa(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}o&&xl(n,o,a)}function Gp(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function o1(n,e){for(;n&&e==n.childNodes.length&&!cl(n);)e=bt(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function a1(n,e){for(;n&&!e&&!cl(n);)e=bt(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function xl(n,e,t){if(e.nodeType!=3){let o,a;(a=o1(e,t))?(e=a,t=0):(o=a1(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(ra(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&On(n)},50)}function Jp(n,e){let t=n.state.doc.resolve(e);if(!(ft||Dx)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<t.end()){let o=n.coordsAtPos(e+1),a=(o.top+o.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Qp(n,e,t){let r=n.state.selection;if(r instanceof ye&&!r.empty||t.indexOf("s")>-1||zt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=kl(n.state,e);if(a&&a instanceof pe)return tr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:o,s=r instanceof tn?ve.near(a,e):ve.findFrom(a,e);return s?tr(n,s):!1}return!1}function Xp(n,e){if(!(n.state.selection instanceof ye))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let a=n.state.tr;return e<0?a.delete(t.pos-o.nodeSize,t.pos):a.delete(t.pos,t.pos+o.nodeSize),n.dispatch(a),!0}return!1}function Zp(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function s1(n){if(!wt||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Zp(n,r,"true"),setTimeout(()=>Zp(n,r,"false"),20)}return!1}function l1(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function c1(n,e){let t=e.keyCode,r=l1(e);if(t==8||zt&&t==72&&r=="c")return Xp(n,-1)||pi(n,-1);if(t==46&&!e.shiftKey||zt&&t==68&&r=="c")return Xp(n,1)||pi(n,1);if(t==13||t==27)return!0;if(t==37||zt&&t==66&&r=="c"){let i=t==37?Jp(n,n.state.selection.from)=="ltr"?-1:1:-1;return Kp(n,i,r)||pi(n,i)}else if(t==39||zt&&t==70&&r=="c"){let i=t==39?Jp(n,n.state.selection.from)=="ltr"?1:-1:1;return Kp(n,i,r)||pi(n,i)}else{if(t==38||zt&&t==80&&r=="c")return Qp(n,-1,r)||pi(n,-1);if(t==40||zt&&t==78&&r=="c")return s1(n)||Qp(n,1,r)||pi(n,1);if(r==(zt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function ef(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let a=n.someProp("clipboardSerializer")||yn.fromSchema(n.state.schema),s=cf(),c=s.createElement("div");c.appendChild(a.serializeFragment(r,{document:s}));let d=c.firstChild,u,p=0;for(;d&&d.nodeType==1&&(u=sf[d.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let m=s.createElement(u[h]);for(;c.firstChild;)m.appendChild(c.firstChild);c.appendChild(m),p++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${p?` -${p}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,`
|
|
77
|
+
|
|
78
|
+
`);return{dom:c,text:f}}function tf(n,e,t,r,i){let o=i.parent.type.spec.code,a,s;if(!t&&!e)return null;let c=e&&(r||o||!t);if(c){if(n.someProp("transformPastedText",f=>{e=f(e,o||r,n)}),o)return e?new oe(J.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
79
|
+
`))),0,0):oe.empty;let p=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(p)s=p;else{let f=i.marks(),{schema:h}=n.state,m=yn.fromSchema(h);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let w=a.appendChild(document.createElement("p"));y&&w.appendChild(m.serializeNode(h.text(y,f)))})}}else n.someProp("transformPastedHTML",p=>{t=p(t,n)}),a=p1(t),eo&&f1(a);let d=a&&a.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let p=+u[3];p>0;p--){let f=a.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;a=f}if(s||(s=(n.someProp("clipboardParser")||n.someProp("domParser")||ti.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!d1.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)s=h1(af(s,+u[1],+u[2]),u[4]);else if(s=oe.maxOpen(u1(s.content,i),!0),s.openStart||s.openEnd){let p=0,f=0;for(let h=s.content.firstChild;p<s.openStart&&!h.type.spec.isolating;p++,h=h.firstChild);for(let h=s.content.lastChild;f<s.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);s=af(s,p,f)}return n.someProp("transformPasted",p=>{s=p(s,n)}),s}const d1=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function u1(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,a=[];if(n.forEach(s=>{if(!a)return;let c=i.findWrapping(s.type),d;if(!c)return a=null;if(d=a.length&&o.length&&rf(c,o,s,a[a.length-1],0))a[a.length-1]=d;else{a.length&&(a[a.length-1]=of(a[a.length-1],o.length));let u=nf(s,c);a.push(u),i=i.matchType(u.type),o=c}}),a)return J.from(a)}return n}function nf(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,J.from(n));return n}function rf(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=rf(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(J.from(nf(t,n,i+1))))}}function of(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,of(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(J.empty,!0);return n.copy(t.append(r))}function Cl(n,e,t,r,i,o){let a=e<0?n.firstChild:n.lastChild,s=a.content;return n.childCount>1&&(o=0),i<r-1&&(s=Cl(s,e,t,r,i+1,o)),i>=t&&(s=e<0?a.contentMatchAt(0).fillBefore(s,o<=i).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(J.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(s))}function af(n,e,t){return e<n.openStart&&(n=new oe(Cl(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new oe(Cl(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const sf={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let lf=null;function cf(){return lf||(lf=document.implementation.createHTMLDocument("title"))}function p1(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=cf().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&sf[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"</"+o+">").reverse().join("")),t.innerHTML=n,i)for(let o=0;o<i.length;o++)t=t.querySelector(i[o])||t;return t}function f1(n){let e=n.querySelectorAll(ft?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function h1(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:o,openEnd:a}=n;for(let s=r.length-2;s>=0;s-=2){let c=t.nodes[r[s]];if(!c||c.hasRequiredAttrs())break;i=J.from(c.create(r[s+1],i)),o++,a++}return new oe(i,o,a)}const kt={},xt={},m1={touchstart:!0,touchmove:!0};class g1{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function y1(n){for(let e in kt){let t=kt[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{b1(n,r)&&!Ml(n,r)&&(n.editable||!(r.type in xt))&&t(n,r)},m1[e]?{passive:!0}:void 0)}wt&&n.dom.addEventListener("input",()=>null),Tl(n)}function nr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function v1(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Tl(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Ml(n,r))})}function Ml(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function b1(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function w1(n,e){!Ml(n,e)&&kt[e.type]&&(n.editable||!(e.type in xt))&&kt[e.type](n,e)}xt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!uf(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(rn&&ft&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),di&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Ar(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||c1(n,t)?t.preventDefault():nr(n,"key")},xt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},xt.keypress=(n,e)=>{let t=e;if(uf(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||zt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof ye)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function aa(n){return{left:n.clientX,top:n.clientY}}function k1(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Sl(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let a=o.depth+1;a>0;a--)if(n.someProp(e,s=>a>o.depth?s(n,t,o.nodeAfter,o.before(a),i,!0):s(n,t,o.node(a),o.before(a),i,!1)))return!0;return!1}function fi(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function x1(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&pe.isSelectable(r)?(fi(n,new pe(t),"pointer"),!0):!1}function C1(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof pe&&(r=t.node);let o=n.state.doc.resolve(e);for(let a=o.depth+1;a>0;a--){let s=a>o.depth?o.nodeAfter:o.node(a);if(pe.isSelectable(s)){r&&t.$from.depth>0&&a>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(a);break}}return i!=null?(fi(n,pe.create(n.state.doc,i),"pointer"),!0):!1}function T1(n,e,t,r,i){return Sl(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?C1(n,t):x1(n,t))}function M1(n,e,t,r){return Sl(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function S1(n,e,t,r){return Sl(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||D1(n,t,r)}function D1(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(fi(n,ye.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let a=o>i.depth?i.nodeAfter:i.node(o),s=i.before(o);if(a.inlineContent)fi(n,ye.create(r,s+1,s+1+a.content.size),"pointer");else if(pe.isSelectable(a))fi(n,pe.create(r,s),"pointer");else continue;return!0}}function Dl(n){return sa(n)}const df=zt?"metaKey":"ctrlKey";kt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Dl(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&k1(t,n.input.lastClick)&&!t[df]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let a=n.posAtCoords(aa(t));a&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new A1(n,a,t,!!r)):(o=="doubleClick"?M1:S1)(n,a.pos,a.inside,t)?t.preventDefault():nr(n,"pointer"))};class A1{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[df],this.allowDefault=r.shiftKey;let o,a;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),a=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,a=u.depth?u.before():0}const s=i?null:r.target,c=s?e.docView.nearestDesc(s,!0):null;this.target=c?c.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof pe&&d.from<=a&&d.to>a)&&(this.mightDrag={node:o,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&nn&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),nr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>On(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(aa(e))),this.updateAllowDefault(e),this.allowDefault||!t?nr(this.view,"pointer"):T1(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||wt&&this.mightDrag&&!this.mightDrag.node.isAtom||ft&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(fi(this.view,ve.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):nr(this.view,"pointer")}move(e){this.updateAllowDefault(e),nr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}kt.touchstart=n=>{n.input.lastTouch=Date.now(),Dl(n),nr(n,"pointer")},kt.touchmove=n=>{n.input.lastTouch=Date.now(),nr(n,"pointer")},kt.contextmenu=n=>Dl(n);function uf(n,e){return n.composing?!0:wt&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const E1=rn?5e3:-1;xt.compositionstart=xt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),sa(n,!0),n.markCursor=null;else if(sa(n),nn&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let a=o<0?i.lastChild:i.childNodes[o-1];if(!a)break;if(a.nodeType==3){n.domSelection().collapse(a,a.nodeValue.length);break}else i=a,o=-1}}n.input.composing=!0}pf(n,E1)},xt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,pf(n,20))};function pf(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>sa(n),e))}function ff(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=N1());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function N1(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function sa(n,e=!1){if(!(rn&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),ff(n),e||n.docView&&n.docView.dirty){let t=vl(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function O1(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const oo=St&&Xn<15||di&&Ax<604;kt.copy=xt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=oo?null:t.clipboardData,a=r.content(),{dom:s,text:c}=ef(n,a);o?(t.preventDefault(),o.clearData(),o.setData("text/html",s.innerHTML),o.setData("text/plain",c)):O1(n,s),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function _1(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function B1(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?ao(n,r.value,null,i,e):ao(n,r.textContent,r.innerHTML,i,e)},50)}function ao(n,e,t,r,i){let o=tf(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,o||oe.empty)))return!0;if(!o)return!1;let a=_1(o),s=a?n.state.tr.replaceSelectionWith(a,r):n.state.tr.replaceSelection(o);return n.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function hf(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}xt.paste=(n,e)=>{let t=e;if(n.composing&&!rn)return;let r=oo?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&ao(n,hf(r),r.getData("text/html"),i,t)?t.preventDefault():B1(n,t)};class mf{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const gf=zt?"altKey":"ctrlKey";kt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(aa(t)),a;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof pe?i.to-1:i.to))){if(r&&r.mightDrag)a=pe.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let u=n.docView.nearestDesc(t.target,!0);u&&u.node.type.spec.draggable&&u!=n.docView&&(a=pe.create(n.state.doc,u.posBefore))}}let s=(a||n.state.selection).content(),{dom:c,text:d}=ef(n,s);t.dataTransfer.clearData(),t.dataTransfer.setData(oo?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",oo||t.dataTransfer.setData("text/plain",d),n.dragging=new mf(s,!t[gf],a)},kt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},xt.dragover=xt.dragenter=(n,e)=>e.preventDefault(),xt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(aa(t));if(!i)return;let o=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",m=>{a=m(a,n)}):a=tf(n,hf(t.dataTransfer),oo?null:t.dataTransfer.getData("text/html"),!1,o);let s=!!(r&&!t[gf]);if(n.someProp("handleDrop",m=>m(n,t,a||oe.empty,s))){t.preventDefault();return}if(!a)return;t.preventDefault();let c=a?ip(n.state.doc,o.pos,a):o.pos;c==null&&(c=o.pos);let d=n.state.tr;if(s){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(c),p=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,f=d.doc;if(p?d.replaceRangeWith(u,u,a.content.firstChild):d.replaceRange(u,u,a),d.doc.eq(f))return;let h=d.doc.resolve(u);if(p&&pe.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))d.setSelection(new pe(h));else{let m=d.mapping.map(c);d.mapping.maps[d.mapping.maps.length-1].forEach((y,w,x,C)=>m=C),d.setSelection(wl(n,h,d.doc.resolve(m)))}n.focus(),n.dispatch(d.setMeta("uiEvent","drop"))},kt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&On(n)},20))},kt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},kt.beforeinput=(n,e)=>{if(ft&&rn&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Ar(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in xt)kt[n]=xt[n];function so(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class la{constructor(e,t){this.toDOM=e,this.spec=t||_r,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new Yt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof la&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&so(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class rr{constructor(e,t){this.attrs=e,this.spec=t||_r}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=a?null:new Yt(o,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof rr&&so(this.attrs,e.attrs)&&so(this.spec,e.spec)}static is(e){return e.type instanceof rr}destroy(){}}class Al{constructor(e,t){this.attrs=e,this.spec=t||_r}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=o.pos?null:new Yt(o.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),o;return i==t.from&&!(o=e.child(r)).isText&&i+o.nodeSize==t.to}eq(e){return this==e||e instanceof Al&&so(this.attrs,e.attrs)&&so(this.spec,e.spec)}destroy(){}}class Yt{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Yt(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Yt(e,e,new la(t,r))}static inline(e,t,r,i){return new Yt(e,t,new rr(r,i))}static node(e,t,r,i){return new Yt(e,t,new Al(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof rr}get widget(){return this.type instanceof la}}const hi=[],_r={};class Qe{constructor(e,t){this.local=e.length?e:hi,this.children=t.length?t:hi}static create(e,t){return t.length?ca(t,e,0,_r):ht}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let a=0;a<this.local.length;a++){let s=this.local[a];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&r.push(s.copy(s.from+i,s.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let s=this.children[a]+1;this.children[a+2].findInner(e-s,t-s,r,i+s,o)}}map(e,t,r){return this==ht||e.maps.length==0?this:this.mapInner(e,t,0,0,r||_r)}mapInner(e,t,r,i,o){let a;for(let s=0;s<this.local.length;s++){let c=this.local[s].map(e,r,i);c&&c.type.valid(t,c)?(a||(a=[])).push(c):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?P1(this.children,a||[],e,t,r,i,o):a?new Qe(a.sort(Br),hi):ht}add(e,t){return t.length?this==ht?Qe.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((s,c)=>{let d=c+r,u;if(u=vf(t,s,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<c;)o+=3;i[o]==c?i[o+2]=i[o+2].addInner(s,u,d+1):i.splice(o,0,c,c+s.nodeSize,ca(u,s,d+1,_r)),o+=3}});let a=yf(o?bf(t):t,-r);for(let s=0;s<a.length;s++)a[s].type.valid(e,a[s])||a.splice(s--,1);return new Qe(a.length?this.local.concat(a).sort(Br):this.local,i||this.children)}remove(e){return e.length==0||this==ht?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let a,s=r[o]+t,c=r[o+1]+t;for(let u=0,p;u<e.length;u++)(p=e[u])&&p.from>s&&p.to<c&&(e[u]=null,(a||(a=[])).push(p));if(!a)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(a,s+1);d!=ht?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,a;o<e.length;o++)if(a=e[o])for(let s=0;s<i.length;s++)i[s].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(s--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Qe(i,r):ht}forChild(e,t){if(this==ht)return this;if(t.isLeaf)return Qe.empty;let r,i;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(r=this.children[s+2]);break}let o=e+1,a=o+t.content.size;for(let s=0;s<this.local.length;s++){let c=this.local[s];if(c.from<a&&c.to>o&&c.type instanceof rr){let d=Math.max(o,c.from)-o,u=Math.min(a,c.to)-o;d<u&&(i||(i=[])).push(c.copy(d,u))}}if(i){let s=new Qe(i.sort(Br),hi);return r?new ir([s,r]):s}return r||ht}eq(e){if(this==e)return!0;if(!(e instanceof Qe)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return El(this.localsInner(e))}localsInner(e){if(this==ht)return hi;if(e.inlineContent||!this.local.some(rr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof rr||t.push(this.local[r]);return t}}Qe.empty=new Qe([],[]),Qe.removeOverlap=El;const ht=Qe.empty;class ir{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,_r));return ir.from(r)}forChild(e,t){if(t.isLeaf)return Qe.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ht&&(o instanceof ir?r=r.concat(o.members):r.push(o))}return ir.from(r)}eq(e){if(!(e instanceof ir)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!t)t=o;else{r&&(t=t.slice(),r=!1);for(let a=0;a<o.length;a++)t.push(o[a])}}return t?El(r?t:t.sort(Br)):hi}static from(e){switch(e.length){case 0:return ht;case 1:return e[0];default:return new ir(e.every(t=>t instanceof Qe)?e:e.reduce((t,r)=>t.concat(r instanceof Qe?r:r.members),[]))}}}function P1(n,e,t,r,i,o,a){let s=n.slice();for(let d=0,u=o;d<t.maps.length;d++){let p=0;t.maps[d].forEach((f,h,m,y)=>{let w=y-m-(h-f);for(let x=0;x<s.length;x+=3){let C=s[x+1];if(C<0||f>C+u-p)continue;let N=s[x]+u-p;h>=N?s[x+1]=f<=N?-2:-1:f>=u&&w&&(s[x]+=w,s[x+1]+=w)}p+=w}),u=t.maps[d].map(u,-1)}let c=!1;for(let d=0;d<s.length;d+=3)if(s[d+1]<0){if(s[d+1]==-2){c=!0,s[d+1]=-1;continue}let u=t.map(n[d]+o),p=u-i;if(p<0||p>=r.content.size){c=!0;continue}let f=t.map(n[d+1]+o,-1),h=f-i,{index:m,offset:y}=r.content.findIndex(p),w=r.maybeChild(m);if(w&&y==p&&y+w.nodeSize==h){let x=s[d+2].mapInner(t,w,u+1,n[d]+o+1,a);x!=ht?(s[d]=p,s[d+1]=h,s[d+2]=x):(s[d+1]=-2,c=!0)}else c=!0}if(c){let d=I1(s,n,e,t,i,o,a),u=ca(d,r,0,a);e=u.local;for(let p=0;p<s.length;p+=3)s[p+1]<0&&(s.splice(p,3),p-=3);for(let p=0,f=0;p<u.children.length;p+=3){let h=u.children[p];for(;f<s.length&&s[f]<h;)f+=3;s.splice(f,0,u.children[p],u.children[p+1],u.children[p+2])}}return new Qe(e.sort(Br),s)}function yf(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new Yt(i.from+e,i.to+e,i.type))}return t}function I1(n,e,t,r,i,o,a){function s(c,d){for(let u=0;u<c.local.length;u++){let p=c.local[u].map(r,i,d);p?t.push(p):a.onRemove&&a.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)s(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&s(n[c+2],e[c]+o+1);return t}function vf(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o=0,a;o<n.length;o++)(a=n[o])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[o]=null);return i}function bf(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function ca(n,e,t,r){let i=[],o=!1;e.forEach((s,c)=>{let d=vf(n,s,c+t);if(d){o=!0;let u=ca(d,s,t+c+1,r);u!=ht&&i.push(c,c+s.nodeSize,u)}});let a=yf(o?bf(n):n,-t).sort(Br);for(let s=0;s<a.length;s++)a[s].type.valid(e,a[s])||(r.onRemove&&r.onRemove(a[s].spec),a.splice(s--,1));return a.length||i.length?new Qe(a,i):ht}function Br(n,e){return n.from-e.from||n.to-e.to}function El(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),wf(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),wf(e,i,r.copy(o.from,r.to)));break}}}return e}function wf(n,e,t){for(;e<n.length&&Br(t,n[e])>0;)e++;n.splice(e,0,t)}function Nl(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ht&&e.push(r)}),n.cursorWrapper&&e.push(Qe.create(n.state.doc,[n.cursorWrapper.deco])),ir.from(e)}const R1={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},V1=St&&Xn<=11;class L1{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class $1{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new L1,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);St&&Xn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),V1&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,R1)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Wp(this.view)){if(this.suppressingSelectionUpdates)return On(this.view);if(St&&Xn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Dr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let o=e.focusNode;o;o=Zi(o))t.add(o);for(let o=e.anchorNode;o;o=Zi(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Wp(e)&&!this.ignoreSelectionChange(r),o=-1,a=-1,s=!1,c=[];if(e.editable)for(let u=0;u<t.length;u++){let p=this.registerMutation(t[u],c);p&&(o=o<0?p.from:Math.min(p.from,o),a=a<0?p.to:Math.max(p.to,a),p.typeOver&&(s=!0))}if(nn&&c.length>1){let u=c.filter(p=>p.nodeName=="BR");if(u.length==2){let p=u[0],f=u[1];p.parentNode&&p.parentNode.parentNode==f.parentNode?f.remove():p.remove()}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ra(r)&&(d=vl(e))&&d.eq(ve.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,On(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,a),F1(e)),this.handleDOMChange(o,a,s,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||On(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)t.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(St&&Xn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:p,nextSibling:f}=e.addedNodes[u];(!p||Array.prototype.indexOf.call(e.addedNodes,p)<0)&&(i=p),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(o=f)}let a=i&&i.parentNode==e.target?bt(i)+1:0,s=r.localPosFromDOM(e.target,a,-1),c=o&&o.parentNode==e.target?bt(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,c,1);return{from:s,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let kf=new WeakMap,xf=!1;function F1(n){if(!kf.has(n)&&(kf.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=nn,xf)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),xf=!0}}function z1(n){let e;function t(c){c.preventDefault(),c.stopImmediatePropagation(),e=c.getTargetRanges()[0]}n.dom.addEventListener("beforeinput",t,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",t,!0);let r=e.startContainer,i=e.startOffset,o=e.endContainer,a=e.endOffset,s=n.domAtPos(n.state.selection.anchor);return Dr(s.node,s.offset,o,a)&&([r,i,o,a]=[o,a,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:a}}function H1(n,e,t){let{node:r,fromOffset:i,toOffset:o,from:a,to:s}=n.docView.parseRange(e,t),c=n.domSelectionRange(),d,u=c.anchorNode;if(u&&n.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],ra(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ft&&n.input.lastKeyCode===8)for(let w=o;w>i;w--){let x=r.childNodes[w-1],C=x.pmViewDesc;if(x.nodeName=="BR"&&!C){o=w;break}if(!C||C.size)break}let p=n.state.doc,f=n.someProp("domParser")||ti.fromSchema(n.state.schema),h=p.resolve(a),m=null,y=f.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:Y1,context:h});if(d&&d[0].pos!=null){let w=d[0].pos,x=d[1]&&d[1].pos;x==null&&(x=w),m={anchor:w+a,head:x+a}}return{doc:y,sel:m,from:a,to:s}}function Y1(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(wt&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||wt&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const j1=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function U1(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let P=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,T=vl(n,P);if(T&&!n.state.selection.eq(T)){if(ft&&rn&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",z=>z(n,Ar(13,"Enter"))))return;let _=n.state.tr.setSelection(T);P=="pointer"?_.setMeta("pointer",!0):P=="key"&&_.scrollIntoView(),o&&_.setMeta("composition",o),n.dispatch(_)}return}let a=n.state.doc.resolve(e),s=a.sharedDepth(t);e=a.before(s+1),t=n.state.doc.resolve(t).after(s+1);let c=n.state.selection,d=H1(n,e,t),u=n.state.doc,p=u.slice(d.from,d.to),f,h;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(f=n.state.selection.to,h="end"):(f=n.state.selection.from,h="start"),n.input.lastKeyCode=null;let m=K1(p.content,d.doc.content,d.from,f,h);if((di&&n.input.lastIOSEnter>Date.now()-225||rn)&&i.some(P=>P.nodeType==1&&!j1.test(P.nodeName))&&(!m||m.endA>=m.endB)&&n.someProp("handleKeyDown",P=>P(n,Ar(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof ye&&!c.empty&&c.$head.sameParent(c.$anchor)&&!n.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let P=Cf(n,n.state.doc,d.sel);if(P&&!P.eq(n.state.selection)){let T=n.state.tr.setSelection(P);o&&T.setMeta("composition",o),n.dispatch(T)}}return}if(ft&&n.cursorWrapper&&d.sel&&d.sel.anchor==n.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let P=m.endB-m.start;d.sel={anchor:d.sel.anchor+P,head:d.sel.anchor+P}}n.input.domChangeCount++,n.state.selection.from<n.state.selection.to&&m.start==m.endB&&n.state.selection instanceof ye&&(m.start>n.state.selection.from&&m.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?m.start=n.state.selection.from:m.endA<n.state.selection.to&&m.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(m.endB+=n.state.selection.to-m.endA,m.endA=n.state.selection.to)),St&&Xn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)==" "&&(m.start--,m.endA--,m.endB--);let y=d.doc.resolveNoCache(m.start-d.from),w=d.doc.resolveNoCache(m.endB-d.from),x=u.resolve(m.start),C=y.sameParent(w)&&y.parent.inlineContent&&x.end()>=m.endA,N;if((di&&n.input.lastIOSEnter>Date.now()-225&&(!C||i.some(P=>P.nodeName=="DIV"||P.nodeName=="P"))||!C&&y.pos<d.doc.content.size&&!y.sameParent(w)&&(N=ve.findFrom(d.doc.resolve(y.pos+1),1,!0))&&N.head==w.pos)&&n.someProp("handleKeyDown",P=>P(n,Ar(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>m.start&&q1(u,m.start,m.endA,y,w)&&n.someProp("handleKeyDown",P=>P(n,Ar(8,"Backspace")))){rn&&ft&&n.domObserver.suppressSelectionUpdates();return}ft&&rn&&m.endB==m.start&&(n.input.lastAndroidDelete=Date.now()),rn&&!C&&y.start()!=w.start()&&w.parentOffset==0&&y.depth==w.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,w=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(P){return P(n,Ar(13,"Enter"))})},20));let v=m.start,O=m.endA,k,E,W;if(C){if(y.pos==w.pos)St&&Xn<=11&&y.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>On(n),20)),k=n.state.tr.delete(v,O),E=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(W=W1(y.parent.content.cut(y.parentOffset,w.parentOffset),x.parent.content.cut(x.parentOffset,m.endA-x.start()))))k=n.state.tr,W.type=="add"?k.addMark(v,O,W.mark):k.removeMark(v,O,W.mark);else if(y.parent.child(y.index()).isText&&y.index()==w.index()-(w.textOffset?0:1)){let P=y.parent.textBetween(y.parentOffset,w.parentOffset);if(n.someProp("handleTextInput",T=>T(n,v,O,P)))return;k=n.state.tr.insertText(P,v,O)}}if(k||(k=n.state.tr.replace(v,O,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let P=Cf(n,k.doc,d.sel);P&&!(ft&&rn&&n.composing&&P.empty&&(m.start!=m.endB||n.input.lastAndroidDelete<Date.now()-100)&&(P.head==v||P.head==k.mapping.map(O)-1)||St&&P.empty&&P.head==v)&&k.setSelection(P)}E&&k.ensureMarks(E),o&&k.setMeta("composition",o),n.dispatch(k.scrollIntoView())}function Cf(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:wl(n,e.resolve(t.anchor),e.resolve(t.head))}function W1(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,a,s,c;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<t.length;u++)o=t[u].removeFromSet(o);if(i.length==1&&o.length==0)s=i[0],a="add",c=u=>u.mark(s.addToSet(u.marks));else if(i.length==0&&o.length==1)s=o[0],a="remove",c=u=>u.mark(s.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(J.from(d).eq(n))return{mark:s,type:a}}function q1(n,e,t,r,i){if(!r.parent.isTextblock||t-e<=i.pos-r.pos||Ol(r,!0,!1)<i.pos)return!1;let o=n.resolve(e);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let a=n.resolve(Ol(o,!0,!0));return!a.parent.isTextblock||a.pos>t||Ol(a,!0,!1)<t?!1:r.parent.content.cut(r.parentOffset).eq(a.parent.content)}function Ol(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function K1(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a,b:s}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let c=Math.max(0,o-Math.min(a,s));r-=a+c-o}if(a<o&&n.size<e.size){let c=r<=o&&r>=a?o-r:0;o-=c,o&&o<e.size&&Tf(e.textBetween(o-1,o+1))&&(o+=c?1:-1),s=o+(s-a),a=o}else if(s<o){let c=r<=o&&r>=s?o-r:0;o-=c,o&&o<n.size&&Tf(n.textBetween(o-1,o+1))&&(o+=c?1:-1),a=o+(a-s),s=o}return{start:o,endA:a,endB:s}}function Tf(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class G1{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new g1,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Ef),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Df(this),Sf(this),this.nodeViews=Af(this),this.docView=Pp(this.state.doc,Mf(this),Nl(this),this.dom,this),this.domObserver=new $1(this,(r,i,o,a)=>U1(this,r,i,o,a)),this.domObserver.start(),y1(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Tl(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Ef),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,a=!1;e.storedMarks&&this.composing&&(ff(this),a=!0),this.state=e;let s=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Af(this);Q1(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Tl(this),this.editable=Df(this),Sf(this);let c=Nl(this),d=Mf(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",p=o||!this.docView.matchesNode(e.doc,d,c);(p||!e.selection.eq(i.selection))&&(a=!0);let f=u=="preserve"&&a&&this.dom.style.overflowAnchor==null&&Ox(this);if(a){this.domObserver.stop();let h=p&&(St||ft)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&J1(i.selection,e.selection);if(p){let m=ft?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Pp(e.doc,d,c,this.dom,this)),m&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&n1(this))?On(this,h):(jp(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&_x(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof pe){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&kp(this,t.getBoundingClientRect(),e)}else kp(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let r=this.pluginViews[t];r.update&&r.update(this,e)}}updateDraggedNode(e,t){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new mf(e.slice,e.move,i<0?void 0:pe.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let a=0;a<this.directPlugins.length;a++){let s=this.directPlugins[a].props[e];if(s!=null&&(i=t?t(s):s))return i}let o=this.state.plugins;if(o)for(let a=0;a<o.length;a++){let s=o[a].props[e];if(s!=null&&(i=t?t(s):s))return i}}hasFocus(){if(St){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Bx(this.dom),On(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Lx(this,e)}coordsAtPos(e,t=1){return Dp(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Yx(this,t||this.state,e)}pasteHTML(e,t){return ao(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ao(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(v1(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Nl(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return w1(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return wt&&this.root.nodeType===11&&Tx(this.dom.ownerDocument)==this.dom?z1(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Mf(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Yt.node(0,n.state.doc.content.size,e)]}function Sf(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Yt.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Df(n){return!n.someProp("editable",e=>e(n.state)===!1)}function J1(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Af(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function Q1(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function Ef(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var or={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},da={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},X1=typeof navigator<"u"&&/Mac/.test(navigator.platform),Z1=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ct=0;ct<10;ct++)or[48+ct]=or[96+ct]=String(ct);for(var ct=1;ct<=24;ct++)or[ct+111]="F"+ct;for(var ct=65;ct<=90;ct++)or[ct]=String.fromCharCode(ct+32),da[ct]=String.fromCharCode(ct);for(var _l in or)da.hasOwnProperty(_l)||(da[_l]=or[_l]);function eC(n){var e=X1&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Z1&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?da:or)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const tC=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function nC(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,a;for(let s=0;s<e.length-1;s++){let c=e[s];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))tC?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),o&&(t="Shift-"+t),t}function rC(n){let e=Object.create(null);for(let t in n)e[nC(t)]=n[t];return e}function Bl(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function iC(n){return new Mt({props:{handleKeyDown:Nf(n)}})}function Nf(n){let e=rC(n);return function(t,r){let i=eC(r),o,a=e[Bl(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let s=e[Bl(i,r,!1)];if(s&&s(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=or[r.keyCode])&&o!=i){let s=e[Bl(o,r)];if(s&&s(t.state,t.dispatch,t))return!0}}return!1}}const oC=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function aC(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const sC=(n,e,t)=>{let r=aC(n,t);if(!r)return!1;let i=Of(r);if(!i){let a=r.blockRange(),s=a&&ii(a);return s==null?!1:(e&&e(n.tr.lift(a,s).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Pf(n,i,e))return!0;if(r.parent.content.size==0&&(mi(o,"end")||pe.isSelectable(o))){let a=nl(n.doc,r.before(),r.after(),oe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let s=n.tr.step(a);s.setSelection(mi(o,"end")?ve.findFrom(s.doc.resolve(s.mapping.map(i.pos,-1)),-1):pe.create(s.doc,i.pos-o.nodeSize)),e(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1};function mi(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const lC=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=Of(r)}let a=o&&o.nodeBefore;return!a||!pe.isSelectable(a)?!1:(e&&e(n.tr.setSelection(pe.create(n.doc,o.pos-a.nodeSize)).scrollIntoView()),!0)};function Of(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function cC(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const dC=(n,e,t)=>{let r=cC(n,t);if(!r)return!1;let i=_f(r);if(!i)return!1;let o=i.nodeAfter;if(Pf(n,i,e))return!0;if(r.parent.content.size==0&&(mi(o,"start")||pe.isSelectable(o))){let a=nl(n.doc,r.before(),r.after(),oe.empty);if(a&&a.slice.size<a.to-a.from){if(e){let s=n.tr.step(a);s.setSelection(mi(o,"start")?ve.findFrom(s.doc.resolve(s.mapping.map(i.pos)),1):pe.create(s.doc,s.mapping.map(i.pos))),e(s.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},uC=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=_f(r)}let a=o&&o.nodeAfter;return!a||!pe.isSelectable(a)?!1:(e&&e(n.tr.setSelection(pe.create(n.doc,o.pos)).scrollIntoView()),!0)};function _f(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const pC=(n,e)=>{let t=n.selection,r=t instanceof pe,i;if(r){if(t.node.isTextblock||!Jn(n.doc,t.from))return!1;i=t.from}else if(i=ea(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(pe.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},fC=(n,e)=>{let t=n.selection,r;if(t instanceof pe){if(t.node.isTextblock||!Jn(n.doc,t.to))return!1;r=t.to}else if(r=ea(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},hC=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&ii(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},mC=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
80
|
+
`).scrollIntoView()),!0)};function Bf(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const gC=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),a=Bf(i.contentMatchAt(o));if(!a||!i.canReplaceWith(o,o,a))return!1;if(e){let s=t.after(),c=n.tr.replaceWith(s,s,a.createAndFill());c.setSelection(ve.near(c.doc.resolve(s),1)),e(c.scrollIntoView())}return!0},yC=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof tn||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Bf(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=n.tr.insert(a,o.createAndFill());s.setSelection(ye.create(s.doc,a+1)),e(s.scrollIntoView())}return!0},vC=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(oi(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&ii(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},bC=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(pe.create(n.doc,i))),!0)};function wC(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Jn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Pf(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,a;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(wC(n,e,t))return!0;let s=e.parent.canReplace(e.index(),e.index()+1);if(s&&(o=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(o[0]||i.type).validEnd){if(t){let p=e.pos+i.nodeSize,f=J.empty;for(let y=o.length-1;y>=0;y--)f=J.from(o[y].create(null,f));f=J.from(r.copy(f));let h=n.tr.step(new tt(e.pos-1,p,e.pos,p,new oe(f,1,0),o.length,!0)),m=p+2*o.length;Jn(h.doc,m)&&h.join(m),t(h.scrollIntoView())}return!0}let c=ve.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),u=d&&ii(d);if(u!=null&&u>=e.depth)return t&&t(n.tr.lift(d,u).scrollIntoView()),!0;if(s&&mi(i,"start",!0)&&mi(r,"end")){let p=r,f=[];for(;f.push(p),!p.isTextblock;)p=p.lastChild;let h=i,m=1;for(;!h.isTextblock;h=h.firstChild)m++;if(p.canReplace(p.childCount,p.childCount,h.content)){if(t){let y=J.empty;for(let x=f.length-1;x>=0;x--)y=J.from(f[x].copy(y));let w=n.tr.step(new tt(e.pos-f.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new oe(y,f.length,0),0,!0));t(w.scrollIntoView())}return!0}}return!1}function If(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(ye.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const kC=If(-1),xC=If(1);function CC(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),s=a&&tl(a,n,e);return s?(r&&r(t.tr.wrap(a,s).scrollIntoView()),!0):!1}}function Rf(n,e=null){return function(t,r){let i=!1;for(let o=0;o<t.selection.ranges.length&&!i;o++){let{$from:{pos:a},$to:{pos:s}}=t.selection.ranges[o];t.doc.nodesBetween(a,s,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)i=!0;else{let u=t.doc.resolve(d),p=u.index();i=u.parent.canReplaceWith(p,p+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:s},$to:{pos:c}}=t.selection.ranges[a];o.setBlockType(s,c,n,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function TC(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,a=i.blockRange(o),s=!1,c=a;if(!a)return!1;if(a.depth>=2&&i.node(a.depth-1).type.compatibleContent(n)&&a.startIndex==0){if(i.index(a.depth-1)==0)return!1;let u=t.doc.resolve(a.start-2);c=new qo(u,u,a.depth),a.endIndex<a.parent.childCount&&(a=new qo(i,t.doc.resolve(o.end(a.depth)),a.depth)),s=!0}let d=tl(c,n,e,a);return d?(r&&r(MC(t.tr,a,d,s,n).scrollIntoView()),!0):!1}}function MC(n,e,t,r,i){let o=J.empty;for(let u=t.length-1;u>=0;u--)o=J.from(t[u].type.create(t[u].attrs,o));n.step(new tt(e.start-(r?2:0),e.end,e.start,e.end,new oe(o,0,0),t.length,!0));let a=0;for(let u=0;u<t.length;u++)t[u].type==i&&(a=u+1);let s=t.length-a,c=e.start+t.length-(r?2:0),d=e.parent;for(let u=e.startIndex,p=e.endIndex,f=!0;u<p;u++,f=!1)!f&&oi(n.doc,c,s)&&(n.split(c,s),c+=2*s),c+=d.child(u).nodeSize;return n}function SC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?DC(e,t,n,o):AC(e,t,o):!0:!1}}function DC(n,e,t,r){let i=n.tr,o=r.end,a=r.$to.end(r.depth);o<a&&(i.step(new tt(o-1,a,o,a,new oe(J.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new qo(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const s=ii(r);if(s==null)return!1;i.lift(r,s);let c=i.mapping.map(o,-1)-1;return Jn(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function AC(n,e,t){let r=n.tr,i=t.parent;for(let h=t.end,m=t.endIndex-1,y=t.startIndex;m>y;m--)h-=i.child(m).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(t.start),a=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let s=t.startIndex==0,c=t.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(s?0:1),u+1,a.content.append(c?J.empty:J.from(i))))return!1;let p=o.pos,f=p+a.nodeSize;return r.step(new tt(p-(s?1:0),f+(c?1:0),p+1,f-1,new oe((s?J.empty:J.from(i.copy(J.empty))).append(c?J.empty:J.from(i.copy(J.empty))),s?0:1,c?0:1),s?0:1)),e(r.scrollIntoView()),!0}function EC(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==n);if(!o)return!1;let a=o.startIndex;if(a==0)return!1;let s=o.parent,c=s.child(a-1);if(c.type!=n)return!1;if(t){let d=c.lastChild&&c.lastChild.type==s.type,u=J.from(d?n.create():null),p=new oe(J.from(n.create(null,J.from(s.type.create(null,u)))),d?3:1,0),f=o.start,h=o.end;t(e.tr.step(new tt(f-(d?3:1),h,f,h,p,1,!0)).scrollIntoView())}return!0}}function ua(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class pa{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,a=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([s,c])=>[s,(...u)=>{const p=c(...u)(a);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),p}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s=[],c=!!e,d=e||o.tr,u=()=>(!c&&t&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(d),s.every(f=>f===!0)),p={...Object.fromEntries(Object.entries(r).map(([f,h])=>[f,(...y)=>{const w=this.buildProps(d,t),x=h(...y)(w);return s.push(x),p}])),run:u};return p}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,a=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([c,d])=>[c,(...u)=>d(...u)({...a,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:a}=i,s={tr:e,editor:i,view:a,state:ua({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,d])=>[c,(...u)=>d(...u)(s)]))}};return s}}class NC{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function de(n,e,t){return n.config[e]===void 0&&n.parent?de(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?de(n.parent,e,t):null}):n.config[e]}function fa(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Vf(n){const e=[],{nodeExtensions:t,markExtensions:r}=fa(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},c=de(a,"addGlobalAttributes",s);if(!c)return;c().forEach(u=>{u.types.forEach(p=>{Object.entries(u.attributes).forEach(([f,h])=>{e.push({type:p,name:f,attribute:{...o,...h}})})})})}),i.forEach(a=>{const s={name:a.name,options:a.options,storage:a.storage},c=de(a,"addAttributes",s);if(!c)return;const d=c();Object.entries(d).forEach(([u,p])=>{const f={...o,...p};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:a.name,name:u,attribute:f})})}),e}function nt(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Ge(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const s=o?o.split(" "):[],c=r[i]?r[i].split(" "):[],d=s.filter(u=>!c.includes(u));r[i]=[...c,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Pl(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Ge(t,r),{})}function Lf(n){return typeof n=="function"}function be(n,e=void 0,...t){return Lf(n)?e?n.bind(e)(...t):n(...t):n}function OC(n={}){return Object.keys(n).length===0&&n.constructor===Object}function _C(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function $f(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,a)=>{const s=a.attribute.parseHTML?a.attribute.parseHTML(t):_C(t.getAttribute(a.name));return s==null?o:{...o,[a.name]:s}},{});return{...r,...i}}}}function Ff(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&OC(t)?!1:t!=null))}function BC(n,e){var t;const r=Vf(n),{nodeExtensions:i,markExtensions:o}=fa(n),a=(t=i.find(d=>de(d,"topNode")))===null||t===void 0?void 0:t.name,s=Object.fromEntries(i.map(d=>{const u=r.filter(x=>x.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},f=n.reduce((x,C)=>{const N=de(C,"extendNodeSchema",p);return{...x,...N?N(d):{}}},{}),h=Ff({...f,content:be(de(d,"content",p)),marks:be(de(d,"marks",p)),group:be(de(d,"group",p)),inline:be(de(d,"inline",p)),atom:be(de(d,"atom",p)),selectable:be(de(d,"selectable",p)),draggable:be(de(d,"draggable",p)),code:be(de(d,"code",p)),defining:be(de(d,"defining",p)),isolating:be(de(d,"isolating",p)),attrs:Object.fromEntries(u.map(x=>{var C;return[x.name,{default:(C=x==null?void 0:x.attribute)===null||C===void 0?void 0:C.default}]}))}),m=be(de(d,"parseHTML",p));m&&(h.parseDOM=m.map(x=>$f(x,u)));const y=de(d,"renderHTML",p);y&&(h.toDOM=x=>y({node:x,HTMLAttributes:Pl(x,u)}));const w=de(d,"renderText",p);return w&&(h.toText=w),[d.name,h]})),c=Object.fromEntries(o.map(d=>{const u=r.filter(w=>w.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:e},f=n.reduce((w,x)=>{const C=de(x,"extendMarkSchema",p);return{...w,...C?C(d):{}}},{}),h=Ff({...f,inclusive:be(de(d,"inclusive",p)),excludes:be(de(d,"excludes",p)),group:be(de(d,"group",p)),spanning:be(de(d,"spanning",p)),code:be(de(d,"code",p)),attrs:Object.fromEntries(u.map(w=>{var x;return[w.name,{default:(x=w==null?void 0:w.attribute)===null||x===void 0?void 0:x.default}]}))}),m=be(de(d,"parseHTML",p));m&&(h.parseDOM=m.map(w=>$f(w,u)));const y=de(d,"renderHTML",p);return y&&(h.toDOM=w=>y({mark:w,HTMLAttributes:Pl(w,u)})),[d.name,h]}));return new Hk({topNode:a,nodes:s,marks:c})}function Il(n,e){return e.nodes[n]||e.marks[n]||null}function zf(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const PC=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,a,s)=>{var c,d;const u=((d=(c=i.type.spec).toText)===null||d===void 0?void 0:d.call(c,{node:i,pos:o,parent:a,index:s}))||i.textContent||"%leaf%";t+=u.slice(0,Math.max(0,r-o))}),t};function Rl(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class ha{constructor(e){this.find=e.find,this.handler=e.handler}}const IC=(n,e)=>{if(Rl(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Vl(n){var e;const{editor:t,from:r,to:i,text:o,rules:a,plugin:s}=n,{view:c}=t;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const p=PC(d)+o;return a.forEach(f=>{if(u)return;const h=IC(p,f.find);if(!h)return;const m=c.state.tr,y=ua({state:c.state,transaction:m}),w={from:r-(h[0].length-o.length),to:i},{commands:x,chain:C,can:N}=new pa({editor:t,state:y});f.handler({state:y,range:w,match:h,commands:x,chain:C,can:N})===null||!m.steps.length||(m.setMeta(s,{transform:m,from:r,to:i,text:o}),c.dispatch(m),u=!0)}),u}function RC(n){const{editor:e,rules:t}=n,r=new Mt({state:{init(){return null},apply(i,o){const a=i.getMeta(r);return a||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,a,s){return Vl({editor:e,from:o,to:a,text:s,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Vl({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?Vl({editor:e,from:a.pos,to:a.pos,text:`
|
|
81
|
+
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function VC(n){return typeof n=="number"}class LC{constructor(e){this.find=e.find,this.handler=e.handler}}const $C=(n,e,t)=>{if(Rl(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=n,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function FC(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:a,dropEvent:s}=n,{commands:c,chain:d,can:u}=new pa({editor:e,state:t}),p=[];return t.doc.nodesBetween(r,i,(h,m)=>{if(!h.isTextblock||h.type.spec.code)return;const y=Math.max(r,m),w=Math.min(i,m+h.content.size),x=h.textBetween(y-m,w-m,void 0,"");$C(x,o.find,a).forEach(N=>{if(N.index===void 0)return;const v=y+N.index+1,O=v+N[0].length,k={from:t.tr.mapping.map(v),to:t.tr.mapping.map(O)},E=o.handler({state:t,range:k,match:N,commands:c,chain:d,can:u,pasteEvent:a,dropEvent:s});p.push(E)})}),p.every(h=>h!==null)}function zC(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,a=new ClipboardEvent("paste"),s=new DragEvent("drop");return t.map(d=>new Mt({view(u){const p=f=>{var h;r=!((h=u.dom.parentElement)===null||h===void 0)&&h.contains(f.target)?u.dom.parentElement:null};return window.addEventListener("dragstart",p),{destroy(){window.removeEventListener("dragstart",p)}}},props:{handleDOMEvents:{drop:(u,p)=>(o=r===u.dom.parentElement,s=p,!1),paste:(u,p)=>{var f;const h=(f=p.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return a=p,i=!!(h!=null&&h.includes("data-pm-slice")),!1}}},appendTransaction:(u,p,f)=>{const h=u[0],m=h.getMeta("uiEvent")==="paste"&&!i,y=h.getMeta("uiEvent")==="drop"&&!o;if(!m&&!y)return;const w=p.doc.content.findDiffStart(f.doc.content),x=p.doc.content.findDiffEnd(f.doc.content);if(!VC(w)||!x||w===x.b)return;const C=f.tr,N=ua({state:f,transaction:C});if(!(!FC({editor:e,state:N,from:Math.max(w-1,0),to:x.b-1,rule:d,pasteEvent:a,dropEvent:s})||!C.steps.length))return s=new DragEvent("drop"),a=new ClipboardEvent("paste"),C}}))}function HC(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class gi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=gi.resolve(e),this.schema=BC(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:Il(r.name,this.schema)};r.type==="mark"&&(!((i=be(de(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const a=de(r,"onBeforeCreate",o);a&&this.editor.on("beforeCreate",a);const s=de(r,"onCreate",o);s&&this.editor.on("create",s);const c=de(r,"onUpdate",o);c&&this.editor.on("update",c);const d=de(r,"onSelectionUpdate",o);d&&this.editor.on("selectionUpdate",d);const u=de(r,"onTransaction",o);u&&this.editor.on("transaction",u);const p=de(r,"onFocus",o);p&&this.editor.on("focus",p);const f=de(r,"onBlur",o);f&&this.editor.on("blur",f);const h=de(r,"onDestroy",o);h&&this.editor.on("destroy",h)})}static resolve(e){const t=gi.sort(gi.flatten(e)),r=HC(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=de(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=de(r,"priority")||100,a=de(i,"priority")||100;return o>a?-1:o<a?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Il(t.name,this.schema)},i=de(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=gi.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(a=>{const s={name:a.name,options:a.options,storage:a.storage,editor:e,type:Il(a.name,this.schema)},c=[],d=de(a,"addKeyboardShortcuts",s);let u={};if(a.type==="mark"&&a.config.exitable&&(u.ArrowRight=()=>on.handleExit({editor:e,mark:a})),d){const y=Object.fromEntries(Object.entries(d()).map(([w,x])=>[w,()=>x({editor:e})]));u={...u,...y}}const p=iC(u);c.push(p);const f=de(a,"addInputRules",s);zf(a,e.options.enableInputRules)&&f&&r.push(...f());const h=de(a,"addPasteRules",s);zf(a,e.options.enablePasteRules)&&h&&i.push(...h());const m=de(a,"addProseMirrorPlugins",s);if(m){const y=m();c.push(...y)}return c}).flat();return[RC({editor:e,rules:r}),...zC({editor:e,rules:i}),...o]}get attributes(){return Vf(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=fa(this.extensions);return Object.fromEntries(t.filter(r=>!!de(r,"addNodeView")).map(r=>{const i=this.attributes.filter(c=>c.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:nt(r.name,this.schema)},a=de(r,"addNodeView",o);if(!a)return[];const s=(c,d,u,p)=>{const f=Pl(c,i);return a()({editor:e,node:c,getPos:u,decorations:p,HTMLAttributes:f,extension:r})};return[r.name,s]}))}}function YC(n){return Object.prototype.toString.call(n).slice(8,-1)}function Ll(n){return YC(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function ma(n,e){const t={...n};return Ll(n)&&Ll(e)&&Object.keys(e).forEach(r=>{Ll(e[r])?r in n?t[r]=ma(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class mt{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=be(de(this,"addOptions",{name:this.name}))),this.storage=be(de(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new mt(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=be(de(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new mt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=be(de(t,"addOptions",{name:t.name})),t.storage=be(de(t,"addStorage",{name:t.name,options:t.options})),t}}function Hf(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
82
|
+
|
|
83
|
+
`,textSerializers:a={}}=t||{};let s="",c=!0;return n.nodesBetween(r,i,(d,u,p,f)=>{var h;const m=a==null?void 0:a[d.type.name];m?(d.isBlock&&!c&&(s+=o,c=!0),p&&(s+=m({node:d,pos:u,parent:p,index:f,range:e}))):d.isText?(s+=(h=d==null?void 0:d.text)===null||h===void 0?void 0:h.slice(Math.max(r,u)-u,i-u),c=!1):d.isBlock&&!c&&(s+=o,c=!0)}),s}function Yf(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}const jC=mt.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new Mt({key:new bn("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,a=Math.min(...o.map(u=>u.$from.pos)),s=Math.max(...o.map(u=>u.$to.pos)),c=Yf(t);return Hf(r,{from:a,to:s},{textSerializers:c})}}})]}}),UC=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window==null?void 0:window.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),WC=(n=!1)=>({commands:e})=>e.setContent("",n),qC=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:a})=>{n.doc.nodesBetween(o.pos,a.pos,(s,c)=>{if(s.type.isText)return;const{doc:d,mapping:u}=e,p=d.resolve(u.map(c)),f=d.resolve(u.map(c+s.nodeSize)),h=p.blockRange(f);if(!h)return;const m=ii(h);if(s.type.isTextblock){const{defaultType:y}=p.parent.contentMatchAt(p.index());e.setNodeMarkup(h.start,y)}(m||m===0)&&e.lift(h,m)})}),!0},KC=n=>e=>n(e),GC=()=>({state:n,dispatch:e})=>yC(n,e),JC=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,o.content),r.setSelection(new ye(r.doc.resolve(a-1))),!0},QC=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const s=i.before(o),c=i.after(o);n.delete(s,c).scrollIntoView()}return!0}return!1},XC=n=>({tr:e,state:t,dispatch:r})=>{const i=nt(n,t.schema),o=e.selection.$anchor;for(let a=o.depth;a>0;a-=1)if(o.node(a).type===i){if(r){const c=o.before(a),d=o.after(a);e.delete(c,d).scrollIntoView()}return!0}return!1},ZC=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},eT=()=>({state:n,dispatch:e})=>oC(n,e),tT=()=>({commands:n})=>n.keyboardShortcut("Enter"),nT=()=>({state:n,dispatch:e})=>gC(n,e);function ga(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Rl(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function $l(n,e,t={}){return n.find(r=>r.type===e&&ga(r.attrs,t))}function rT(n,e,t={}){return!!$l(n,e,t)}function Fl(n,e,t={}){if(!n||!e)return;let r=n.parent.childAfter(n.parentOffset);if(n.parentOffset===r.offset&&r.offset!==0&&(r=n.parent.childBefore(n.parentOffset)),!r.node)return;const i=$l([...r.node.marks],e,t);if(!i)return;let o=r.index,a=n.start()+r.offset,s=o+1,c=a+r.node.nodeSize;for($l([...r.node.marks],e,t);o>0&&i.isInSet(n.parent.child(o-1).marks);)o-=1,a-=n.parent.child(o).nodeSize;for(;s<n.parent.childCount&&rT([...n.parent.child(s).marks],e,t);)c+=n.parent.child(s).nodeSize,s+=1;return{from:a,to:c}}function ar(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const iT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const o=ar(n,r.schema),{doc:a,selection:s}=t,{$from:c,from:d,to:u}=s;if(i){const p=Fl(c,o,e);if(p&&p.from<=d&&p.to>=u){const f=ye.create(a,p.from,p.to);t.setSelection(f)}}return!0},oT=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function zl(n){return n instanceof ye}function _n(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function jf(n,e=null){if(!e)return null;const t=ve.atStart(n),r=ve.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,o=r.to;return e==="all"?ye.create(n,_n(0,i,o),_n(n.content.size,i,o)):ye.create(n,_n(e,i,o),_n(e,i,o))}function Hl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const aT=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const a=()=>{Hl()&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!zl(t.state.selection))return a(),!0;const s=jf(i.doc,n)||t.state.selection,c=t.state.selection.eq(s);return o&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},sT=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),lT=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),Yl=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&!/\S/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&Yl(r)}return n};function Uf(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return Yl(t),Yl(t)}function ya(n,e,t){if(t={slice:!0,parseOptions:{},...t},typeof n=="object"&&n!==null)try{return Array.isArray(n)&&n.length>0?J.fromArray(n.map(r=>e.nodeFromJSON(r))):e.nodeFromJSON(n)}catch(r){return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",r),ya("",e,t)}if(typeof n=="string"){const r=ti.fromSchema(e);return t.slice?r.parseSlice(Uf(n),t.parseOptions).content:r.parse(Uf(n),t.parseOptions)}return ya("",e,t)}function cT(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof lt||i instanceof tt))return;const o=n.mapping.maps[r];let a=0;o.forEach((s,c,d,u)=>{a===0&&(a=u)}),n.setSelection(ve.near(n.doc.resolve(a),t))}const dT=n=>n.toString().startsWith("<"),uT=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{if(i){t={parseOptions:{},updateSelection:!0,...t};const a=ya(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions}});if(a.toString()==="<>")return!0;let{from:s,to:c}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},d=!0,u=!0;if((dT(a)?a:[a]).forEach(f=>{f.check(),d=d?f.isText&&f.marks.length===0:!1,u=u?f.isBlock:!1}),s===c&&u){const{parent:f}=r.doc.resolve(s);f.isTextblock&&!f.type.spec.code&&!f.childCount&&(s-=1,c+=1)}d?Array.isArray(e)?r.insertText(e.map(f=>f.text||"").join(""),s,c):typeof e=="object"&&e&&e.text?r.insertText(e.text,s,c):r.insertText(e,s,c):r.replaceWith(s,c,a),t.updateSelection&&cT(r,r.steps.length-1,-1)}return!0},pT=()=>({state:n,dispatch:e})=>pC(n,e),fT=()=>({state:n,dispatch:e})=>fC(n,e),hT=()=>({state:n,dispatch:e})=>sC(n,e),mT=()=>({state:n,dispatch:e})=>dC(n,e),gT=()=>({tr:n,state:e,dispatch:t})=>{try{const r=ea(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},yT=()=>({state:n,dispatch:e,tr:t})=>{try{const r=ea(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}};function jl(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function vT(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,a;for(let s=0;s<e.length-1;s+=1){const c=e[s];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))Hl()||jl()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),o&&(t=`Shift-${t}`),t}const bT=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const o=vT(n).split(/-(?!$)/),a=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),s=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",d=>d(t,s))});return c==null||c.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function lo(n,e,t={}){const{from:r,to:i,empty:o}=n.selection,a=e?nt(e,n.schema):null,s=[];n.doc.nodesBetween(r,i,(p,f)=>{if(p.isText)return;const h=Math.max(r,f),m=Math.min(i,f+p.nodeSize);s.push({node:p,from:h,to:m})});const c=i-r,d=s.filter(p=>a?a.name===p.node.type.name:!0).filter(p=>ga(p.node.attrs,t,{strict:!1}));return o?!!d.length:d.reduce((p,f)=>p+f.to-f.from,0)>=c}const wT=(n,e={})=>({state:t,dispatch:r})=>{const i=nt(n,t.schema);return lo(t,i,e)?hC(t,r):!1},kT=()=>({state:n,dispatch:e})=>vC(n,e),xT=n=>({state:e,dispatch:t})=>{const r=nt(n,e.schema);return SC(r)(e,t)},CT=()=>({state:n,dispatch:e})=>mC(n,e);function va(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function Wf(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const TT=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const s=va(typeof n=="string"?n:n.name,r.schema);return s?(s==="node"&&(o=nt(n,r.schema)),s==="mark"&&(a=ar(n,r.schema)),i&&t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,u)=>{o&&o===d.type&&t.setNodeMarkup(u,void 0,Wf(d.attrs,e)),a&&d.marks.length&&d.marks.forEach(p=>{a===p.type&&t.addMark(u,u+d.nodeSize,a.create(Wf(p.attrs,e)))})})}),!0):!1},MT=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),ST=()=>({tr:n,commands:e})=>e.setTextSelection({from:0,to:n.doc.content.size}),DT=()=>({state:n,dispatch:e})=>lC(n,e),AT=()=>({state:n,dispatch:e})=>uC(n,e),ET=()=>({state:n,dispatch:e})=>bC(n,e),NT=()=>({state:n,dispatch:e})=>xC(n,e),OT=()=>({state:n,dispatch:e})=>kC(n,e);function qf(n,e,t={}){return ya(n,e,{slice:!1,parseOptions:t})}const _T=(n,e=!1,t={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:a}=r,s=qf(n,i.schema,t);return o&&r.replaceWith(0,a.content.size,s).setMeta("preventUpdate",!e),!0};function ba(n,e){const t=ar(e,n.schema),{from:r,to:i,empty:o}=n.selection,a=[];o?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,c=>{a.push(...c.marks)});const s=a.find(c=>c.type.name===t.name);return s?{...s.attrs}:{}}function BT(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function PT(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Ul(n){return e=>PT(e.$from,n)}function IT(n,e){const t=yn.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function RT(n,e){const t={from:0,to:n.content.size};return Hf(n,t,e)}function VT(n,e){const t=nt(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,s=>{o.push(s)});const a=o.reverse().find(s=>s.type.name===t.name);return a?{...a.attrs}:{}}function LT(n,e){const t=va(typeof e=="string"?e:e.name,n.schema);return t==="node"?VT(n,e):t==="mark"?ba(n,e):{}}function Kf(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const o=t.resolve(n-1),a=Fl(o,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,o)=>{!i||i.nodeSize===void 0||r.push(...i.marks.map(a=>({from:o,to:o+i.nodeSize,mark:a})))}),r}function wa(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Wl(n,e,t={}){const{empty:r,ranges:i}=n.selection,o=e?ar(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>o?o.name===p.type.name:!0).find(p=>ga(p.attrs,t,{strict:!1}));let a=0;const s=[];if(i.forEach(({$from:p,$to:f})=>{const h=p.pos,m=f.pos;n.doc.nodesBetween(h,m,(y,w)=>{if(!y.isText&&!y.marks.length)return;const x=Math.max(h,w),C=Math.min(m,w+y.nodeSize),N=C-x;a+=N,s.push(...y.marks.map(v=>({mark:v,from:x,to:C})))})}),a===0)return!1;const c=s.filter(p=>o?o.name===p.mark.type.name:!0).filter(p=>ga(p.mark.attrs,t,{strict:!1})).reduce((p,f)=>p+f.to-f.from,0),d=s.filter(p=>o?p.mark.type!==o&&p.mark.type.excludes(o):!0).reduce((p,f)=>p+f.to-f.from,0);return(c>0?c+d:c)>=a}function $T(n,e,t={}){if(!e)return lo(n,null,t)||Wl(n,null,t);const r=va(e,n.schema);return r==="node"?lo(n,e,t):r==="mark"?Wl(n,e,t):!1}function Gf(n,e){const{nodeExtensions:t}=fa(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=be(de(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function FT(n){var e;const t=(e=n.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=n.toJSON();return JSON.stringify(t)===JSON.stringify(r)}function zT(n){return n instanceof pe}function Jf(n,e,t){const i=n.state.doc.content.size,o=_n(e,0,i),a=_n(t,0,i),s=n.coordsAtPos(o),c=n.coordsAtPos(a,-1),d=Math.min(s.top,c.top),u=Math.max(s.bottom,c.bottom),p=Math.min(s.left,c.left),f=Math.max(s.right,c.right),h=f-p,m=u-d,x={top:d,bottom:u,left:p,right:f,width:h,height:m,x:p,y:d};return{...x,toJSON:()=>x}}function HT(n,e,t){var r;const{selection:i}=e;let o=null;if(zl(i)&&(o=i.$cursor),o){const s=(r=n.storedMarks)!==null&&r!==void 0?r:o.marks();return!!t.isInSet(s)||!s.some(c=>c.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:s,$to:c})=>{let d=s.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(s.pos,c.pos,(u,p,f)=>{if(d)return!1;if(u.isInline){const h=!f||f.type.allowsMarkType(t),m=!!t.isInSet(u.marks)||!u.marks.some(y=>y.type.excludes(t));d=h&&m}return!d}),d})}const YT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:o}=t,{empty:a,ranges:s}=o,c=ar(n,r.schema);if(i)if(a){const d=ba(r,c);t.addStoredMark(c.create({...d,...e}))}else s.forEach(d=>{const u=d.$from.pos,p=d.$to.pos;r.doc.nodesBetween(u,p,(f,h)=>{const m=Math.max(h,u),y=Math.min(h+f.nodeSize,p);f.marks.find(x=>x.type===c)?f.marks.forEach(x=>{c===x.type&&t.addMark(m,y,c.create({...x.attrs,...e}))}):t.addMark(m,y,c.create(e))})});return HT(r,t,c)},jT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),UT=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const o=nt(n,t.schema);return o.isTextblock?i().command(({commands:a})=>Rf(o,e)(t)?!0:a.clearNodes()).command(({state:a})=>Rf(o,e)(a,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},WT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=_n(n,0,r.content.size),o=pe.create(r,i);e.setSelection(o)}return!0},qT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,a=ye.atStart(r).from,s=ye.atEnd(r).to,c=_n(i,a,s),d=_n(o,a,s),u=ye.create(r,c,d);e.setSelection(u)}return!0},KT=n=>({state:e,dispatch:t})=>{const r=nt(n,e.schema);return EC(r)(e,t)};function Qf(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e==null?void 0:e.includes(i.type.name));n.tr.ensureMarks(r)}}const GT=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:o,doc:a}=e,{$from:s,$to:c}=o,d=i.extensionManager.attributes,u=wa(d,s.node().type.name,s.node().attrs);if(o instanceof pe&&o.node.isBlock)return!s.parentOffset||!oi(a,s.pos)?!1:(r&&(n&&Qf(t,i.extensionManager.splittableMarks),e.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;if(r){const p=c.parentOffset===c.parent.content.size;o instanceof ye&&e.deleteSelection();const f=s.depth===0?void 0:BT(s.node(-1).contentMatchAt(s.indexAfter(-1)));let h=p&&f?[{type:f,attrs:u}]:void 0,m=oi(e.doc,e.mapping.map(s.pos),1,h);if(!h&&!m&&oi(e.doc,e.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,h=f?[{type:f,attrs:u}]:void 0),m&&(e.split(e.mapping.map(s.pos),1,h),f&&!p&&!s.parentOffset&&s.parent.type!==f)){const y=e.mapping.map(s.before()),w=e.doc.resolve(y);s.node(-1).canReplaceWith(w.index(),w.index()+1,f)&&e.setNodeMarkup(e.mapping.map(s.before()),f)}n&&Qf(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},JT=n=>({tr:e,state:t,dispatch:r,editor:i})=>{var o;const a=nt(n,t.schema),{$from:s,$to:c}=t.selection,d=t.selection.node;if(d&&d.isBlock||s.depth<2||!s.sameParent(c))return!1;const u=s.node(-1);if(u.type!==a)return!1;const p=i.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==a||s.index(-2)!==s.node(-2).childCount-1)return!1;if(r){let w=J.empty;const x=s.index(-1)?1:s.index(-2)?2:3;for(let E=s.depth-x;E>=s.depth-3;E-=1)w=J.from(s.node(E).copy(w));const C=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,N=wa(p,s.node().type.name,s.node().attrs),v=((o=a.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(N))||void 0;w=w.append(J.from(a.createAndFill(null,v)||void 0));const O=s.before(s.depth-(x-1));e.replace(O,s.after(-C),new oe(w,4-x,0));let k=-1;e.doc.nodesBetween(O,e.doc.content.size,(E,W)=>{if(k>-1)return!1;E.isTextblock&&E.content.size===0&&(k=W+1)}),k>-1&&e.setSelection(ye.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,h=wa(p,u.type.name,u.attrs),m=wa(p,s.node().type.name,s.node().attrs);e.delete(s.pos,c.pos);const y=f?[{type:a,attrs:h},{type:f,attrs:m}]:[{type:a,attrs:h}];if(!oi(e.doc,s.pos,2))return!1;if(r){const{selection:w,storedMarks:x}=t,{splittableMarks:C}=i.extensionManager,N=x||w.$to.parentOffset&&w.$from.marks();if(e.split(s.pos,2,y).scrollIntoView(),!N||!r)return!0;const v=N.filter(O=>C.includes(O.type.name));e.ensureMarks(v)}return!0},ql=(n,e)=>{const t=Ul(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Jn(n.doc,t.pos)&&n.join(t.pos),!0},Kl=(n,e)=>{const t=Ul(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===(i==null?void 0:i.type)&&Jn(n.doc,r)&&n.join(r),!0};var QT=Object.freeze({__proto__:null,blur:UC,clearContent:WC,clearNodes:qC,command:KC,createParagraphNear:GC,cut:JC,deleteCurrentNode:QC,deleteNode:XC,deleteRange:ZC,deleteSelection:eT,enter:tT,exitCode:nT,extendMarkRange:iT,first:oT,focus:aT,forEach:sT,insertContent:lT,insertContentAt:uT,joinUp:pT,joinDown:fT,joinBackward:hT,joinForward:mT,joinItemBackward:gT,joinItemForward:yT,keyboardShortcut:bT,lift:wT,liftEmptyBlock:kT,liftListItem:xT,newlineInCode:CT,resetAttributes:TT,scrollIntoView:MT,selectAll:ST,selectNodeBackward:DT,selectNodeForward:AT,selectParentNode:ET,selectTextblockEnd:NT,selectTextblockStart:OT,setContent:_T,setMark:YT,setMeta:jT,setNode:UT,setNodeSelection:WT,setTextSelection:qT,sinkListItem:KT,splitBlock:GT,splitListItem:JT,toggleList:(n,e,t,r={})=>({editor:i,tr:o,state:a,dispatch:s,chain:c,commands:d,can:u})=>{const{extensions:p,splittableMarks:f}=i.extensionManager,h=nt(n,a.schema),m=nt(e,a.schema),{selection:y,storedMarks:w}=a,{$from:x,$to:C}=y,N=x.blockRange(C),v=w||y.$to.parentOffset&&y.$from.marks();if(!N)return!1;const O=Ul(k=>Gf(k.type.name,p))(y);if(N.depth>=1&&O&&N.depth-O.depth<=1){if(O.node.type===h)return d.liftListItem(m);if(Gf(O.node.type.name,p)&&h.validContent(O.node.content)&&s)return c().command(()=>(o.setNodeMarkup(O.pos,h),!0)).command(()=>ql(o,h)).command(()=>Kl(o,h)).run()}return!t||!v||!s?c().command(()=>u().wrapInList(h,r)?!0:d.clearNodes()).wrapInList(h,r).command(()=>ql(o,h)).command(()=>Kl(o,h)).run():c().command(()=>{const k=u().wrapInList(h,r),E=v.filter(W=>f.includes(W.type.name));return o.ensureMarks(E),k?!0:d.clearNodes()}).wrapInList(h,r).command(()=>ql(o,h)).command(()=>Kl(o,h)).run()},toggleMark:(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=t,a=ar(n,r.schema);return Wl(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:o}):i.setMark(a,e)},toggleNode:(n,e,t={})=>({state:r,commands:i})=>{const o=nt(n,r.schema),a=nt(e,r.schema);return lo(r,o,t)?i.setNode(a):i.setNode(o,t)},toggleWrap:(n,e={})=>({state:t,commands:r})=>{const i=nt(n,t.schema);return lo(t,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let o;if(i.spec.isInputRules&&(o=i.getState(n))){if(e){const a=n.tr,s=o.transform;for(let c=s.steps.length-1;c>=0;c-=1)a.step(s.steps[c].invert(s.docs[c]));if(o.text){const c=a.doc.resolve(o.from).marks();a.replaceWith(o.from,o.to,n.schema.text(o.text,c))}else a.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:a=!1}=e,{selection:s}=t,c=ar(n,r.schema),{$from:d,empty:u,ranges:p}=s;if(!i)return!0;if(u&&a){let{from:f,to:h}=s;const m=(o=d.marks().find(w=>w.type===c))===null||o===void 0?void 0:o.attrs,y=Fl(d,c,m);y&&(f=y.from,h=y.to),t.removeMark(f,h,c)}else p.forEach(f=>{t.removeMark(f.$from.pos,f.$to.pos,c)});return t.removeStoredMark(c),!0},updateAttributes:(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,a=null;const s=va(typeof n=="string"?n:n.name,r.schema);return s?(s==="node"&&(o=nt(n,r.schema)),s==="mark"&&(a=ar(n,r.schema)),i&&t.selection.ranges.forEach(c=>{const d=c.$from.pos,u=c.$to.pos;r.doc.nodesBetween(d,u,(p,f)=>{o&&o===p.type&&t.setNodeMarkup(f,void 0,{...p.attrs,...e}),a&&p.marks.length&&p.marks.forEach(h=>{if(a===h.type){const m=Math.max(f,d),y=Math.min(f+p.nodeSize,u);t.addMark(m,y,a.create({...h.attrs,...e}))}})})}),!0):!1},wrapIn:(n,e={})=>({state:t,dispatch:r})=>{const i=nt(n,t.schema);return CC(i,e)(t,r)},wrapInList:(n,e={})=>({state:t,dispatch:r})=>{const i=nt(n,t.schema);return TC(i,e)(t,r)}});const XT=mt.create({name:"commands",addCommands(){return{...QT}}}),ZT=mt.create({name:"editable",addProseMirrorPlugins(){return[new Mt({key:new bn("editable"),props:{editable:()=>this.editor.options.editable}})]}}),eM=mt.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new Mt({key:new bn("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),tM=mt.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:s})=>{const{selection:c,doc:d}=s,{empty:u,$anchor:p}=c,{pos:f,parent:h}=p,m=p.parent.isTextblock?s.doc.resolve(f-1):p,y=m.parent.type.spec.isolating,w=p.pos-p.parentOffset,x=y&&m.parent.childCount===1?w===p.pos:ve.atStart(d).from===f;return!u||!x||!h.type.isTextblock||h.textContent.length?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Hl()||jl()?o:i},addProseMirrorPlugins(){return[new Mt({key:new bn("clearDocument"),appendTransaction:(n,e,t)=>{if(!(n.some(m=>m.docChanged)&&!e.doc.eq(t.doc)))return;const{empty:i,from:o,to:a}=e.selection,s=ve.atStart(e.doc).from,c=ve.atEnd(e.doc).to;if(i||!(o===s&&a===c)||!(t.doc.textBetween(0,t.doc.content.size," "," ").length===0))return;const p=t.tr,f=ua({state:t,transaction:p}),{commands:h}=new pa({editor:this.editor,state:f});if(h.clearNodes(),!!p.steps.length)return p}})]}}),nM=mt.create({name:"tabindex",addProseMirrorPlugins(){return[new Mt({key:new bn("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var rM=Object.freeze({__proto__:null,ClipboardTextSerializer:jC,Commands:XT,Editable:ZT,FocusEvents:eM,Keymap:tM,Tabindex:nM});const iM=`.ProseMirror {
|
|
84
84
|
position: relative;
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -154,30 +154,30 @@ img.ProseMirror-separator {
|
|
|
154
154
|
|
|
155
155
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
156
156
|
opacity: 0
|
|
157
|
-
}`;function
|
|
157
|
+
}`;function oM(n,e,t){const r=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}let aM=class extends NC{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=oM(iM,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const r=Lf(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const t=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(t))});this.view.updateState(r)}createExtensionManager(){const t=[...this.options.enableCoreExtensions?Object.values(rM):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r==null?void 0:r.type));this.extensionManager=new gi(t,this)}createCommandManager(){this.commandManager=new pa({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=qf(this.options.content,this.schema,this.options.parseOptions),t=jf(e,this.options.autofocus);this.view=new G1(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:ci.create({doc:e,selection:t||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(a=>{var s;return(s=this.capturedTransaction)===null||s===void 0?void 0:s.step(a)});return}const t=this.state.apply(e),r=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return LT(this.state,e)}isActive(e,t){const r=typeof e=="string"?e:null,i=typeof e=="string"?t:e;return $T(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return IT(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
|
|
158
158
|
|
|
159
|
-
`,textSerializers:r={}}=e||{};return HM(this.state.doc,{blockSeparator:t,textSerializers:{...Yp(this.schema),...r}})}get isEmpty(){return WM(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}};function _r(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=ve(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,a=r[r.length-1],s=r[0];if(a){const c=s.search(/\S/),d=t.from+s.indexOf(a),u=d+a.length;if(Kp(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(v=>v===n.type&&v!==h.mark.type)).filter(h=>h.to>d).length)return null;u<t.to&&o.delete(u,t.to),d>t.from&&o.delete(t.from+c,d);const p=t.from+c+a.length;o.addMark(t.from+c,p,n.type.create(i||{})),o.removeStoredMark(n.type)}}})}function pS(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=ve(n.getAttributes,void 0,r)||{},{tr:o}=e,a=t.from;let s=t.to;const c=n.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=a+d;u>s?u=s:s=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,a+r[0].length-1),o.replaceWith(u,s,c)}else r[0]&&o.insert(a-1,n.type.create(i)).delete(o.mapping.map(a),o.mapping.map(s));o.scrollIntoView()}})}function Wl(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=ve(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function co(n){return new ha({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=ve(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),c=a.doc.resolve(t.from).blockRange(),d=c&&Zs(c,n.type,o);if(!d)return null;if(a.wrap(c,d),n.keepMarks&&n.editor){const{selection:f,storedMarks:p}=e,{splittableMarks:h}=n.editor.extensionManager,m=p||f.$to.parentOffset&&f.$from.marks();if(m){const v=m.filter(w=>h.includes(w.type.name));a.ensureMarks(v)}}if(n.keepAttributes){const f=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=a.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&Gn(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&a.join(t.from-1)}})}class nn{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(ce(this,"addOptions",{name:this.name}))),this.storage=ve(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new nn(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=ve(ce(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new nn(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ve(ce(t,"addOptions",{name:t.name})),t.storage=ve(ce(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(d=>(d==null?void 0:d.type.name)===t.name))return!1;const c=a.find(d=>(d==null?void 0:d.type.name)===t.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let _t=class yc{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ve(ce(this,"addOptions",{name:this.name}))),this.storage=ve(ce(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new yc(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=ve(ce(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new yc(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=ve(ce(t,"addOptions",{name:t.name})),t.storage=ve(ce(t,"addStorage",{name:t.name,options:t.options})),t}};function Br(n){return new jC({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=ve(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=e,s=r[r.length-1],c=r[0];let d=t.to;if(s){const u=c.search(/\S/),f=t.from+c.indexOf(s),p=f+s.length;if(Kp(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(w=>w===n.type&&w!==m.mark.type)).filter(m=>m.to>f).length)return null;p<t.to&&a.delete(p,t.to),f>t.from&&a.delete(t.from+u,f),d=t.from+u+s.length,a.addMark(t.from+u,d,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}var Tt="top",Ft="bottom",zt="right",Dt="left",ql="auto",uo=[Tt,Ft,zt,Dt],hi="start",fo="end",hS="clippingParents",Xp="viewport",po="popper",mS="reference",Zp=uo.reduce(function(n,e){return n.concat([e+"-"+hi,e+"-"+fo])},[]),eh=[].concat(uo,[ql]).reduce(function(n,e){return n.concat([e,e+"-"+hi,e+"-"+fo])},[]),gS="beforeRead",yS="read",vS="afterRead",bS="beforeMain",wS="main",kS="afterMain",xS="beforeWrite",CS="write",MS="afterWrite",SS=[gS,yS,vS,bS,wS,kS,xS,CS,MS];function xn(n){return n?(n.nodeName||"").toLowerCase():null}function Bt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Pr(n){var e=Bt(n).Element;return n instanceof e||n instanceof Element}function Ht(n){var e=Bt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Kl(n){if(typeof ShadowRoot>"u")return!1;var e=Bt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function TS(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];!Ht(o)||!xn(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function DS(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),s=a.reduce(function(c,d){return c[d]="",c},{});!Ht(i)||!xn(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const th={name:"applyStyles",enabled:!0,phase:"write",fn:TS,effect:DS,requires:["computeStyles"]};function Cn(n){return n.split("-")[0]}var Ir=Math.max,ka=Math.min,mi=Math.round;function Gl(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function nh(){return!/^((?!chrome|android).)*safari/i.test(Gl())}function gi(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&Ht(n)&&(i=n.offsetWidth>0&&mi(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&mi(r.height)/n.offsetHeight||1);var a=Pr(n)?Bt(n):window,s=a.visualViewport,c=!nh()&&t,d=(r.left+(c&&s?s.offsetLeft:0))/i,u=(r.top+(c&&s?s.offsetTop:0))/o,f=r.width/i,p=r.height/o;return{width:f,height:p,top:u,right:d+f,bottom:u+p,left:d,x:d,y:u}}function Ql(n){var e=gi(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function rh(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Kl(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function _n(n){return Bt(n).getComputedStyle(n)}function AS(n){return["table","td","th"].indexOf(xn(n))>=0}function ar(n){return((Pr(n)?n.ownerDocument:n.document)||window.document).documentElement}function xa(n){return xn(n)==="html"?n:n.assignedSlot||n.parentNode||(Kl(n)?n.host:null)||ar(n)}function ih(n){return!Ht(n)||_n(n).position==="fixed"?null:n.offsetParent}function OS(n){var e=/firefox/i.test(Gl()),t=/Trident/i.test(Gl());if(t&&Ht(n)){var r=_n(n);if(r.position==="fixed")return null}var i=xa(n);for(Kl(i)&&(i=i.host);Ht(i)&&["html","body"].indexOf(xn(i))<0;){var o=_n(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ho(n){for(var e=Bt(n),t=ih(n);t&&AS(t)&&_n(t).position==="static";)t=ih(t);return t&&(xn(t)==="html"||xn(t)==="body"&&_n(t).position==="static")?e:t||OS(n)||e}function Jl(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function mo(n,e,t){return Ir(n,ka(e,t))}function ES(n,e,t){var r=mo(n,e,t);return r>t?t:r}function oh(){return{top:0,right:0,bottom:0,left:0}}function ah(n){return Object.assign({},oh(),n)}function sh(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var NS=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,ah(typeof e!="number"?e:sh(e,uo))};function _S(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,a=t.modifiersData.popperOffsets,s=Cn(t.placement),c=Jl(s),d=[Dt,zt].indexOf(s)>=0,u=d?"height":"width";if(!(!o||!a)){var f=NS(i.padding,t),p=Ql(o),h=c==="y"?Tt:Dt,m=c==="y"?Ft:zt,v=t.rects.reference[u]+t.rects.reference[c]-a[c]-t.rects.popper[u],w=a[c]-t.rects.reference[c],x=ho(o),C=x?c==="y"?x.clientHeight||0:x.clientWidth||0:0,N=v/2-w/2,y=f[h],_=C-p[u]-f[m],k=C/2-p[u]/2+N,E=mo(y,k,_),j=c;t.modifiersData[r]=(e={},e[j]=E,e.centerOffset=E-k,e)}}function BS(n){var e=n.state,t=n.options,r=t.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||rh(e.elements.popper,i)&&(e.elements.arrow=i))}const PS={name:"arrow",enabled:!0,phase:"main",fn:_S,effect:BS,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function yi(n){return n.split("-")[1]}var IS={top:"auto",right:"auto",bottom:"auto",left:"auto"};function RS(n,e){var t=n.x,r=n.y,i=e.devicePixelRatio||1;return{x:mi(t*i)/i||0,y:mi(r*i)/i||0}}function lh(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,a=n.offsets,s=n.position,c=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,f=n.isFixed,p=a.x,h=p===void 0?0:p,m=a.y,v=m===void 0?0:m,w=typeof u=="function"?u({x:h,y:v}):{x:h,y:v};h=w.x,v=w.y;var x=a.hasOwnProperty("x"),C=a.hasOwnProperty("y"),N=Dt,y=Tt,_=window;if(d){var k=ho(t),E="clientHeight",j="clientWidth";if(k===Bt(t)&&(k=ar(t),_n(k).position!=="static"&&s==="absolute"&&(E="scrollHeight",j="scrollWidth")),k=k,i===Tt||(i===Dt||i===zt)&&o===fo){y=Ft;var I=f&&k===_&&_.visualViewport?_.visualViewport.height:k[E];v-=I-r.height,v*=c?1:-1}if(i===Dt||(i===Tt||i===Ft)&&o===fo){N=zt;var M=f&&k===_&&_.visualViewport?_.visualViewport.width:k[j];h-=M-r.width,h*=c?1:-1}}var B=Object.assign({position:s},d&&IS),H=u===!0?RS({x:h,y:v},Bt(t)):{x:h,y:v};if(h=H.x,v=H.y,c){var W;return Object.assign({},B,(W={},W[y]=C?"0":"",W[N]=x?"0":"",W.transform=(_.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",W))}return Object.assign({},B,(e={},e[y]=C?v+"px":"",e[N]=x?h+"px":"",e.transform="",e))}function VS(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0?!0:r,o=t.adaptive,a=o===void 0?!0:o,s=t.roundOffsets,c=s===void 0?!0:s,d={placement:Cn(e.placement),variation:yi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,lh(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,lh(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const $S={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:VS,data:{}};var Ca={passive:!0};function LS(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,c=Bt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",t.update,Ca)}),s&&c.addEventListener("resize",t.update,Ca),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",t.update,Ca)}),s&&c.removeEventListener("resize",t.update,Ca)}}const FS={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:LS,data:{}};var zS={left:"right",right:"left",bottom:"top",top:"bottom"};function Ma(n){return n.replace(/left|right|bottom|top/g,function(e){return zS[e]})}var HS={start:"end",end:"start"};function ch(n){return n.replace(/start|end/g,function(e){return HS[e]})}function Xl(n){var e=Bt(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Zl(n){return gi(ar(n)).left+Xl(n).scrollLeft}function YS(n,e){var t=Bt(n),r=ar(n),i=t.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,c=0;if(i){o=i.width,a=i.height;var d=nh();(d||!d&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:s+Zl(n),y:c}}function jS(n){var e,t=ar(n),r=Xl(n),i=(e=n.ownerDocument)==null?void 0:e.body,o=Ir(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Ir(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+Zl(n),c=-r.scrollTop;return _n(i||t).direction==="rtl"&&(s+=Ir(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}function ec(n){var e=_n(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function dh(n){return["html","body","#document"].indexOf(xn(n))>=0?n.ownerDocument.body:Ht(n)&&ec(n)?n:dh(xa(n))}function go(n,e){var t;e===void 0&&(e=[]);var r=dh(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=Bt(r),a=i?[o].concat(o.visualViewport||[],ec(r)?r:[]):r,s=e.concat(a);return i?s:s.concat(go(xa(a)))}function tc(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function US(n,e){var t=gi(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function uh(n,e,t){return e===Xp?tc(YS(n,t)):Pr(e)?US(e,t):tc(jS(ar(n)))}function WS(n){var e=go(xa(n)),t=["absolute","fixed"].indexOf(_n(n).position)>=0,r=t&&Ht(n)?ho(n):n;return Pr(r)?e.filter(function(i){return Pr(i)&&rh(i,r)&&xn(i)!=="body"}):[]}function qS(n,e,t,r){var i=e==="clippingParents"?WS(n):[].concat(e),o=[].concat(i,[t]),a=o[0],s=o.reduce(function(c,d){var u=uh(n,d,r);return c.top=Ir(u.top,c.top),c.right=ka(u.right,c.right),c.bottom=ka(u.bottom,c.bottom),c.left=Ir(u.left,c.left),c},uh(n,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function fh(n){var e=n.reference,t=n.element,r=n.placement,i=r?Cn(r):null,o=r?yi(r):null,a=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,c;switch(i){case Tt:c={x:a,y:e.y-t.height};break;case Ft:c={x:a,y:e.y+e.height};break;case zt:c={x:e.x+e.width,y:s};break;case Dt:c={x:e.x-t.width,y:s};break;default:c={x:e.x,y:e.y}}var d=i?Jl(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case hi:c[d]=c[d]-(e[u]/2-t[u]/2);break;case fo:c[d]=c[d]+(e[u]/2-t[u]/2);break}}return c}function yo(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,a=o===void 0?n.strategy:o,s=t.boundary,c=s===void 0?hS:s,d=t.rootBoundary,u=d===void 0?Xp:d,f=t.elementContext,p=f===void 0?po:f,h=t.altBoundary,m=h===void 0?!1:h,v=t.padding,w=v===void 0?0:v,x=ah(typeof w!="number"?w:sh(w,uo)),C=p===po?mS:po,N=n.rects.popper,y=n.elements[m?C:p],_=qS(Pr(y)?y:y.contextElement||ar(n.elements.popper),c,u,a),k=gi(n.elements.reference),E=fh({reference:k,element:N,strategy:"absolute",placement:i}),j=tc(Object.assign({},N,E)),I=p===po?j:k,M={top:_.top-I.top+x.top,bottom:I.bottom-_.bottom+x.bottom,left:_.left-I.left+x.left,right:I.right-_.right+x.right},B=n.modifiersData.offset;if(p===po&&B){var H=B[i];Object.keys(M).forEach(function(W){var L=[zt,Ft].indexOf(W)>=0?1:-1,T=[Tt,Ft].indexOf(W)>=0?"y":"x";M[W]+=H[T]*L})}return M}function KS(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,a=t.padding,s=t.flipVariations,c=t.allowedAutoPlacements,d=c===void 0?eh:c,u=yi(r),f=u?s?Zp:Zp.filter(function(m){return yi(m)===u}):uo,p=f.filter(function(m){return d.indexOf(m)>=0});p.length===0&&(p=f);var h=p.reduce(function(m,v){return m[v]=yo(n,{placement:v,boundary:i,rootBoundary:o,padding:a})[Cn(v)],m},{});return Object.keys(h).sort(function(m,v){return h[m]-h[v]})}function GS(n){if(Cn(n)===ql)return[];var e=Ma(n);return[ch(n),e,ch(e)]}function QS(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0?!0:i,a=t.altAxis,s=a===void 0?!0:a,c=t.fallbackPlacements,d=t.padding,u=t.boundary,f=t.rootBoundary,p=t.altBoundary,h=t.flipVariations,m=h===void 0?!0:h,v=t.allowedAutoPlacements,w=e.options.placement,x=Cn(w),C=x===w,N=c||(C||!m?[Ma(w)]:GS(w)),y=[w].concat(N).reduce(function(z,P){return z.concat(Cn(P)===ql?KS(e,{placement:P,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:v}):P)},[]),_=e.rects.reference,k=e.rects.popper,E=new Map,j=!0,I=y[0],M=0;M<y.length;M++){var B=y[M],H=Cn(B),W=yi(B)===hi,L=[Tt,Ft].indexOf(H)>=0,T=L?"width":"height",R=yo(e,{placement:B,boundary:u,rootBoundary:f,altBoundary:p,padding:d}),$=L?W?zt:Dt:W?Ft:Tt;_[T]>k[T]&&($=Ma($));var Y=Ma($),b=[];if(o&&b.push(R[H]<=0),s&&b.push(R[$]<=0,R[Y]<=0),b.every(function(z){return z})){I=B,j=!1;break}E.set(B,b)}if(j)for(var g=m?3:1,S=function(P){var D=y.find(function(ee){var ne=E.get(ee);if(ne)return ne.slice(0,P).every(function(q){return q})});if(D)return I=D,"break"},O=g;O>0;O--){var F=S(O);if(F==="break")break}e.placement!==I&&(e.modifiersData[r]._skip=!0,e.placement=I,e.reset=!0)}}const JS={name:"flip",enabled:!0,phase:"main",fn:QS,requiresIfExists:["offset"],data:{_skip:!1}};function ph(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function hh(n){return[Tt,zt,Ft,Dt].some(function(e){return n[e]>=0})}function XS(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=yo(e,{elementContext:"reference"}),s=yo(e,{altBoundary:!0}),c=ph(a,r),d=ph(s,i,o),u=hh(c),f=hh(d);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const ZS={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:XS};function eT(n,e,t){var r=Cn(n),i=[Dt,Tt].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[Dt,zt].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function tT(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,a=eh.reduce(function(u,f){return u[f]=eT(f,e.rects,o),u},{}),s=a[e.placement],c=s.x,d=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=a}const nT={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tT};function rT(n){var e=n.state,t=n.name;e.modifiersData[t]=fh({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const iT={name:"popperOffsets",enabled:!0,phase:"read",fn:rT,data:{}};function oT(n){return n==="x"?"y":"x"}function aT(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0?!0:i,a=t.altAxis,s=a===void 0?!1:a,c=t.boundary,d=t.rootBoundary,u=t.altBoundary,f=t.padding,p=t.tether,h=p===void 0?!0:p,m=t.tetherOffset,v=m===void 0?0:m,w=yo(e,{boundary:c,rootBoundary:d,padding:f,altBoundary:u}),x=Cn(e.placement),C=yi(e.placement),N=!C,y=Jl(x),_=oT(y),k=e.modifiersData.popperOffsets,E=e.rects.reference,j=e.rects.popper,I=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,M=typeof I=="number"?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),B=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,H={x:0,y:0};if(k){if(o){var W,L=y==="y"?Tt:Dt,T=y==="y"?Ft:zt,R=y==="y"?"height":"width",$=k[y],Y=$+w[L],b=$-w[T],g=h?-j[R]/2:0,S=C===hi?E[R]:j[R],O=C===hi?-j[R]:-E[R],F=e.elements.arrow,z=h&&F?Ql(F):{width:0,height:0},P=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:oh(),D=P[L],ee=P[T],ne=mo(0,E[R],z[R]),q=N?E[R]/2-g-ne-D-M.mainAxis:S-ne-D-M.mainAxis,le=N?-E[R]/2+g+ne+ee+M.mainAxis:O+ne+ee+M.mainAxis,oe=e.elements.arrow&&ho(e.elements.arrow),U=oe?y==="y"?oe.clientTop||0:oe.clientLeft||0:0,Z=(W=B==null?void 0:B[y])!=null?W:0,he=$+q-Z-U,te=$+le-Z,Ae=mo(h?ka(Y,he):Y,$,h?Ir(b,te):b);k[y]=Ae,H[y]=Ae-$}if(s){var Qe,Yt=y==="x"?Tt:Dt,on=y==="x"?Ft:zt,At=k[_],jt=_==="y"?"height":"width",an=At+w[Yt],Je=At-w[on],Pn=[Tt,Dt].indexOf(x)!==-1,cr=(Qe=B==null?void 0:B[_])!=null?Qe:0,In=Pn?an:At-E[jt]-j[jt]-cr+M.altAxis,dr=Pn?At+E[jt]+j[jt]-cr-M.altAxis:Je,V=h&&Pn?ES(In,At,dr):mo(h?In:an,At,h?dr:Je);k[_]=V,H[_]=V-At}e.modifiersData[r]=H}}const sT={name:"preventOverflow",enabled:!0,phase:"main",fn:aT,requiresIfExists:["offset"]};function lT(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function cT(n){return n===Bt(n)||!Ht(n)?Xl(n):lT(n)}function dT(n){var e=n.getBoundingClientRect(),t=mi(e.width)/n.offsetWidth||1,r=mi(e.height)/n.offsetHeight||1;return t!==1||r!==1}function uT(n,e,t){t===void 0&&(t=!1);var r=Ht(e),i=Ht(e)&&dT(e),o=ar(e),a=gi(n,i,t),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((xn(e)!=="body"||ec(o))&&(s=cT(e)),Ht(e)?(c=gi(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=Zl(o))),{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function fT(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function i(o){t.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!t.has(s)){var c=e.get(s);c&&i(c)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||i(o)}),r}function pT(n){var e=fT(n);return SS.reduce(function(t,r){return t.concat(e.filter(function(i){return i.phase===r}))},[])}function hT(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function mT(n){var e=n.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var mh={placement:"bottom",modifiers:[],strategy:"absolute"};function gh(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function gT(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,r=t===void 0?[]:t,i=e.defaultOptions,o=i===void 0?mh:i;return function(s,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},mh,o),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},f=[],p=!1,h={state:u,setOptions:function(x){var C=typeof x=="function"?x(u.options):x;v(),u.options=Object.assign({},o,u.options,C),u.scrollParents={reference:Pr(s)?go(s):s.contextElement?go(s.contextElement):[],popper:go(c)};var N=pT(mT([].concat(r,u.options.modifiers)));return u.orderedModifiers=N.filter(function(y){return y.enabled}),m(),h.update()},forceUpdate:function(){if(!p){var x=u.elements,C=x.reference,N=x.popper;if(gh(C,N)){u.rects={reference:uT(C,ho(N),u.options.strategy==="fixed"),popper:Ql(N)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(M){return u.modifiersData[M.name]=Object.assign({},M.data)});for(var y=0;y<u.orderedModifiers.length;y++){if(u.reset===!0){u.reset=!1,y=-1;continue}var _=u.orderedModifiers[y],k=_.fn,E=_.options,j=E===void 0?{}:E,I=_.name;typeof k=="function"&&(u=k({state:u,options:j,name:I,instance:h})||u)}}}},update:hT(function(){return new Promise(function(w){h.forceUpdate(),w(u)})}),destroy:function(){v(),p=!0}};if(!gh(s,c))return h;h.setOptions(d).then(function(w){!p&&d.onFirstUpdate&&d.onFirstUpdate(w)});function m(){u.orderedModifiers.forEach(function(w){var x=w.name,C=w.options,N=C===void 0?{}:C,y=w.effect;if(typeof y=="function"){var _=y({state:u,name:x,instance:h,options:N}),k=function(){};f.push(_||k)}})}function v(){f.forEach(function(w){return w()}),f=[]}return h}}var yT=[FS,iT,$S,th,nT,JS,sT,PS,ZS],vT=gT({defaultModifiers:yT}),bT="tippy-box",yh="tippy-content",wT="tippy-backdrop",vh="tippy-arrow",bh="tippy-svg-arrow",Rr={passive:!0,capture:!0},wh=function(){return document.body};function kT(n,e){return{}.hasOwnProperty.call(n,e)}function nc(n,e,t){if(Array.isArray(n)){var r=n[e];return r??(Array.isArray(t)?t[e]:t)}return n}function rc(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function kh(n,e){return typeof n=="function"?n.apply(void 0,e):n}function xh(n,e){if(e===0)return n;var t;return function(r){clearTimeout(t),t=setTimeout(function(){n(r)},e)}}function xT(n,e){var t=Object.assign({},n);return e.forEach(function(r){delete t[r]}),t}function CT(n){return n.split(/\s+/).filter(Boolean)}function vi(n){return[].concat(n)}function Ch(n,e){n.indexOf(e)===-1&&n.push(e)}function MT(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function ST(n){return n.split("-")[0]}function Sa(n){return[].slice.call(n)}function Mh(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function vo(){return document.createElement("div")}function bo(n){return["Element","Fragment"].some(function(e){return rc(n,e)})}function TT(n){return rc(n,"NodeList")}function DT(n){return rc(n,"MouseEvent")}function AT(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function OT(n){return bo(n)?[n]:TT(n)?Sa(n):Array.isArray(n)?n:Sa(document.querySelectorAll(n))}function ic(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Sh(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function ET(n){var e,t=vi(n),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function NT(n,e){var t=e.clientX,r=e.clientY;return n.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,c=s.interactiveBorder,d=ST(a.placement),u=a.modifiersData.offset;if(!u)return!0;var f=d==="bottom"?u.top.y:0,p=d==="top"?u.bottom.y:0,h=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,v=o.top-r+f>c,w=r-o.bottom-p>c,x=o.left-t+h>c,C=t-o.right-m>c;return v||w||x||C})}function oc(n,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){n[r](i,t)})}function Th(n,e){for(var t=e;t;){var r;if(n.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var Mn={isTouch:!1},Dh=0;function _T(){Mn.isTouch||(Mn.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ah))}function Ah(){var n=performance.now();n-Dh<20&&(Mn.isTouch=!1,document.removeEventListener("mousemove",Ah)),Dh=n}function BT(){var n=document.activeElement;if(AT(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function PT(){document.addEventListener("touchstart",_T,Rr),window.addEventListener("blur",BT)}var IT=typeof window<"u"&&typeof document<"u",RT=IT?!!window.msCrypto:!1;function bi(n){var e=n==="destroy"?"n already-":" ";return[n+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Oh(n){var e=/[ \t]{2,}/g,t=/^[ \t]*/gm;return n.replace(e," ").replace(t,"").trim()}function VT(n){return Oh(`
|
|
159
|
+
`,textSerializers:r={}}=e||{};return RT(this.state.doc,{blockSeparator:t,textSerializers:{...Yf(this.schema),...r}})}get isEmpty(){return FT(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}};function Pr(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=be(n.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,a=r[r.length-1],s=r[0];if(a){const c=s.search(/\S/),d=t.from+s.indexOf(a),u=d+a.length;if(Kf(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(y=>y===n.type&&y!==h.mark.type)).filter(h=>h.to>d).length)return null;u<t.to&&o.delete(u,t.to),d>t.from&&o.delete(t.from+c,d);const f=t.from+c+a.length;o.addMark(t.from+c,f,n.type.create(i||{})),o.removeStoredMark(n.type)}}})}function sM(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=be(n.getAttributes,void 0,r)||{},{tr:o}=e,a=t.from;let s=t.to;const c=n.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=a+d;u>s?u=s:s=u+r[1].length;const p=r[0][r[0].length-1];o.insertText(p,a+r[0].length-1),o.replaceWith(u,s,c)}else r[0]&&o.insert(a-1,n.type.create(i)).delete(o.mapping.map(a),o.mapping.map(s));o.scrollIntoView()}})}function Gl(n){return new ha({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),o=be(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function co(n){return new ha({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const o=be(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),c=a.doc.resolve(t.from).blockRange(),d=c&&tl(c,n.type,o);if(!d)return null;if(a.wrap(c,d),n.keepMarks&&n.editor){const{selection:p,storedMarks:f}=e,{splittableMarks:h}=n.editor.extensionManager,m=f||p.$to.parentOffset&&p.$from.marks();if(m){const y=m.filter(w=>h.includes(w.type.name));a.ensureMarks(y)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,o).run()}const u=a.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&Jn(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&a.join(t.from-1)}})}class on{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=be(de(this,"addOptions",{name:this.name}))),this.storage=be(de(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new on(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=be(de(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new on(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=be(de(t,"addOptions",{name:t.name})),t.storage=be(de(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(d=>(d==null?void 0:d.type.name)===t.name))return!1;const c=a.find(d=>(d==null?void 0:d.type.name)===t.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let _t=class wc{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=be(de(this,"addOptions",{name:this.name}))),this.storage=be(de(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new wc(e)}configure(e={}){const t=this.extend();return t.options=ma(this.options,e),t.storage=be(de(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new wc(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=be(de(t,"addOptions",{name:t.name})),t.storage=be(de(t,"addStorage",{name:t.name,options:t.options})),t}};function Ir(n){return new LC({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const o=be(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:a}=e,s=r[r.length-1],c=r[0];let d=t.to;if(s){const u=c.search(/\S/),p=t.from+c.indexOf(s),f=p+s.length;if(Kf(t.from,t.to,e.doc).filter(m=>m.mark.type.excluded.find(w=>w===n.type&&w!==m.mark.type)).filter(m=>m.to>p).length)return null;f<t.to&&a.delete(f,t.to),p>t.from&&a.delete(t.from+u,p),d=t.from+u+s.length,a.addMark(t.from+u,d,n.type.create(o||{})),a.removeStoredMark(n.type)}}})}var Dt="top",jt="bottom",Ut="right",At="left",Jl="auto",uo=[Dt,jt,Ut,At],yi="start",po="end",lM="clippingParents",Xf="viewport",fo="popper",cM="reference",Zf=uo.reduce(function(n,e){return n.concat([e+"-"+yi,e+"-"+po])},[]),eh=[].concat(uo,[Jl]).reduce(function(n,e){return n.concat([e,e+"-"+yi,e+"-"+po])},[]),dM="beforeRead",uM="read",pM="afterRead",fM="beforeMain",hM="main",mM="afterMain",gM="beforeWrite",yM="write",vM="afterWrite",bM=[dM,uM,pM,fM,hM,mM,gM,yM,vM];function Cn(n){return n?(n.nodeName||"").toLowerCase():null}function Bt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Rr(n){var e=Bt(n).Element;return n instanceof e||n instanceof Element}function Wt(n){var e=Bt(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Ql(n){if(typeof ShadowRoot>"u")return!1;var e=Bt(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function wM(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];!Wt(o)||!Cn(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function kM(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),s=a.reduce(function(c,d){return c[d]="",c},{});!Wt(i)||!Cn(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(c){i.removeAttribute(c)}))})}}const th={name:"applyStyles",enabled:!0,phase:"write",fn:wM,effect:kM,requires:["computeStyles"]};function Tn(n){return n.split("-")[0]}var Vr=Math.max,ka=Math.min,vi=Math.round;function Xl(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function nh(){return!/^((?!chrome|android).)*safari/i.test(Xl())}function bi(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&Wt(n)&&(i=n.offsetWidth>0&&vi(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&vi(r.height)/n.offsetHeight||1);var a=Rr(n)?Bt(n):window,s=a.visualViewport,c=!nh()&&t,d=(r.left+(c&&s?s.offsetLeft:0))/i,u=(r.top+(c&&s?s.offsetTop:0))/o,p=r.width/i,f=r.height/o;return{width:p,height:f,top:u,right:d+p,bottom:u+f,left:d,x:d,y:u}}function Zl(n){var e=bi(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function rh(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Ql(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Bn(n){return Bt(n).getComputedStyle(n)}function xM(n){return["table","td","th"].indexOf(Cn(n))>=0}function sr(n){return((Rr(n)?n.ownerDocument:n.document)||window.document).documentElement}function xa(n){return Cn(n)==="html"?n:n.assignedSlot||n.parentNode||(Ql(n)?n.host:null)||sr(n)}function ih(n){return!Wt(n)||Bn(n).position==="fixed"?null:n.offsetParent}function CM(n){var e=/firefox/i.test(Xl()),t=/Trident/i.test(Xl());if(t&&Wt(n)){var r=Bn(n);if(r.position==="fixed")return null}var i=xa(n);for(Ql(i)&&(i=i.host);Wt(i)&&["html","body"].indexOf(Cn(i))<0;){var o=Bn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function ho(n){for(var e=Bt(n),t=ih(n);t&&xM(t)&&Bn(t).position==="static";)t=ih(t);return t&&(Cn(t)==="html"||Cn(t)==="body"&&Bn(t).position==="static")?e:t||CM(n)||e}function ec(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function mo(n,e,t){return Vr(n,ka(e,t))}function TM(n,e,t){var r=mo(n,e,t);return r>t?t:r}function oh(){return{top:0,right:0,bottom:0,left:0}}function ah(n){return Object.assign({},oh(),n)}function sh(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var MM=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,ah(typeof e!="number"?e:sh(e,uo))};function SM(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,a=t.modifiersData.popperOffsets,s=Tn(t.placement),c=ec(s),d=[At,Ut].indexOf(s)>=0,u=d?"height":"width";if(!(!o||!a)){var p=MM(i.padding,t),f=Zl(o),h=c==="y"?Dt:At,m=c==="y"?jt:Ut,y=t.rects.reference[u]+t.rects.reference[c]-a[c]-t.rects.popper[u],w=a[c]-t.rects.reference[c],x=ho(o),C=x?c==="y"?x.clientHeight||0:x.clientWidth||0:0,N=y/2-w/2,v=p[h],O=C-f[u]-p[m],k=C/2-f[u]/2+N,E=mo(v,k,O),W=c;t.modifiersData[r]=(e={},e[W]=E,e.centerOffset=E-k,e)}}function DM(n){var e=n.state,t=n.options,r=t.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||rh(e.elements.popper,i)&&(e.elements.arrow=i))}const AM={name:"arrow",enabled:!0,phase:"main",fn:SM,effect:DM,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function wi(n){return n.split("-")[1]}var EM={top:"auto",right:"auto",bottom:"auto",left:"auto"};function NM(n,e){var t=n.x,r=n.y,i=e.devicePixelRatio||1;return{x:vi(t*i)/i||0,y:vi(r*i)/i||0}}function lh(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,a=n.offsets,s=n.position,c=n.gpuAcceleration,d=n.adaptive,u=n.roundOffsets,p=n.isFixed,f=a.x,h=f===void 0?0:f,m=a.y,y=m===void 0?0:m,w=typeof u=="function"?u({x:h,y}):{x:h,y};h=w.x,y=w.y;var x=a.hasOwnProperty("x"),C=a.hasOwnProperty("y"),N=At,v=Dt,O=window;if(d){var k=ho(t),E="clientHeight",W="clientWidth";if(k===Bt(t)&&(k=sr(t),Bn(k).position!=="static"&&s==="absolute"&&(E="scrollHeight",W="scrollWidth")),k=k,i===Dt||(i===At||i===Ut)&&o===po){v=jt;var P=p&&k===O&&O.visualViewport?O.visualViewport.height:k[E];y-=P-r.height,y*=c?1:-1}if(i===At||(i===Dt||i===jt)&&o===po){N=Ut;var T=p&&k===O&&O.visualViewport?O.visualViewport.width:k[W];h-=T-r.width,h*=c?1:-1}}var _=Object.assign({position:s},d&&EM),z=u===!0?NM({x:h,y},Bt(t)):{x:h,y};if(h=z.x,y=z.y,c){var q;return Object.assign({},_,(q={},q[v]=C?"0":"",q[N]=x?"0":"",q.transform=(O.devicePixelRatio||1)<=1?"translate("+h+"px, "+y+"px)":"translate3d("+h+"px, "+y+"px, 0)",q))}return Object.assign({},_,(e={},e[v]=C?y+"px":"",e[N]=x?h+"px":"",e.transform="",e))}function OM(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0?!0:r,o=t.adaptive,a=o===void 0?!0:o,s=t.roundOffsets,c=s===void 0?!0:s,d={placement:Tn(e.placement),variation:wi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,lh(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,lh(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const _M={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:OM,data:{}};var Ca={passive:!0};function BM(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,c=Bt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",t.update,Ca)}),s&&c.addEventListener("resize",t.update,Ca),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",t.update,Ca)}),s&&c.removeEventListener("resize",t.update,Ca)}}const PM={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:BM,data:{}};var IM={left:"right",right:"left",bottom:"top",top:"bottom"};function Ta(n){return n.replace(/left|right|bottom|top/g,function(e){return IM[e]})}var RM={start:"end",end:"start"};function ch(n){return n.replace(/start|end/g,function(e){return RM[e]})}function tc(n){var e=Bt(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function nc(n){return bi(sr(n)).left+tc(n).scrollLeft}function VM(n,e){var t=Bt(n),r=sr(n),i=t.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,c=0;if(i){o=i.width,a=i.height;var d=nh();(d||!d&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:o,height:a,x:s+nc(n),y:c}}function LM(n){var e,t=sr(n),r=tc(n),i=(e=n.ownerDocument)==null?void 0:e.body,o=Vr(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=Vr(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+nc(n),c=-r.scrollTop;return Bn(i||t).direction==="rtl"&&(s+=Vr(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:c}}function rc(n){var e=Bn(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function dh(n){return["html","body","#document"].indexOf(Cn(n))>=0?n.ownerDocument.body:Wt(n)&&rc(n)?n:dh(xa(n))}function go(n,e){var t;e===void 0&&(e=[]);var r=dh(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=Bt(r),a=i?[o].concat(o.visualViewport||[],rc(r)?r:[]):r,s=e.concat(a);return i?s:s.concat(go(xa(a)))}function ic(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function $M(n,e){var t=bi(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function uh(n,e,t){return e===Xf?ic(VM(n,t)):Rr(e)?$M(e,t):ic(LM(sr(n)))}function FM(n){var e=go(xa(n)),t=["absolute","fixed"].indexOf(Bn(n).position)>=0,r=t&&Wt(n)?ho(n):n;return Rr(r)?e.filter(function(i){return Rr(i)&&rh(i,r)&&Cn(i)!=="body"}):[]}function zM(n,e,t,r){var i=e==="clippingParents"?FM(n):[].concat(e),o=[].concat(i,[t]),a=o[0],s=o.reduce(function(c,d){var u=uh(n,d,r);return c.top=Vr(u.top,c.top),c.right=ka(u.right,c.right),c.bottom=ka(u.bottom,c.bottom),c.left=Vr(u.left,c.left),c},uh(n,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function ph(n){var e=n.reference,t=n.element,r=n.placement,i=r?Tn(r):null,o=r?wi(r):null,a=e.x+e.width/2-t.width/2,s=e.y+e.height/2-t.height/2,c;switch(i){case Dt:c={x:a,y:e.y-t.height};break;case jt:c={x:a,y:e.y+e.height};break;case Ut:c={x:e.x+e.width,y:s};break;case At:c={x:e.x-t.width,y:s};break;default:c={x:e.x,y:e.y}}var d=i?ec(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case yi:c[d]=c[d]-(e[u]/2-t[u]/2);break;case po:c[d]=c[d]+(e[u]/2-t[u]/2);break}}return c}function yo(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,a=o===void 0?n.strategy:o,s=t.boundary,c=s===void 0?lM:s,d=t.rootBoundary,u=d===void 0?Xf:d,p=t.elementContext,f=p===void 0?fo:p,h=t.altBoundary,m=h===void 0?!1:h,y=t.padding,w=y===void 0?0:y,x=ah(typeof w!="number"?w:sh(w,uo)),C=f===fo?cM:fo,N=n.rects.popper,v=n.elements[m?C:f],O=zM(Rr(v)?v:v.contextElement||sr(n.elements.popper),c,u,a),k=bi(n.elements.reference),E=ph({reference:k,element:N,strategy:"absolute",placement:i}),W=ic(Object.assign({},N,E)),P=f===fo?W:k,T={top:O.top-P.top+x.top,bottom:P.bottom-O.bottom+x.bottom,left:O.left-P.left+x.left,right:P.right-O.right+x.right},_=n.modifiersData.offset;if(f===fo&&_){var z=_[i];Object.keys(T).forEach(function(q){var L=[Ut,jt].indexOf(q)>=0?1:-1,S=[Dt,jt].indexOf(q)>=0?"y":"x";T[q]+=z[S]*L})}return T}function HM(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,a=t.padding,s=t.flipVariations,c=t.allowedAutoPlacements,d=c===void 0?eh:c,u=wi(r),p=u?s?Zf:Zf.filter(function(m){return wi(m)===u}):uo,f=p.filter(function(m){return d.indexOf(m)>=0});f.length===0&&(f=p);var h=f.reduce(function(m,y){return m[y]=yo(n,{placement:y,boundary:i,rootBoundary:o,padding:a})[Tn(y)],m},{});return Object.keys(h).sort(function(m,y){return h[m]-h[y]})}function YM(n){if(Tn(n)===Jl)return[];var e=Ta(n);return[ch(n),e,ch(e)]}function jM(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0?!0:i,a=t.altAxis,s=a===void 0?!0:a,c=t.fallbackPlacements,d=t.padding,u=t.boundary,p=t.rootBoundary,f=t.altBoundary,h=t.flipVariations,m=h===void 0?!0:h,y=t.allowedAutoPlacements,w=e.options.placement,x=Tn(w),C=x===w,N=c||(C||!m?[Ta(w)]:YM(w)),v=[w].concat(N).reduce(function(F,B){return F.concat(Tn(B)===Jl?HM(e,{placement:B,boundary:u,rootBoundary:p,padding:d,flipVariations:m,allowedAutoPlacements:y}):B)},[]),O=e.rects.reference,k=e.rects.popper,E=new Map,W=!0,P=v[0],T=0;T<v.length;T++){var _=v[T],z=Tn(_),q=wi(_)===yi,L=[Dt,jt].indexOf(z)>=0,S=L?"width":"height",R=yo(e,{placement:_,boundary:u,rootBoundary:p,altBoundary:f,padding:d}),V=L?q?Ut:At:q?jt:Dt;O[S]>k[S]&&(V=Ta(V));var j=Ta(V),b=[];if(o&&b.push(R[z]<=0),s&&b.push(R[V]<=0,R[j]<=0),b.every(function(F){return F})){P=_,W=!1;break}E.set(_,b)}if(W)for(var g=m?3:1,M=function(B){var D=v.find(function(ee){var te=E.get(ee);if(te)return te.slice(0,B).every(function(K){return K})});if(D)return P=D,"break"},A=g;A>0;A--){var $=M(A);if($==="break")break}e.placement!==P&&(e.modifiersData[r]._skip=!0,e.placement=P,e.reset=!0)}}const UM={name:"flip",enabled:!0,phase:"main",fn:jM,requiresIfExists:["offset"],data:{_skip:!1}};function fh(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function hh(n){return[Dt,Ut,jt,At].some(function(e){return n[e]>=0})}function WM(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,a=yo(e,{elementContext:"reference"}),s=yo(e,{altBoundary:!0}),c=fh(a,r),d=fh(s,i,o),u=hh(c),p=hh(d);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:p},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}const qM={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:WM};function KM(n,e,t){var r=Tn(n),i=[At,Dt].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[At,Ut].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function GM(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,a=eh.reduce(function(u,p){return u[p]=KM(p,e.rects,o),u},{}),s=a[e.placement],c=s.x,d=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=a}const JM={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:GM};function QM(n){var e=n.state,t=n.name;e.modifiersData[t]=ph({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const XM={name:"popperOffsets",enabled:!0,phase:"read",fn:QM,data:{}};function ZM(n){return n==="x"?"y":"x"}function eS(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0?!0:i,a=t.altAxis,s=a===void 0?!1:a,c=t.boundary,d=t.rootBoundary,u=t.altBoundary,p=t.padding,f=t.tether,h=f===void 0?!0:f,m=t.tetherOffset,y=m===void 0?0:m,w=yo(e,{boundary:c,rootBoundary:d,padding:p,altBoundary:u}),x=Tn(e.placement),C=wi(e.placement),N=!C,v=ec(x),O=ZM(v),k=e.modifiersData.popperOffsets,E=e.rects.reference,W=e.rects.popper,P=typeof y=="function"?y(Object.assign({},e.rects,{placement:e.placement})):y,T=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),_=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,z={x:0,y:0};if(k){if(o){var q,L=v==="y"?Dt:At,S=v==="y"?jt:Ut,R=v==="y"?"height":"width",V=k[v],j=V+w[L],b=V-w[S],g=h?-W[R]/2:0,M=C===yi?E[R]:W[R],A=C===yi?-W[R]:-E[R],$=e.elements.arrow,F=h&&$?Zl($):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:oh(),D=B[L],ee=B[S],te=mo(0,E[R],F[R]),K=N?E[R]/2-g-te-D-T.mainAxis:M-te-D-T.mainAxis,ce=N?-E[R]/2+g+te+ee+T.mainAxis:A+te+ee+T.mainAxis,ae=e.elements.arrow&&ho(e.elements.arrow),U=ae?v==="y"?ae.clientTop||0:ae.clientLeft||0:0,Z=(q=_==null?void 0:_[v])!=null?q:0,me=V+K-Z-U,ne=V+ce-Z,Me=mo(h?ka(j,me):j,V,h?Vr(b,ne):b);k[v]=Me,z[v]=Me-V}if(s){var Xe,sn=v==="x"?Dt:At,It=v==="x"?jt:Ut,Et=k[O],Rt=O==="y"?"height":"width",In=Et+w[sn],Vt=Et-w[It],it=[Dt,At].indexOf(x)!==-1,dr=(Xe=_==null?void 0:_[O])!=null?Xe:0,ur=it?In:Et-E[Rt]-W[Rt]-dr+T.altAxis,Rn=it?Et+E[Rt]+W[Rt]-dr-T.altAxis:Vt,I=h&&it?TM(ur,Et,Rn):mo(h?ur:In,Et,h?Rn:Vt);k[O]=I,z[O]=I-Et}e.modifiersData[r]=z}}const tS={name:"preventOverflow",enabled:!0,phase:"main",fn:eS,requiresIfExists:["offset"]};function nS(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function rS(n){return n===Bt(n)||!Wt(n)?tc(n):nS(n)}function iS(n){var e=n.getBoundingClientRect(),t=vi(e.width)/n.offsetWidth||1,r=vi(e.height)/n.offsetHeight||1;return t!==1||r!==1}function oS(n,e,t){t===void 0&&(t=!1);var r=Wt(e),i=Wt(e)&&iS(e),o=sr(e),a=bi(n,i,t),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((Cn(e)!=="body"||rc(o))&&(s=rS(e)),Wt(e)?(c=bi(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=nc(o))),{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function aS(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function i(o){t.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!t.has(s)){var c=e.get(s);c&&i(c)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||i(o)}),r}function sS(n){var e=aS(n);return bM.reduce(function(t,r){return t.concat(e.filter(function(i){return i.phase===r}))},[])}function lS(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function cS(n){var e=n.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var mh={placement:"bottom",modifiers:[],strategy:"absolute"};function gh(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function dS(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,r=t===void 0?[]:t,i=e.defaultOptions,o=i===void 0?mh:i;return function(s,c,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},mh,o),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},p=[],f=!1,h={state:u,setOptions:function(x){var C=typeof x=="function"?x(u.options):x;y(),u.options=Object.assign({},o,u.options,C),u.scrollParents={reference:Rr(s)?go(s):s.contextElement?go(s.contextElement):[],popper:go(c)};var N=sS(cS([].concat(r,u.options.modifiers)));return u.orderedModifiers=N.filter(function(v){return v.enabled}),m(),h.update()},forceUpdate:function(){if(!f){var x=u.elements,C=x.reference,N=x.popper;if(gh(C,N)){u.rects={reference:oS(C,ho(N),u.options.strategy==="fixed"),popper:Zl(N)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(T){return u.modifiersData[T.name]=Object.assign({},T.data)});for(var v=0;v<u.orderedModifiers.length;v++){if(u.reset===!0){u.reset=!1,v=-1;continue}var O=u.orderedModifiers[v],k=O.fn,E=O.options,W=E===void 0?{}:E,P=O.name;typeof k=="function"&&(u=k({state:u,options:W,name:P,instance:h})||u)}}}},update:lS(function(){return new Promise(function(w){h.forceUpdate(),w(u)})}),destroy:function(){y(),f=!0}};if(!gh(s,c))return h;h.setOptions(d).then(function(w){!f&&d.onFirstUpdate&&d.onFirstUpdate(w)});function m(){u.orderedModifiers.forEach(function(w){var x=w.name,C=w.options,N=C===void 0?{}:C,v=w.effect;if(typeof v=="function"){var O=v({state:u,name:x,instance:h,options:N}),k=function(){};p.push(O||k)}})}function y(){p.forEach(function(w){return w()}),p=[]}return h}}var uS=[PM,XM,_M,th,JM,UM,tS,AM,qM],pS=dS({defaultModifiers:uS}),fS="tippy-box",yh="tippy-content",hS="tippy-backdrop",vh="tippy-arrow",bh="tippy-svg-arrow",Lr={passive:!0,capture:!0},wh=function(){return document.body};function mS(n,e){return{}.hasOwnProperty.call(n,e)}function oc(n,e,t){if(Array.isArray(n)){var r=n[e];return r??(Array.isArray(t)?t[e]:t)}return n}function ac(n,e){var t={}.toString.call(n);return t.indexOf("[object")===0&&t.indexOf(e+"]")>-1}function kh(n,e){return typeof n=="function"?n.apply(void 0,e):n}function xh(n,e){if(e===0)return n;var t;return function(r){clearTimeout(t),t=setTimeout(function(){n(r)},e)}}function gS(n,e){var t=Object.assign({},n);return e.forEach(function(r){delete t[r]}),t}function yS(n){return n.split(/\s+/).filter(Boolean)}function ki(n){return[].concat(n)}function Ch(n,e){n.indexOf(e)===-1&&n.push(e)}function vS(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function bS(n){return n.split("-")[0]}function Ma(n){return[].slice.call(n)}function Th(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function vo(){return document.createElement("div")}function bo(n){return["Element","Fragment"].some(function(e){return ac(n,e)})}function wS(n){return ac(n,"NodeList")}function kS(n){return ac(n,"MouseEvent")}function xS(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function CS(n){return bo(n)?[n]:wS(n)?Ma(n):Array.isArray(n)?n:Ma(document.querySelectorAll(n))}function sc(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Mh(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function TS(n){var e,t=ki(n),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function MS(n,e){var t=e.clientX,r=e.clientY;return n.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,c=s.interactiveBorder,d=bS(a.placement),u=a.modifiersData.offset;if(!u)return!0;var p=d==="bottom"?u.top.y:0,f=d==="top"?u.bottom.y:0,h=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,y=o.top-r+p>c,w=r-o.bottom-f>c,x=o.left-t+h>c,C=t-o.right-m>c;return y||w||x||C})}function lc(n,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){n[r](i,t)})}function Sh(n,e){for(var t=e;t;){var r;if(n.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var Mn={isTouch:!1},Dh=0;function SS(){Mn.isTouch||(Mn.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ah))}function Ah(){var n=performance.now();n-Dh<20&&(Mn.isTouch=!1,document.removeEventListener("mousemove",Ah)),Dh=n}function DS(){var n=document.activeElement;if(xS(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function AS(){document.addEventListener("touchstart",SS,Lr),window.addEventListener("blur",DS)}var ES=typeof window<"u"&&typeof document<"u",NS=ES?!!window.msCrypto:!1;function xi(n){var e=n==="destroy"?"n already-":" ";return[n+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Eh(n){var e=/[ \t]{2,}/g,t=/^[ \t]*/gm;return n.replace(e," ").replace(t,"").trim()}function OS(n){return Eh(`
|
|
160
160
|
%ctippy.js
|
|
161
161
|
|
|
162
|
-
%c`+
|
|
162
|
+
%c`+Eh(n)+`
|
|
163
163
|
|
|
164
164
|
%c👷 This is a development-only message. It will be removed in production.
|
|
165
|
-
`)}function
|
|
165
|
+
`)}function Nh(n){return[OS(n),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var wo;process.env.NODE_ENV!=="production"&&_S();function _S(){wo=new Set}function Pn(n,e){if(n&&!wo.has(e)){var t;wo.add(e),(t=console).warn.apply(t,Nh(e))}}function cc(n,e){if(n&&!wo.has(e)){var t;wo.add(e),(t=console).error.apply(t,Nh(e))}}function BS(n){var e=!n,t=Object.prototype.toString.call(n)==="[object Object]"&&!n.addEventListener;cc(e,["tippy() was passed","`"+String(n)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),cc(t,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var Oh={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},PS={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Pt=Object.assign({appendTo:wh,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Oh,PS),IS=Object.keys(Pt),RS=function(e){process.env.NODE_ENV!=="production"&&Ph(e,[]);var t=Object.keys(e);t.forEach(function(r){Pt[r]=e[r]})};function _h(n){var e=n.plugins||[],t=e.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var s;r[o]=n[o]!==void 0?n[o]:(s=Pt[o])!=null?s:a}return r},{});return Object.assign({},n,t)}function VS(n,e){var t=e?Object.keys(_h(Object.assign({},Pt,{plugins:e}))):IS,r=t.reduce(function(i,o){var a=(n.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function Bh(n,e){var t=Object.assign({},e,{content:kh(e.content,[n])},e.ignoreAttributes?{}:VS(n,e.plugins));return t.aria=Object.assign({},Pt.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}function Ph(n,e){n===void 0&&(n={}),e===void 0&&(e=[]);var t=Object.keys(n);t.forEach(function(r){var i=gS(Pt,Object.keys(Oh)),o=!mS(i,r);o&&(o=e.filter(function(a){return a.name===r}).length===0),Pn(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
|
|
166
166
|
|
|
167
167
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
168
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var
|
|
168
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var LS=function(){return"innerHTML"};function dc(n,e){n[LS()]=e}function Ih(n){var e=vo();return n===!0?e.className=vh:(e.className=bh,bo(n)?e.appendChild(n):dc(e,n)),e}function Rh(n,e){bo(e.content)?(dc(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?dc(n,e.content):n.textContent=e.content)}function uc(n){var e=n.firstElementChild,t=Ma(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(yh)}),arrow:t.find(function(r){return r.classList.contains(vh)||r.classList.contains(bh)}),backdrop:t.find(function(r){return r.classList.contains(hS)})}}function Vh(n){var e=vo(),t=vo();t.className=fS,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=vo();r.className=yh,r.setAttribute("data-state","hidden"),Rh(r,n.props),e.appendChild(t),t.appendChild(r),i(n.props,n.props);function i(o,a){var s=uc(e),c=s.box,d=s.content,u=s.arrow;a.theme?c.setAttribute("data-theme",a.theme):c.removeAttribute("data-theme"),typeof a.animation=="string"?c.setAttribute("data-animation",a.animation):c.removeAttribute("data-animation"),a.inertia?c.setAttribute("data-inertia",""):c.removeAttribute("data-inertia"),c.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?c.setAttribute("role",a.role):c.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&Rh(d,n.props),a.arrow?u?o.arrow!==a.arrow&&(c.removeChild(u),c.appendChild(Ih(a.arrow))):c.appendChild(Ih(a.arrow)):u&&c.removeChild(u)}return{popper:e,onUpdate:i}}Vh.$$tippy=!0;var $S=1,Sa=[],pc=[];function FS(n,e){var t=Bh(n,Object.assign({},Pt,_h(Th(e)))),r,i,o,a=!1,s=!1,c=!1,d=!1,u,p,f,h=[],m=xh(me,t.interactiveDebounce),y,w=$S++,x=null,C=vS(t.plugins),N={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},v={id:w,reference:n,popper:vo(),popperInstance:x,props:t,state:N,plugins:C,clearDelayTimeouts:ur,setProps:Rn,setContent:I,show:Q,hide:fe,hideWithInteractivity:ke,enable:it,disable:dr,unmount:Ve,destroy:qt};if(!t.render)return process.env.NODE_ENV!=="production"&&cc(!0,"render() function has not been supplied."),v;var O=t.render(v),k=O.popper,E=O.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+v.id,v.popper=k,n._tippy=v,k._tippy=v;var W=C.map(function(Y){return Y.fn(v)}),P=n.hasAttribute("aria-expanded");return ae(),g(),V(),j("onCreate",[v]),t.showOnCreate&&In(),k.addEventListener("mouseenter",function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",m)}),v;function T(){var Y=v.props.touch;return Array.isArray(Y)?Y:[Y,0]}function _(){return T()[0]==="hold"}function z(){var Y;return!!((Y=v.props.render)!=null&&Y.$$tippy)}function q(){return y||n}function L(){var Y=q().parentNode;return Y?TS(Y):document}function S(){return uc(k)}function R(Y){return v.state.isMounted&&!v.state.isVisible||Mn.isTouch||u&&u.type==="focus"?0:oc(v.props.delay,Y?0:1,Pt.delay)}function V(Y){Y===void 0&&(Y=!1),k.style.pointerEvents=v.props.interactive&&!Y?"":"none",k.style.zIndex=""+v.props.zIndex}function j(Y,H,X){if(X===void 0&&(X=!0),W.forEach(function(ge){ge[Y]&&ge[Y].apply(ge,H)}),X){var re;(re=v.props)[Y].apply(re,H)}}function b(){var Y=v.props.aria;if(Y.content){var H="aria-"+Y.content,X=k.id,re=ki(v.props.triggerTarget||n);re.forEach(function(ge){var Le=ge.getAttribute(H);if(v.state.isVisible)ge.setAttribute(H,Le?Le+" "+X:X);else{var gt=Le&&Le.replace(X,"").trim();gt?ge.setAttribute(H,gt):ge.removeAttribute(H)}})}}function g(){if(!(P||!v.props.aria.expanded)){var Y=ki(v.props.triggerTarget||n);Y.forEach(function(H){v.props.interactive?H.setAttribute("aria-expanded",v.state.isVisible&&H===q()?"true":"false"):H.removeAttribute("aria-expanded")})}}function M(){L().removeEventListener("mousemove",m),Sa=Sa.filter(function(Y){return Y!==m})}function A(Y){if(!(Mn.isTouch&&(c||Y.type==="mousedown"))){var H=Y.composedPath&&Y.composedPath()[0]||Y.target;if(!(v.props.interactive&&Sh(k,H))){if(ki(v.props.triggerTarget||n).some(function(X){return Sh(X,H)})){if(Mn.isTouch||v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else j("onClickOutside",[v,Y]);v.props.hideOnClick===!0&&(v.clearDelayTimeouts(),v.hide(),s=!0,setTimeout(function(){s=!1}),v.state.isMounted||D())}}}function $(){c=!0}function F(){c=!1}function B(){var Y=L();Y.addEventListener("mousedown",A,!0),Y.addEventListener("touchend",A,Lr),Y.addEventListener("touchstart",F,Lr),Y.addEventListener("touchmove",$,Lr)}function D(){var Y=L();Y.removeEventListener("mousedown",A,!0),Y.removeEventListener("touchend",A,Lr),Y.removeEventListener("touchstart",F,Lr),Y.removeEventListener("touchmove",$,Lr)}function ee(Y,H){K(Y,function(){!v.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&H()})}function te(Y,H){K(Y,H)}function K(Y,H){var X=S().box;function re(ge){ge.target===X&&(lc(X,"remove",re),H())}if(Y===0)return H();lc(X,"remove",p),lc(X,"add",re),p=re}function ce(Y,H,X){X===void 0&&(X=!1);var re=ki(v.props.triggerTarget||n);re.forEach(function(ge){ge.addEventListener(Y,H,X),h.push({node:ge,eventType:Y,handler:H,options:X})})}function ae(){_()&&(ce("touchstart",Z,{passive:!0}),ce("touchend",ne,{passive:!0})),yS(v.props.trigger).forEach(function(Y){if(Y!=="manual")switch(ce(Y,Z),Y){case"mouseenter":ce("mouseleave",ne);break;case"focus":ce(NS?"focusout":"blur",Me);break;case"focusin":ce("focusout",Me);break}})}function U(){h.forEach(function(Y){var H=Y.node,X=Y.eventType,re=Y.handler,ge=Y.options;H.removeEventListener(X,re,ge)}),h=[]}function Z(Y){var H,X=!1;if(!(!v.state.isEnabled||Xe(Y)||s)){var re=((H=u)==null?void 0:H.type)==="focus";u=Y,y=Y.currentTarget,g(),!v.state.isVisible&&kS(Y)&&Sa.forEach(function(ge){return ge(Y)}),Y.type==="click"&&(v.props.trigger.indexOf("mouseenter")<0||a)&&v.props.hideOnClick!==!1&&v.state.isVisible?X=!0:In(Y),Y.type==="click"&&(a=!X),X&&!re&&Vt(Y)}}function me(Y){var H=Y.target,X=q().contains(H)||k.contains(H);if(!(Y.type==="mousemove"&&X)){var re=Rt().concat(k).map(function(ge){var Le,gt=ge._tippy,Ti=(Le=gt.popperInstance)==null?void 0:Le.state;return Ti?{popperRect:ge.getBoundingClientRect(),popperState:Ti,props:t}:null}).filter(Boolean);MS(re,Y)&&(M(),Vt(Y))}}function ne(Y){var H=Xe(Y)||v.props.trigger.indexOf("click")>=0&&a;if(!H){if(v.props.interactive){v.hideWithInteractivity(Y);return}Vt(Y)}}function Me(Y){v.props.trigger.indexOf("focusin")<0&&Y.target!==q()||v.props.interactive&&Y.relatedTarget&&k.contains(Y.relatedTarget)||Vt(Y)}function Xe(Y){return Mn.isTouch?_()!==Y.type.indexOf("touch")>=0:!1}function sn(){It();var Y=v.props,H=Y.popperOptions,X=Y.placement,re=Y.offset,ge=Y.getReferenceClientRect,Le=Y.moveTransition,gt=z()?uc(k).arrow:null,Ti=ge?{getBoundingClientRect:ge,contextElement:ge.contextElement||q()}:n,Xh={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(Na){var Mi=Na.state;if(z()){var oE=S(),yc=oE.box;["placement","reference-hidden","escaped"].forEach(function(Oa){Oa==="placement"?yc.setAttribute("data-placement",Mi.placement):Mi.attributes.popper["data-popper-"+Oa]?yc.setAttribute("data-"+Oa,""):yc.removeAttribute("data-"+Oa)}),Mi.attributes.popper={}}}},$r=[{name:"offset",options:{offset:re}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Le}},Xh];z()&>&&$r.push({name:"arrow",options:{element:gt,padding:3}}),$r.push.apply($r,(H==null?void 0:H.modifiers)||[]),v.popperInstance=pS(Ti,k,Object.assign({},H,{placement:X,onFirstUpdate:f,modifiers:$r}))}function It(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function Et(){var Y=v.props.appendTo,H,X=q();v.props.interactive&&Y===wh||Y==="parent"?H=X.parentNode:H=kh(Y,[X]),H.contains(k)||H.appendChild(k),v.state.isMounted=!0,sn(),process.env.NODE_ENV!=="production"&&Pn(v.props.interactive&&Y===Pt.appendTo&&X.nextElementSibling!==k,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
169
169
|
|
|
170
170
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
171
171
|
|
|
172
172
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
173
173
|
|
|
174
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function
|
|
174
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function Rt(){return Ma(k.querySelectorAll("[data-tippy-root]"))}function In(Y){v.clearDelayTimeouts(),Y&&j("onTrigger",[v,Y]),B();var H=R(!0),X=T(),re=X[0],ge=X[1];Mn.isTouch&&re==="hold"&&ge&&(H=ge),H?r=setTimeout(function(){v.show()},H):v.show()}function Vt(Y){if(v.clearDelayTimeouts(),j("onUntrigger",[v,Y]),!v.state.isVisible){D();return}if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(Y.type)>=0&&a)){var H=R(!1);H?i=setTimeout(function(){v.state.isVisible&&v.hide()},H):o=requestAnimationFrame(function(){v.hide()})}}function it(){v.state.isEnabled=!0}function dr(){v.hide(),v.state.isEnabled=!1}function ur(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Rn(Y){if(process.env.NODE_ENV!=="production"&&Pn(v.state.isDestroyed,xi("setProps")),!v.state.isDestroyed){j("onBeforeUpdate",[v,Y]),U();var H=v.props,X=Bh(n,Object.assign({},H,Th(Y),{ignoreAttributes:!0}));v.props=X,ae(),H.interactiveDebounce!==X.interactiveDebounce&&(M(),m=xh(me,X.interactiveDebounce)),H.triggerTarget&&!X.triggerTarget?ki(H.triggerTarget).forEach(function(re){re.removeAttribute("aria-expanded")}):X.triggerTarget&&n.removeAttribute("aria-expanded"),g(),V(),E&&E(H,X),v.popperInstance&&(sn(),Rt().forEach(function(re){requestAnimationFrame(re._tippy.popperInstance.forceUpdate)})),j("onAfterUpdate",[v,Y])}}function I(Y){v.setProps({content:Y})}function Q(){process.env.NODE_ENV!=="production"&&Pn(v.state.isDestroyed,xi("show"));var Y=v.state.isVisible,H=v.state.isDestroyed,X=!v.state.isEnabled,re=Mn.isTouch&&!v.props.touch,ge=oc(v.props.duration,0,Pt.duration);if(!(Y||H||X||re)&&!q().hasAttribute("disabled")&&(j("onShow",[v],!1),v.props.onShow(v)!==!1)){if(v.state.isVisible=!0,z()&&(k.style.visibility="visible"),V(),B(),v.state.isMounted||(k.style.transition="none"),z()){var Le=S(),gt=Le.box,Ti=Le.content;sc([gt,Ti],0)}f=function(){var $r;if(!(!v.state.isVisible||d)){if(d=!0,k.offsetHeight,k.style.transition=v.props.moveTransition,z()&&v.props.animation){var gc=S(),Na=gc.box,Mi=gc.content;sc([Na,Mi],ge),Mh([Na,Mi],"visible")}b(),g(),Ch(pc,v),($r=v.popperInstance)==null||$r.forceUpdate(),j("onMount",[v]),v.props.animation&&z()&&te(ge,function(){v.state.isShown=!0,j("onShown",[v])})}},Et()}}function fe(){process.env.NODE_ENV!=="production"&&Pn(v.state.isDestroyed,xi("hide"));var Y=!v.state.isVisible,H=v.state.isDestroyed,X=!v.state.isEnabled,re=oc(v.props.duration,1,Pt.duration);if(!(Y||H||X)&&(j("onHide",[v],!1),v.props.onHide(v)!==!1)){if(v.state.isVisible=!1,v.state.isShown=!1,d=!1,a=!1,z()&&(k.style.visibility="hidden"),M(),D(),V(!0),z()){var ge=S(),Le=ge.box,gt=ge.content;v.props.animation&&(sc([Le,gt],re),Mh([Le,gt],"hidden"))}b(),g(),v.props.animation?z()&&ee(re,v.unmount):v.unmount()}}function ke(Y){process.env.NODE_ENV!=="production"&&Pn(v.state.isDestroyed,xi("hideWithInteractivity")),L().addEventListener("mousemove",m),Ch(Sa,m),m(Y)}function Ve(){process.env.NODE_ENV!=="production"&&Pn(v.state.isDestroyed,xi("unmount")),v.state.isVisible&&v.hide(),v.state.isMounted&&(It(),Rt().forEach(function(Y){Y._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),pc=pc.filter(function(Y){return Y!==v}),v.state.isMounted=!1,j("onHidden",[v]))}function qt(){process.env.NODE_ENV!=="production"&&Pn(v.state.isDestroyed,xi("destroy")),!v.state.isDestroyed&&(v.clearDelayTimeouts(),v.unmount(),U(),delete n._tippy,v.state.isDestroyed=!0,j("onDestroy",[v]))}}function Ci(n,e){e===void 0&&(e={});var t=Pt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(BS(n),Ph(e,t)),AS();var r=Object.assign({},e,{plugins:t}),i=CS(n);if(process.env.NODE_ENV!=="production"){var o=bo(r.content),a=i.length>1;Pn(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
|
|
175
175
|
|
|
176
176
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
177
177
|
|
|
178
178
|
`,`1) content: element.innerHTML
|
|
179
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(c,d){var u=d&&WT(d,r);return u&&c.push(u),c},[]);return bo(n)?s[0]:s}wi.defaultProps=Pt,wi.setDefaultProps=HT,wi.currentInput=Mn,Object.assign({},th,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}}),wi.setDefaultProps({render:Vh});class qT{constructor({editor:e,element:t,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:s,state:c,from:d,to:u})=>{const{doc:f,selection:p}=c,{empty:h}=p,m=!f.textBetween(d,u).length&&Ll(c.selection),v=this.element.contains(document.activeElement);return!(!(s.hasFocus()||v)||h||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var c;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.handleDebouncedUpdate=(s,c)=>{const d=!(c!=null&&c.selection.eq(s.state.selection)),u=!(c!=null&&c.doc.eq(s.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(s,d,u,c)},this.updateDelay))},this.updateHandler=(s,c,d,u)=>{var f,p,h;const{state:m,composing:v}=s,{selection:w}=m;if(v||!c&&!d)return;this.createTooltip();const{ranges:C}=w,N=Math.min(...C.map(k=>k.$from.pos)),y=Math.max(...C.map(k=>k.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:s,state:m,oldState:u,from:N,to:y}))){this.hide();return}(p=this.tippy)===null||p===void 0||p.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(qM(m.selection)){let k=s.nodeDOM(N);const E=k.dataset.nodeViewWrapper?k:k.querySelector("[data-node-view-wrapper]");if(E&&(k=E.firstChild),k)return k.getBoundingClientRect()}return Qp(s,N,y)})}),this.show()},this.editor=e,this.element=t,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=wi(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,t);return}const o=!(t!=null&&t.selection.eq(e.state.selection)),a=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,a,t)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const $h=n=>new Mt({key:typeof n.pluginKey=="string"?new vn(n.pluginKey):n.pluginKey,view:e=>new qT({view:e,...n})});ht.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[$h({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class KT{constructor({editor:e,element:t,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:a,state:s})=>{const{selection:c}=s,{$anchor:d,empty:u}=c,f=d.depth===1,p=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!a.hasFocus()||!u||!f||!p||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var s;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((s=this.element.parentNode)===null||s===void 0)&&s.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.editor=e,this.element=t,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=wi(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){var r,i,o;const{state:a}=e,{doc:s,selection:c}=a,{from:d,to:u}=c;if(t&&t.doc.eq(s)&&t.selection.eq(c))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:a,oldState:t}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>Qp(e,d,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Lh=n=>new Mt({key:typeof n.pluginKey=="string"?new vn(n.pluginKey):n.pluginKey,view:e=>new KT({view:e,...n})});ht.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Lh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),l.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:a,tippyOptions:s}=n;i.registerPlugin($h({updateDelay:r,editor:i,element:t.value,pluginKey:o,shouldShow:a,tippyOptions:s}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=n;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Fh(n){return l.customRef((e,t)=>({get(){return e(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}class GT extends fS{constructor(e={}){return super(e),this.vueRenderers=l.reactive(new Map),this.contentComponent=null,this.reactiveState=Fh(this.view.state),this.reactiveExtensionStorage=Fh(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),l.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){super.registerPlugin(e,t),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const QT=l.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=l.ref(),t=l.getCurrentInstance();return l.watchEffect(()=>{const r=n.editor;r&&r.options.element&&e.value&&l.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=l.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=t.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),l.onBeforeUnmount(()=>{const r=n.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const n=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const t=l.h(l.Teleport,{to:e.teleportElement,key:e.id},l.h(e.component,{ref:e.id,...e.props}));n.push(t)}),l.h("div",{ref:e=>{this.rootEl=e}},...n)}});l.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:a}=n;i.registerPlugin(Lh({pluginKey:r,editor:i,element:t.value,tippyOptions:o,shouldShow:a}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=n;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),l.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return l.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),l.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,e;return l.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))}});const JT=(n={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new GT(n)}),l.onBeforeUnmount(()=>{var t;(t=e.value)===null||t===void 0||t.destroy()}),e},XT=/^\s*>\s$/,ZT=_t.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[co({find:XT,type:this.type})]}}),eD=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,tD=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,nD=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,rD=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,iD=nn.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[_r({find:eD,type:this.type}),_r({find:nD,type:this.type})]},addPasteRules(){return[Br({find:tD,type:this.type}),Br({find:rD,type:this.type})]}}),oD=_t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ge(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),zh=nn.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=ba(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Hh=/^\s*([-+*])\s$/,aD=_t.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(oD.name,this.editor.getAttributes(zh.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=co({find:Hh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=co({find:Hh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(zh.name),editor:this.editor})),[n]}}),sD=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,lD=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,cD=nn.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[_r({find:sD,type:this.type})]},addPasteRules(){return[Br({find:lD,type:this.type})]}}),dD=/^```([a-z]+)?[\s\n]$/,uD=/^~~~([a-z]+)?[\s\n]$/,fD=_t.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options,o=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",Ge(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
|
|
179
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var s=i.reduce(function(c,d){var u=d&&FS(d,r);return u&&c.push(u),c},[]);return bo(n)?s[0]:s}Ci.defaultProps=Pt,Ci.setDefaultProps=RS,Ci.currentInput=Mn,Object.assign({},th,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}}),Ci.setDefaultProps({render:Vh});class zS{constructor({editor:e,element:t,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:a}){this.preventHide=!1,this.shouldShow=({view:s,state:c,from:d,to:u})=>{const{doc:p,selection:f}=c,{empty:h}=f,m=!p.textBetween(d,u).length&&zl(c.selection),y=this.element.contains(document.activeElement);return!(!(s.hasFocus()||y)||h||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var c;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((c=this.element.parentNode)===null||c===void 0)&&c.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.handleDebouncedUpdate=(s,c)=>{const d=!(c!=null&&c.selection.eq(s.state.selection)),u=!(c!=null&&c.doc.eq(s.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(s,d,u,c)},this.updateDelay))},this.updateHandler=(s,c,d,u)=>{var p,f,h;const{state:m,composing:y}=s,{selection:w}=m;if(y||!c&&!d)return;this.createTooltip();const{ranges:C}=w,N=Math.min(...C.map(k=>k.$from.pos)),v=Math.max(...C.map(k=>k.$to.pos));if(!((p=this.shouldShow)===null||p===void 0?void 0:p.call(this,{editor:this.editor,view:s,state:m,oldState:u,from:N,to:v}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((h=this.tippyOptions)===null||h===void 0?void 0:h.getReferenceClientRect)||(()=>{if(zT(m.selection)){let k=s.nodeDOM(N);const E=k.dataset.nodeViewWrapper?k:k.querySelector("[data-node-view-wrapper]");if(E&&(k=E.firstChild),k)return k.getBoundingClientRect()}return Jf(s,N,v)})}),this.show()},this.editor=e,this.element=t,this.view=r,this.updateDelay=o,a&&(this.shouldShow=a),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=Ci(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,t);return}const o=!(t!=null&&t.selection.eq(e.state.selection)),a=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,a,t)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Lh=n=>new Mt({key:typeof n.pluginKey=="string"?new bn(n.pluginKey):n.pluginKey,view:e=>new zS({view:e,...n})});mt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Lh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class HS{constructor({editor:e,element:t,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:a,state:s})=>{const{selection:c}=s,{$anchor:d,empty:u}=c,p=d.depth===1,f=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!a.hasFocus()||!u||!p||!f||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var s;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((s=this.element.parentNode)===null||s===void 0)&&s.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.editor=e,this.element=t,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=Ci(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){var r,i,o;const{state:a}=e,{doc:s,selection:c}=a,{from:d,to:u}=c;if(t&&t.doc.eq(s)&&t.selection.eq(c))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:a,oldState:t}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>Jf(e,d,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const $h=n=>new Mt({key:typeof n.pluginKey=="string"?new bn(n.pluginKey):n.pluginKey,view:e=>new HS({view:e,...n})});mt.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[$h({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),l.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:a,tippyOptions:s}=n;i.registerPlugin(Lh({updateDelay:r,editor:i,element:t.value,pluginKey:o,shouldShow:a,tippyOptions:s}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=n;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Fh(n){return l.customRef((e,t)=>({get(){return e(),n},set(r){n=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{t()})})}}))}class YS extends aM{constructor(e={}){return super(e),this.vueRenderers=l.reactive(new Map),this.contentComponent=null,this.reactiveState=Fh(this.view.state),this.reactiveExtensionStorage=Fh(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),l.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,t){super.registerPlugin(e,t),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const jS=l.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(n){const e=l.ref(),t=l.getCurrentInstance();return l.watchEffect(()=>{const r=n.editor;r&&r.options.element&&e.value&&l.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=l.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=t.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),l.onBeforeUnmount(()=>{const r=n.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const n=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const t=l.h(l.Teleport,{to:e.teleportElement,key:e.id},l.h(e.component,{ref:e.id,...e.props}));n.push(t)}),l.h("div",{ref:e=>{this.rootEl=e}},...n)}});l.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(n,{slots:e}){const t=l.ref(null);return l.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:a}=n;i.registerPlugin($h({pluginKey:r,editor:i,element:t.value,tippyOptions:o,shouldShow:a}))}),l.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=n;i.unregisterPlugin(r)}),()=>{var r;return l.h("div",{ref:t},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),l.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return l.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),l.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var n,e;return l.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))}});const US=(n={})=>{const e=l.shallowRef();return l.onMounted(()=>{e.value=new YS(n)}),l.onBeforeUnmount(()=>{var t;(t=e.value)===null||t===void 0||t.destroy()}),e},WS=/^\s*>\s$/,qS=_t.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return["blockquote",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[co({find:WS,type:this.type})]}}),KS=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,GS=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,JS=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,QS=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,XS=on.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return["strong",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Pr({find:KS,type:this.type}),Pr({find:JS,type:this.type})]},addPasteRules(){return[Ir({find:GS,type:this.type}),Ir({find:QS,type:this.type})]}}),ZS=_t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ge(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),zh=on.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=ba(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Hh=/^\s*([-+*])\s$/,eD=_t.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ZS.name,this.editor.getAttributes(zh.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=co({find:Hh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=co({find:Hh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(zh.name),editor:this.editor})),[n]}}),tD=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,nD=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,rD=on.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Pr({find:tD,type:this.type})]},addPasteRules(){return[Ir({find:nD,type:this.type})]}}),iD=/^```([a-z]+)?[\s\n]$/,oD=/^~~~([a-z]+)?[\s\n]$/,aD=_t.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:n=>{var e;const{languageClassPrefix:t}=this.options,o=[...((e=n.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(a=>a.startsWith(t)).map(a=>a.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",Ge(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,a=r.parent.textContent.endsWith(`
|
|
180
180
|
|
|
181
|
-
`);return!o||!a?!1:n.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();return s===void 0||r.nodeAt(s)?!1:n.commands.exitCode()}}},addInputRules(){return[
|
|
182
|
-
`)),a.setMeta("paste",!0),n.dispatch(a),!0}}})]}}),
|
|
183
|
-
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&a){const f=c.filter(p=>s.includes(p.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),TD=_t.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ge(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Wl({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Aa=200,it=function(){};it.prototype.append=function(e){return e.length?(e=it.from(e),!this.length&&e||e.length<Aa&&this.leafAppend(e)||this.length<Aa&&e.leafPrepend(this)||this.appendInner(e)):this},it.prototype.prepend=function(e){return e.length?it.from(e).append(this):this},it.prototype.appendInner=function(e){return new DD(this,e)},it.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?it.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},it.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},it.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},it.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},it.from=function(e){return e instanceof it?e:e&&e.length?new Yh(e):it.empty};var Yh=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,s){for(var c=o;c<a;c++)if(i(this.values[c],s+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,s){for(var c=o-1;c>=a;c--)if(i(this.values[c],s+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Aa)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Aa)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(it);it.empty=new Yh([]);var DD=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(it);const AD=500;class rn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,s,c,d=[],u=[];return this.items.forEach((f,p)=>{if(!f.step){i||(i=this.remapping(r,p+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new Sn(f.map));let h=f.step.map(i.slice(o)),m;h&&a.maybeStep(h).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],d.push(new Sn(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else a.maybeStep(f.step);if(f.selection)return s=i?f.selection.map(i.slice(o)):f.selection,c=new rn(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:s}}addTransform(e,t,r,i){let o=[],a=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),p=new Sn(e.mapping.maps[u],f,t),h;(h=c&&c.merge(p))&&(p=h,u?o.pop():s=s.slice(0,s.length-1)),o.push(p),t&&(a++,t=void 0),i||(c=p)}let d=a-r.depth;return d>ED&&(s=OD(s,d),a-=d),new rn(s.append(o),a)}remapping(e,t){let r=new Zr;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new rn(this.items.append(e.map(t=>new Sn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach(p=>{p.selection&&s--},i);let c=t;this.items.forEach(p=>{let h=o.getMirror(--c);if(h==null)return;a=Math.min(a,h);let m=o.maps[h];if(p.step){let v=e.steps[h].invert(e.docs[h]),w=p.selection&&p.selection.map(o.slice(c+1,h));w&&s++,r.push(new Sn(m,v,w))}else r.push(new Sn(m))},i);let d=[];for(let p=t;p<a;p++)d.push(new Sn(o.maps[p]));let u=this.items.slice(0,i).append(d).append(r),f=new rn(u,s);return f.emptyItemCount()>AD&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=e)i.push(a),a.selection&&o++;else if(a.step){let c=a.step.map(t.slice(r)),d=c&&c.getMap();if(r--,d&&t.appendMap(d,r),c){let u=a.selection&&a.selection.map(t.slice(r));u&&o++;let f=new Sn(d.invert(),c,u),p,h=i.length-1;(p=i.length&&i[h].merge(f))?i[h]=p:i.push(f)}}else a.map&&r--},this.items.length,0),new rn(it.from(i.reverse()),o)}}rn.empty=new rn(it.empty,0);function OD(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class Sn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Sn(t.getMap().invert(),t,this.selection)}}}class sr{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const ED=20;function ND(n,e,t,r){let i=t.getMeta(lr),o;if(i)return i.historyState;t.getMeta(BD)&&(n=new sr(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(lr))return a.getMeta(lr).redo?new sr(n.done.addTransform(t,void 0,r,Oa(e)),n.undone,jh(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new sr(n.done,n.undone.addTransform(t,void 0,r,Oa(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=t.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=s&&(n.prevTime<(t.time||0)-r.newGroupDelay||!_D(t,n.prevRanges)),d=a?uc(n.prevRanges,t.mapping):jh(t.mapping.maps[t.steps.length-1]);return new sr(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Oa(e)),rn.empty,d,t.time,s??n.prevComposition)}else return(o=t.getMeta("rebased"))?new sr(n.done.rebased(t,o),n.undone.rebased(t,o),uc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new sr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),uc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function _D(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function jh(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function uc(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function Uh(n,e,t,r){let i=Oa(e),o=lr.get(e).spec.config,a=(r?n.undone:n.done).popEvent(e,i);if(!a)return;let s=a.selection.resolve(a.transform.doc),c=(r?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),d=new sr(r?c:a.remaining,r?a.remaining:c,null,0,-1);t(a.transform.setSelection(s).setMeta(lr,{redo:r,historyState:d}).scrollIntoView())}let fc=!1,Wh=null;function Oa(n){let e=n.plugins;if(Wh!=e){fc=!1,Wh=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){fc=!0;break}}return fc}const lr=new vn("history"),BD=new vn("closeHistory");function PD(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Mt({key:lr,state:{init(){return new sr(rn.empty,rn.empty,null,0,-1)},apply(e,t,r){return ND(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?qh:r=="historyRedo"?Kh:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const qh=(n,e)=>{let t=lr.getState(n);return!t||t.done.eventCount==0?!1:(e&&Uh(t,n,e,!1),!0)},Kh=(n,e)=>{let t=lr.getState(n);return!t||t.undone.eventCount==0?!1:(e&&Uh(t,n,e,!0),!0)},ID=ht.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>qh(n,e),redo:()=>({state:n,dispatch:e})=>Kh(n,e)}},addProseMirrorPlugins(){return[PD(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),RD=_t.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Ge(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var a;if(o){const{$to:s}=i.selection,c=s.end();if(s.nodeAfter)s.nodeAfter.isTextblock?i.setSelection(ge.create(i.doc,s.pos+1)):s.nodeAfter.isBlock?i.setSelection(ue.create(i.doc,s.pos)):i.setSelection(ge.create(i.doc,s.pos));else{const d=(a=s.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(i.insert(c,d),i.setSelection(ge.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[pS({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),VD=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,$D=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,LD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,FD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,zD=nn.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[_r({find:VD,type:this.type}),_r({find:LD,type:this.type})]},addPasteRules(){return[Br({find:$D,type:this.type}),Br({find:FD,type:this.type})]}}),HD=_t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ge(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),YD=_t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ge(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Gh=nn.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=ba(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Qh=/^(\d+)\.\s$/,jD=_t.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Ge(this.options.HTMLAttributes,t),0]:["ol",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(YD.name,this.editor.getAttributes(Gh.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=co({find:Qh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=co({find:Qh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Gh.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),UD=_t.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),WD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,qD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,KD=nn.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return zl()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[_r({find:WD,type:this.type})]},addPasteRules(){return[Br({find:qD,type:this.type})]}}),GD=_t.create({name:"text",group:"inline"}),QD=ht.create({name:"starterKit",addExtensions(){var n,e,t,r,i,o,a,s,c,d,u,f,p,h,m,v,w,x;const C=[];return this.options.blockquote!==!1&&C.push(ZT.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&C.push(iD.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&C.push(aD.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&C.push(cD.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&C.push(fD.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&C.push(pD.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&C.push(gD.configure((a=this.options)===null||a===void 0?void 0:a.dropcursor)),this.options.gapcursor!==!1&&C.push(MD.configure((s=this.options)===null||s===void 0?void 0:s.gapcursor)),this.options.hardBreak!==!1&&C.push(SD.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&C.push(TD.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&C.push(ID.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&C.push(RD.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&C.push(zD.configure((p=this.options)===null||p===void 0?void 0:p.italic)),this.options.listItem!==!1&&C.push(HD.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&C.push(jD.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&C.push(UD.configure((v=this.options)===null||v===void 0?void 0:v.paragraph)),this.options.strike!==!1&&C.push(KD.configure((w=this.options)===null||w===void 0?void 0:w.strike)),this.options.text!==!1&&C.push(GD.configure((x=this.options)===null||x===void 0?void 0:x.text)),C}}),JD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,XD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,ZD=nn.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[_r({find:JD,type:this.type})]},addPasteRules(){return[Br({find:XD,type:this.type})]}}),eA=ht.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${n.textAlign}`}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.every(t=>e.updateAttributes(t,{textAlign:n})):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.every(e=>n.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),tA={components:{EditorContent:QT,BaseButton:Rn},props:{invalid:{type:Boolean,default:!1}},data(){return{}},setup(n,{emit:e}){const t=l.ref("");return{editor:JT({content:"",extensions:[QD,ZD,eA.configure({types:["heading","paragraph"]})],editorProps:{attributes:{class:"focus:outline-none"}},onUpdate({editor:i}){t.value=i.getHTML(),e("update:editorContent",t.value)}}),editorContent:t}},methods:{}},nA={"data-testid":"editor-buttons",class:"w-full flex flex-row pl-2"},rA={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-between pr-2"},iA={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-around"},oA={class:"w-1/3 flex flex-row justify-between pl-2"},aA={class:"my-4 my-2 p-4 rounded-xl h-40 bg-tertiary overflow-auto"};function sA(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton"),s=l.resolveComponent("editor-content");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border rounded-lg text-secondary text-sm p-4 w-full",t.invalid?"border-alarm":"border-dropdownSelect"])},[l.createElementVNode("div",nA,[l.createElementVNode("div",rA,[l.createVNode(a,{iconName:"fa-h1",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:1}),onClick:e[0]||(e[0]=c=>r.editor.chain().toggleHeading({level:1}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h2",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:2}),onClick:e[1]||(e[1]=c=>r.editor.chain().toggleHeading({level:2}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h3",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:3}),onClick:e[2]||(e[2]=c=>r.editor.chain().toggleHeading({level:3}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-paragraph",label:"",type:"editor",selected:r.editor&&r.editor.isActive("paragraph"),onClick:e[3]||(e[3]=c=>r.editor.chain().setParagraph().run())},null,8,["selected"])]),l.createElementVNode("div",iA,[l.createVNode(a,{selected:r.editor&&r.editor.isActive("bold"),iconName:"fa-bold",label:"",type:"editor",onClick:e[4]||(e[4]=c=>r.editor&&r.editor.chain().toggleBold().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("italic"),iconName:"fa-italic",label:"",type:"editor",onClick:e[5]||(e[5]=c=>r.editor&&r.editor.chain().toggleItalic().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("strike"),iconName:"fa-strikethrough",label:"",type:"editor",onClick:e[6]||(e[6]=c=>r.editor&&r.editor.chain().toggleStrike().run())},null,8,["selected"])]),l.createElementVNode("div",oA,[l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"left"}),iconName:"fa-align-left",label:"",type:"editor",onClick:e[7]||(e[7]=c=>r.editor.chain().setTextAlign("left").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"center"}),iconName:"fa-align-center",label:"",type:"editor",onClick:e[8]||(e[8]=c=>r.editor&&r.editor.chain().setTextAlign("center").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"right"}),iconName:"fa-align-right",label:"",type:"editor",onClick:e[9]||(e[9]=c=>r.editor&&r.editor.chain().setTextAlign("right").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"justify"}),iconName:"fa-align-justify",label:"",type:"editor",onClick:e[10]||(e[10]=c=>r.editor&&r.editor.chain().setTextAlign("justify").run())},null,8,["selected"])])]),l.createElementVNode("p",aA,[l.createVNode(s,{editor:r.editor,class:"focus:shadow-none focus:outline-none"},null,8,["editor"])])],2)}const Jh=Le(tA,[["render",sA]]),lA={name:"AddTournamentPageOne",components:{BaseText:sn,BaseInput:Mi,ImageCropper:Tu,AddressAutocomplete:Tc,DatePicker:Ts,TextBoxEditor:Jh,BaseRadioGroup:vc,BaseButton:Rn},props:{},data(){return{tournament:{name:"",imageLink:"",address:"",coordinates:"",startDate:"",totalDays:1,description:"",visibility:"",externalLinks:Array},validation:{name:!1,imageLink:!1,address:!1,coordinates:!1,startDate:!1,totalDays:!1,description:!1,visibility:!1},visibilityItems:[{label:"Open",value:"open",description:"Viewable To Everyone"},{label:"Club",value:"club",description:"Viewable Only to Members of Your Club"},{label:"Private",value:"private",description:"Only Viewable by you"}]}},methods:{handleSubmit(){this.setAllValidationStates(!1),this.tournament.name===""&&(this.validation.name=!0),this.tournament.coordinates===""&&(this.validation.address=!0),this.tournament.startDate===""&&(this.validation.startDate=!0),this.tournament.totalDays===""&&(this.validation.totalDays=!0),this.tournament.description===""&&(this.validation.description=!0),this.tournament.visibility===""&&(this.validation.visibility=!0),this.areAnyFieldsAreLeftInvalid||(this.$emit("update:tournament",this.tournament),this.$emit("update:step",2))},setAllValidationStates(n){Object.keys(this.validation).forEach(e=>{this.validation[e]=n})},handleAddressUpdate(n){this.tournament.address=n.address,this.tournament.coordinates=n.coordinates},handleDateUpdate(n){this.tournament.startDate=n,console.log("New Date"),console.log(n),console.log(Ts.props.invalid)},handleEditorUpdate(n){this.tournament.description=n}},computed:{areAnyFieldsAreLeftInvalid(){return Object.values(this.validation).every(n=>n)}}},cA={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},dA={class:"w-full flex flex-row justify-center"},uA={class:"w-full flex flex-row justify-center my-4"},fA={class:"w-full flex flex-row justify-center my-4"},pA={class:"w-full flex flex-row justify-center"},hA={class:"w-96"},mA={class:"flex flex-col mb-3"},gA={class:"flex flex-col mb-3"},yA={class:"flex flex-row mb-3"},vA={class:"w-3/4 mr-1"},bA={class:"w-1/4 ml-1"},wA={class:"flex flex-col mb-3"},kA={class:"flex flex-col pb-4"};function xA(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("ImageCropper"),c=l.resolveComponent("BaseInput"),d=l.resolveComponent("AddressAutocomplete"),u=l.resolveComponent("DatePicker"),f=l.resolveComponent("TextBoxEditor"),p=l.resolveComponent("BaseRadioGroup"),h=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",cA,[l.createElementVNode("div",dA,[l.createVNode(a,{color:"quaternary",size:"sm",text:"Step 1 out of 2",weight:"normal","data-testid":"text-step"})]),l.createElementVNode("div",uA,[l.createVNode(a,{color:"primaryHighlight",size:"2xl",text:"Add Tournament",weight:"normal","data-testid":"text-add-tournament"})]),l.createElementVNode("div",fA,[l.createVNode(s,{personID:1})]),l.createElementVNode("div",pA,[l.createElementVNode("section",hA,[l.createElementVNode("div",mA,[l.createVNode(a,{invalid:i.validation.name,size:"sm",text:"Tournament Name",weight:"normal",class:"mb-1",color:"primary","data-testid":"text-tournament-name"},null,8,["invalid"]),l.createVNode(c,{addBorder:!0,invalid:i.validation.name,value:i.tournament.name,placeholder:"Enter Tournament Name",type:"formInput","onUpdate:value":e[0]||(e[0]=m=>i.tournament.name=m)},null,8,["invalid","value"])]),l.createElementVNode("div",gA,[l.createVNode(a,{color:"primaryHighlight",invalid:i.validation.address,size:"sm",text:"Address",weight:"normal",class:"mb-1","data-testid":"text-address"},null,8,["invalid"]),l.createVNode(d,{address:i.tournament.address,invalid:i.validation.address,"onUpdate:address":o.handleAddressUpdate},null,8,["address","invalid","onUpdate:address"])]),l.createElementVNode("div",yA,[l.createElementVNode("div",vA,[l.createVNode(a,{color:"primaryHighlight",invalid:i.validation.startDate,size:"sm",text:"Start Date",weight:"normal",class:"mb-1","data-testid":"text-start-date"},null,8,["invalid"]),l.createVNode(u,{invalid:i.validation.startDate,setDate:i.tournament.startDate,"onUpdate:selectedDate":o.handleDateUpdate},null,8,["invalid","setDate","onUpdate:selectedDate"])]),l.createElementVNode("div",bA,[l.createVNode(a,{color:"primaryHighlight",invalid:i.validation.totalDays,size:"sm",text:"Total Days",weight:"normal",class:"mb-1","data-testid":"text-total-days"},null,8,["invalid"]),l.createVNode(c,{addBorder:!0,invalid:i.validation.totalDays,placeholder:"1",value:`${i.tournament.totalDays}`},null,8,["invalid","value"])])]),l.createElementVNode("div",wA,[l.createVNode(a,{color:"primaryHighlight",invalid:i.validation.description,size:"sm",text:"Description",weight:"normal",class:"mb-1","data-testid":"text-description"},null,8,["invalid"]),l.createVNode(f,{invalid:i.validation.description,"onUpdate:editorContent":o.handleEditorUpdate},null,8,["invalid","onUpdate:editorContent"])]),l.createElementVNode("div",kA,[l.createVNode(a,{color:"primaryHighlight",invalid:i.validation.visibility,size:"sm",text:"Tournament Visibility",weight:"normal",class:"mb-2","data-testid":"text-visibility"},null,8,["invalid"]),l.createVNode(p,{invalid:i.validation.visibility,items:i.visibilityItems,"onUpdate:value":e[1]||(e[1]=m=>i.tournament.visibility=m)},null,8,["invalid","items"])]),l.createElementVNode("div",null,[l.createVNode(h,{class:"w-full",color:"neutral",label:"Continue",size:"sm",type:"secondary",onClick:e[2]||(e[2]=m=>o.handleSubmit())})])])])])}const CA=Le(lA,[["render",xA]]),MA={name:"AddTournamentPageTwo",components:{BaseIcon:Ci,BaseText:sn,BaseButton:Rn,BaseInput:Mi},props:{tournament:Object},data(){return{ferrotasToHost:!1,linkInputVisible:!1,localTournament:JSON.parse(JSON.stringify(this.tournament))}},created(){Array.isArray(this.localTournament.externalLinks)||(this.localTournament.externalLinks=[]),this.localTournament.externalLinks.length===0&&this.localTournament.externalLinks.push({url:"",valid:!0})},methods:{updateLink(n,e){const t=e.target.value;this.localTournament.externalLinks[n].url=t,this.localTournament.externalLinks[n].valid=this.isValidUrl(t)},handleHosting(){this.ferrotasToHost=!this.ferrotasToHost},toggleLinkInput(){this.linkInputVisible=!this.linkInputVisible},addExternalLink(){this.localTournament.externalLinks.push({url:"",valid:!0})},removeLink(n){this.localTournament.externalLinks=this.localTournament.externalLinks.filter(e=>e.url!==n)},handleSubmit(){console.log("submitting ferrotas hosting"),this.areAllLinksValid()&&(console.log(this.localTournament),this.$emit("submit",this.localTournament))},isValidUrl(n){return/^(https?:\/\/)?([\da-z.-]+)\.([\da-z.]+)\.([\/\w\W]+)\/?$/.test(n)},areAllLinksValid(){return this.localTournament.externalLinks.forEach(n=>n.valid=this.isValidUrl(n.url)),this.localTournament.externalLinks.every(n=>n.valid)}}},SA={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},TA={class:"w-full flex flex-row justify-center"},DA={class:"w-full flex flex-row justify-center"},AA={class:"w-96"},OA={class:"w-full flex flex-row justify-center text-center my-4"},EA={class:"w-full flex flex-col mb-3"},NA=l.createElementVNode("br",null,null,-1),_A=l.createElementVNode("br",null,null,-1),BA={class:"flex flex-row justify-center"},PA={key:0,class:"flex flex-col mb-3"};function IA(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseButton"),c=l.resolveComponent("BaseInput"),d=l.resolveComponent("BaseIcon");return l.openBlock(),l.createElementBlock("div",SA,[l.createElementVNode("div",TA,[l.createVNode(a,{color:"quaternary",size:"sm",text:"Step 2 out of 4",weight:"normal","data-testid":"text-step"})]),l.createElementVNode("div",DA,[l.createElementVNode("section",AA,[l.createElementVNode("div",OA,[l.createVNode(a,{color:"primaryHighlight",size:"2xl",text:"Do you want Ferrotas to host your tournament?",weight:"normal","data-testid":"text-ferrotas-to-host"})]),l.createElementVNode("div",EA,[l.createVNode(a,{color:"quaternary",size:"sm",text:"If you select 'No', your tournament will be featured on our main calendar. This will include a direct link to your tournament's webpage, making it easy for participants to find all the relevant information on your own site.",weight:"normal","data-testid":"text-select-no"},null,8,["text"]),NA,l.createVNode(a,{color:"quaternary",size:"sm",text:"By selecting 'Yes', you'll gain access to our comprehensive Ferrotas platform. This allows you to manage and conduct your tournament directly through our system, offering a seamless and integrated experience.",weight:"normal","data-testid":"text-select-yes"},null,8,["text"]),_A,l.createVNode(a,{color:"quaternary",size:"sm",text:"Need Assistance? Our support team is always ready to help. Contact us for any queries or guidance you need.",weight:"normal","data-testid":"text-need-help"},null,8,["text"])]),l.createElementVNode("div",BA,[l.createVNode(s,{class:"w-1/2 mr-1",color:"neutral",label:"Yes",selected:"selected",size:"sm",type:"square",onClick:e[0]||(e[0]=u=>o.handleHosting())}),l.createVNode(s,{class:"w-1/2 ml-1",color:"neutral",label:"No",size:"sm",type:"square",onClick:e[1]||(e[1]=u=>o.toggleLinkInput())})]),i.linkInputVisible?(l.openBlock(),l.createElementBlock("section",PA,[l.createVNode(a,{color:"quaternary",size:"sm",text:"Add links to external sites such as Facebook events",weight:"normal",class:"mb-1","data-testid":"text-need-help"}),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.localTournament.externalLinks,(u,f)=>(l.openBlock(),l.createElementBlock("div",{key:f,class:"flex flex-row w-full"},[l.createVNode(c,{addBorder:!0,invalid:!u.valid,value:u.url,class:"pb-2 w-full","icon-name":"fa-dash",placeholder:"https://link1.com/yourevent",onInput:p=>o.updateLink(f,p)},null,8,["invalid","value","onInput"]),l.createVNode(d,{class:"mt-1.5 -ml-7 hover:text-primaryHighlight",color:"primary","data-testid":"base-icon","icon-name":"fa-circle-xmark",iconStyle:"fa-solid",size:"xl",onClick:p=>o.removeLink(u.url)},null,8,["onClick"])]))),128)),l.createVNode(s,{class:"w-full mt-3",color:"neutral",label:"Add New Link",size:"sm",type:"primary",onClick:e[2]||(e[2]=u=>o.addExternalLink())})])):l.createCommentVNode("",!0),l.createElementVNode("div",null,[l.createVNode(s,{color:"neutral",label:"Continue",size:"sm",type:"secondary",onClick:e[3]||(e[3]=u=>o.handleSubmit())})])])])])}const RA=Le(MA,[["render",IA]]),VA={name:"AdminLeftMenu",components:{BaseButton:Rn},props:{buttons:{type:Array,default:()=>[]}},methods:{handleButtonClick(n){this.$emit("button-click",n)}}},$A={class:"bg-secondary w-64 h-screen flex flex-col justify-between"},LA=l.createElementVNode("section",{class:"h-28 border-b border-neutral"},[l.createElementVNode("div",{class:"flex flex-col justify-center h-28"},[l.createElementVNode("div",{class:"ml-8"},[l.createElementVNode("img",{class:"w-32",src:"https://ferrotas.com/assets/ferrotas-white-small-720502db.png",alt:"logo"})])])],-1),FA={class:"flex flex-col p-2 h-full"},zA={class:"flex flex-col justify-end p-2 flex-grow"},HA={class:"border-t border-neutral pt-2"};function YA(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",$A,[LA,l.createElementVNode("section",FA,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.buttons,s=>(l.openBlock(),l.createBlock(a,{label:s.label,iconClass:"fa-solid fa-trophy text-white",type:"admin",hover:"admin",onClick:c=>o.handleButtonClick(s)},null,8,["label","onClick"]))),256))]),l.createElementVNode("section",zA,[l.createElementVNode("div",HA,[l.createVNode(a,{iconClass:"fa-solid fa-circle-user text-textSecondary",label:"Account",type:"adminSecondary",onClick:e[0]||(e[0]=s=>o.handleButtonClick(n.button))}),l.createVNode(a,{iconClass:"fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",label:"Log Out",type:"adminSecondary",onClick:e[1]||(e[1]=s=>o.handleButtonClick(n.button))})])])])}const jA=Le(VA,[["render",YA]]);_e.AddTournamentPageOne=CA,_e.AddTournamentPageTwo=RA,_e.AddressAutocomplete=Tc,_e.AdminLeftMenu=jA,_e.BaseButton=Rn,_e.BaseIcon=Ci,_e.BaseInput=Mi,_e.BaseModal=Jm,_e.BaseRadioGroup=vc,_e.BaseTag=bc,_e.BaseText=sn,_e.Breadcrumb=ym,_e.DatePicker=Ts,_e.DropDownMenu=_a,_e.FilterAndSortBar=Cc,_e.FilterUpcomingPast=Mc,_e.GridContainer=bw,_e.ImageCropper=Tu,_e.TextBoxEditor=Jh,_e.TournamentCard=Hd,_e.TournamentCardDetail=wc,_e.TournamentCardHeader=xc,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
|
|
181
|
+
`);return!o||!a?!1:n.chain().command(({tr:s})=>(s.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();return s===void 0||r.nodeAt(s)?!1:n.commands.exitCode()}}},addInputRules(){return[Gl({find:iD,type:this.type,getAttributes:n=>({language:n[1]})}),Gl({find:oD,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new Mt({key:new bn("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!t||!o)return!1;const{tr:a}=n.state;return a.replaceSelectionWith(this.type.create({language:o})),a.setSelection(ye.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.insertText(t.replace(/\r\n?/g,`
|
|
182
|
+
`)),a.setMeta("paste",!0),n.dispatch(a),!0}}})]}}),sD=_t.create({name:"doc",topNode:!0,content:"block+"});function lD(n={}){return new Mt({view(e){return new cD(e,n)}})}class cD{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=a=>{this[i](a)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r;if(t){let s=e.nodeBefore,c=e.nodeAfter;if(s||c){let d=this.editorView.nodeDOM(this.cursorPos-(s?s.nodeSize:0));if(d){let u=d.getBoundingClientRect(),p=s?u.bottom:u.top;s&&c&&(p=(p+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:p-this.width/2,bottom:p+this.width/2}}}}if(!r){let s=this.editorView.coordsAtPos(this.cursorPos);r={left:s.left-this.width/2,right:s.left+this.width/2,top:s.top,bottom:s.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let o,a;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,a=-pageYOffset;else{let s=i.getBoundingClientRect();o=s.left-i.scrollLeft,a=s.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-a+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let s=ip(this.editorView.state.doc,a,this.editorView.dragging.slice);s!=null&&(a=s)}this.setCursor(a),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const dD=mt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[lD(this.options)]}});class Ye extends ve{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return Ye.valid(r)?new Ye(r):ve.near(r)}content(){return oe.empty}eq(e){return e instanceof Ye&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ye(e.resolve(t.pos))}getBookmark(){return new fc(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!uD(e)||!pD(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&Ye.valid(e))return e;let i=e.pos,o=null;for(let a=e.depth;;a--){let s=e.node(a);if(t>0?e.indexAfter(a)<s.childCount:e.index(a)>0){o=s.child(t>0?e.indexAfter(a):e.index(a)-1);break}else if(a==0)return null;i+=t;let c=e.doc.resolve(i);if(Ye.valid(c))return c}for(;;){let a=t>0?o.firstChild:o.lastChild;if(!a){if(o.isAtom&&!o.isText&&!pe.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=a,i+=t;let s=e.doc.resolve(i);if(Ye.valid(s))return s}return null}}}Ye.prototype.visible=!1,Ye.findFrom=Ye.findGapCursorFrom,ve.jsonID("gapcursor",Ye);class fc{constructor(e){this.pos=e}map(e){return new fc(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Ye.valid(t)?new Ye(t):ve.near(t)}}function uD(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function pD(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function fD(){return new Mt({props:{decorations:yD,createSelectionBetween(n,e,t){return e.pos==t.pos&&Ye.valid(t)?new Ye(t):null},handleClick:mD,handleKeyDown:hD,handleDOMEvents:{beforeinput:gD}}})}const hD=Nf({ArrowLeft:Da("horiz",-1),ArrowRight:Da("horiz",1),ArrowUp:Da("vert",-1),ArrowDown:Da("vert",1)});function Da(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let a=r.selection,s=e>0?a.$to:a.$from,c=a.empty;if(a instanceof ye){if(!o.endOfTextblock(t)||s.depth==0)return!1;c=!1,s=r.doc.resolve(e>0?s.after():s.before())}let d=Ye.findGapCursorFrom(s,e,c);return d?(i&&i(r.tr.setSelection(new Ye(d))),!0):!1}}function mD(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!Ye.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&pe.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new Ye(r))),!0)}function gD(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof Ye))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=J.empty;for(let a=r.length-1;a>=0;a--)i=J.from(r[a].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new oe(i,0,0));return o.setSelection(ye.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function yD(n){if(!(n.selection instanceof Ye))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Qe.create(n.doc,[Yt.widget(n.selection.head,e,{key:"gapcursor"})])}const vD=mt.create({name:"gapCursor",addProseMirrorPlugins(){return[fD()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=be(de(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),bD=_t.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",Ge(this.options.HTMLAttributes,n)]},renderText(){return`
|
|
183
|
+
`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:a}=this.options,{splittableMarks:s}=r.extensionManager,c=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&a){const p=c.filter(f=>s.includes(f.type.name));d.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),wD=_t.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Ge(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>Gl({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Aa=200,rt=function(){};rt.prototype.append=function(e){return e.length?(e=rt.from(e),!this.length&&e||e.length<Aa&&this.leafAppend(e)||this.length<Aa&&e.leafPrepend(this)||this.appendInner(e)):this},rt.prototype.prepend=function(e){return e.length?rt.from(e).append(this):this},rt.prototype.appendInner=function(e){return new kD(this,e)},rt.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?rt.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},rt.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},rt.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},rt.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,a){return i.push(e(o,a))},t,r),i},rt.from=function(e){return e instanceof rt?e:e&&e.length?new Yh(e):rt.empty};var Yh=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,a,s){for(var c=o;c<a;c++)if(i(this.values[c],s+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,o,a,s){for(var c=o-1;c>=a;c--)if(i(this.values[c],s+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Aa)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Aa)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(rt);rt.empty=new Yh([]);var kD=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,a){var s=this.left.length;if(i<s&&this.left.forEachInner(r,i,Math.min(o,s),a)===!1||o>s&&this.right.forEachInner(r,Math.max(i-s,0),Math.min(this.length,o)-s,a+s)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,a){var s=this.left.length;if(i>s&&this.right.forEachInvertedInner(r,i-s,Math.max(o,s)-s,a+s)===!1||o<s&&this.left.forEachInvertedInner(r,Math.min(i,s),o,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(rt);const xD=500;class an{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let a=e.tr,s,c,d=[],u=[];return this.items.forEach((p,f)=>{if(!p.step){i||(i=this.remapping(r,f+1),o=i.maps.length),o--,u.push(p);return}if(i){u.push(new Sn(p.map));let h=p.step.map(i.slice(o)),m;h&&a.maybeStep(h).doc&&(m=a.mapping.maps[a.mapping.maps.length-1],d.push(new Sn(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else a.maybeStep(p.step);if(p.selection)return s=i?p.selection.map(i.slice(o)):p.selection,c=new an(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:s}}addTransform(e,t,r,i){let o=[],a=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let u=0;u<e.steps.length;u++){let p=e.steps[u].invert(e.docs[u]),f=new Sn(e.mapping.maps[u],p,t),h;(h=c&&c.merge(f))&&(f=h,u?o.pop():s=s.slice(0,s.length-1)),o.push(f),t&&(a++,t=void 0),i||(c=f)}let d=a-r.depth;return d>TD&&(s=CD(s,d),a-=d),new an(s.append(o),a)}remapping(e,t){let r=new ni;return this.items.forEach((i,o)=>{let a=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new an(this.items.append(e.map(t=>new Sn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,a=e.steps.length,s=this.eventCount;this.items.forEach(f=>{f.selection&&s--},i);let c=t;this.items.forEach(f=>{let h=o.getMirror(--c);if(h==null)return;a=Math.min(a,h);let m=o.maps[h];if(f.step){let y=e.steps[h].invert(e.docs[h]),w=f.selection&&f.selection.map(o.slice(c+1,h));w&&s++,r.push(new Sn(m,y,w))}else r.push(new Sn(m))},i);let d=[];for(let f=t;f<a;f++)d.push(new Sn(o.maps[f]));let u=this.items.slice(0,i).append(d).append(r),p=new an(u,s);return p.emptyItemCount()>xD&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((a,s)=>{if(s>=e)i.push(a),a.selection&&o++;else if(a.step){let c=a.step.map(t.slice(r)),d=c&&c.getMap();if(r--,d&&t.appendMap(d,r),c){let u=a.selection&&a.selection.map(t.slice(r));u&&o++;let p=new Sn(d.invert(),c,u),f,h=i.length-1;(f=i.length&&i[h].merge(p))?i[h]=f:i.push(p)}}else a.map&&r--},this.items.length,0),new an(rt.from(i.reverse()),o)}}an.empty=new an(rt.empty,0);function CD(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class Sn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Sn(t.getMap().invert(),t,this.selection)}}}class lr{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const TD=20;function MD(n,e,t,r){let i=t.getMeta(cr),o;if(i)return i.historyState;t.getMeta(DD)&&(n=new lr(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(cr))return a.getMeta(cr).redo?new lr(n.done.addTransform(t,void 0,r,Ea(e)),n.undone,jh(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new lr(n.done,n.undone.addTransform(t,void 0,r,Ea(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let s=t.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=s&&(n.prevTime<(t.time||0)-r.newGroupDelay||!SD(t,n.prevRanges)),d=a?hc(n.prevRanges,t.mapping):jh(t.mapping.maps[t.steps.length-1]);return new lr(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Ea(e)),an.empty,d,t.time,s??n.prevComposition)}else return(o=t.getMeta("rebased"))?new lr(n.done.rebased(t,o),n.undone.rebased(t,o),hc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new lr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),hc(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function SD(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(t=!0)}),t}function jh(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function hc(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}function Uh(n,e,t,r){let i=Ea(e),o=cr.get(e).spec.config,a=(r?n.undone:n.done).popEvent(e,i);if(!a)return;let s=a.selection.resolve(a.transform.doc),c=(r?n.done:n.undone).addTransform(a.transform,e.selection.getBookmark(),o,i),d=new lr(r?c:a.remaining,r?a.remaining:c,null,0,-1);t(a.transform.setSelection(s).setMeta(cr,{redo:r,historyState:d}).scrollIntoView())}let mc=!1,Wh=null;function Ea(n){let e=n.plugins;if(Wh!=e){mc=!1,Wh=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){mc=!0;break}}return mc}const cr=new bn("history"),DD=new bn("closeHistory");function AD(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new Mt({key:cr,state:{init(){return new lr(an.empty,an.empty,null,0,-1)},apply(e,t,r){return MD(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?qh:r=="historyRedo"?Kh:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}const qh=(n,e)=>{let t=cr.getState(n);return!t||t.done.eventCount==0?!1:(e&&Uh(t,n,e,!1),!0)},Kh=(n,e)=>{let t=cr.getState(n);return!t||t.undone.eventCount==0?!1:(e&&Uh(t,n,e,!0),!0)},ED=mt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>qh(n,e),redo:()=>({state:n,dispatch:e})=>Kh(n,e)}},addProseMirrorPlugins(){return[AD(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ND=_t.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",Ge(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var a;if(o){const{$to:s}=i.selection,c=s.end();if(s.nodeAfter)s.nodeAfter.isTextblock?i.setSelection(ye.create(i.doc,s.pos+1)):s.nodeAfter.isBlock?i.setSelection(pe.create(i.doc,s.pos)):i.setSelection(ye.create(i.doc,s.pos));else{const d=(a=s.parent.type.contentMatch.defaultType)===null||a===void 0?void 0:a.create();d&&(i.insert(c,d),i.setSelection(ye.create(i.doc,c+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[sM({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),OD=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,_D=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,BD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,PD=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,ID=on.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Pr({find:OD,type:this.type}),Pr({find:BD,type:this.type})]},addPasteRules(){return[Ir({find:_D,type:this.type}),Ir({find:PD,type:this.type})]}}),RD=_t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ge(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),VD=_t.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Ge(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Gh=on.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=ba(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Jh=/^(\d+)\.\s$/,LD=_t.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",Ge(this.options.HTMLAttributes,t),0]:["ol",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(VD.name,this.editor.getAttributes(Gh.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=co({find:Jh,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=co({find:Jh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Gh.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),$D=_t.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),FD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,zD=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,HD=on.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return jl()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[Pr({find:FD,type:this.type})]},addPasteRules(){return[Ir({find:zD,type:this.type})]}}),YD=_t.create({name:"text",group:"inline"}),jD=mt.create({name:"starterKit",addExtensions(){var n,e,t,r,i,o,a,s,c,d,u,p,f,h,m,y,w,x;const C=[];return this.options.blockquote!==!1&&C.push(qS.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&C.push(XS.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&C.push(eD.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&C.push(rD.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&C.push(aD.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&C.push(sD.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&C.push(dD.configure((a=this.options)===null||a===void 0?void 0:a.dropcursor)),this.options.gapcursor!==!1&&C.push(vD.configure((s=this.options)===null||s===void 0?void 0:s.gapcursor)),this.options.hardBreak!==!1&&C.push(bD.configure((c=this.options)===null||c===void 0?void 0:c.hardBreak)),this.options.heading!==!1&&C.push(wD.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&C.push(ED.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&C.push(ND.configure((p=this.options)===null||p===void 0?void 0:p.horizontalRule)),this.options.italic!==!1&&C.push(ID.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&C.push(RD.configure((h=this.options)===null||h===void 0?void 0:h.listItem)),this.options.orderedList!==!1&&C.push(LD.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&C.push($D.configure((y=this.options)===null||y===void 0?void 0:y.paragraph)),this.options.strike!==!1&&C.push(HD.configure((w=this.options)===null||w===void 0?void 0:w.strike)),this.options.text!==!1&&C.push(YD.configure((x=this.options)===null||x===void 0?void 0:x.text)),C}}),UD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,WD=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,qD=on.create({name:"highlight",addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:n=>n.getAttribute("data-color")||n.style.backgroundColor,renderHTML:n=>n.color?{"data-color":n.color,style:`background-color: ${n.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:"mark"}]},renderHTML({HTMLAttributes:n}){return["mark",Ge(this.options.HTMLAttributes,n),0]},addCommands(){return{setHighlight:n=>({commands:e})=>e.setMark(this.name,n),toggleHighlight:n=>({commands:e})=>e.toggleMark(this.name,n),unsetHighlight:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[Pr({find:UD,type:this.type})]},addPasteRules(){return[Ir({find:WD,type:this.type})]}}),KD=mt.create({name:"textAlign",addOptions(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:n=>n.style.textAlign||this.options.defaultAlignment,renderHTML:n=>n.textAlign===this.options.defaultAlignment?{}:{style:`text-align: ${n.textAlign}`}}}}]},addCommands(){return{setTextAlign:n=>({commands:e})=>this.options.alignments.includes(n)?this.options.types.every(t=>e.updateAttributes(t,{textAlign:n})):!1,unsetTextAlign:()=>({commands:n})=>this.options.types.every(e=>n.resetAttributes(e,"textAlign"))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),GD={components:{EditorContent:jS,BaseButton:ln},props:{invalid:{type:Boolean,default:!1}},data(){return{}},setup(n,{emit:e}){const t=l.ref("");return{editor:US({content:"",extensions:[jD,qD,KD.configure({types:["heading","paragraph"]})],editorProps:{attributes:{class:"focus:outline-none"}},onUpdate({editor:i}){t.value=i.getHTML(),e("update:editorContent",t.value)}}),editorContent:t}},methods:{}},JD={"data-testid":"editor-buttons",class:"w-full flex flex-row pl-2"},QD={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-between pr-2"},XD={class:"w-1/3 border-r border-dropdownSelect flex flex-row justify-around"},ZD={class:"w-1/3 flex flex-row justify-between pl-2"},eA={class:"my-4 my-2 p-4 rounded-xl h-40 bg-tertiary overflow-auto"};function tA(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton"),s=l.resolveComponent("editor-content");return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["border rounded-lg text-secondary text-sm p-4 w-full",t.invalid?"border-alarm":"border-dropdownSelect"])},[l.createElementVNode("div",JD,[l.createElementVNode("div",QD,[l.createVNode(a,{iconName:"fa-h1",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:1}),onClick:e[0]||(e[0]=c=>r.editor.chain().toggleHeading({level:1}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h2",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:2}),onClick:e[1]||(e[1]=c=>r.editor.chain().toggleHeading({level:2}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-h3",label:"",type:"editor",selected:r.editor&&r.editor.isActive("heading",{level:3}),onClick:e[2]||(e[2]=c=>r.editor.chain().toggleHeading({level:3}).run())},null,8,["selected"]),l.createVNode(a,{iconName:"fa-paragraph",label:"",type:"editor",selected:r.editor&&r.editor.isActive("paragraph"),onClick:e[3]||(e[3]=c=>r.editor.chain().setParagraph().run())},null,8,["selected"])]),l.createElementVNode("div",XD,[l.createVNode(a,{selected:r.editor&&r.editor.isActive("bold"),iconName:"fa-bold",label:"",type:"editor",onClick:e[4]||(e[4]=c=>r.editor&&r.editor.chain().toggleBold().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("italic"),iconName:"fa-italic",label:"",type:"editor",onClick:e[5]||(e[5]=c=>r.editor&&r.editor.chain().toggleItalic().run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive("strike"),iconName:"fa-strikethrough",label:"",type:"editor",onClick:e[6]||(e[6]=c=>r.editor&&r.editor.chain().toggleStrike().run())},null,8,["selected"])]),l.createElementVNode("div",ZD,[l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"left"}),iconName:"fa-align-left",label:"",type:"editor",onClick:e[7]||(e[7]=c=>r.editor.chain().setTextAlign("left").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"center"}),iconName:"fa-align-center",label:"",type:"editor",onClick:e[8]||(e[8]=c=>r.editor&&r.editor.chain().setTextAlign("center").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"right"}),iconName:"fa-align-right",label:"",type:"editor",onClick:e[9]||(e[9]=c=>r.editor&&r.editor.chain().setTextAlign("right").run())},null,8,["selected"]),l.createVNode(a,{selected:r.editor&&r.editor.isActive({textAlign:"justify"}),iconName:"fa-align-justify",label:"",type:"editor",onClick:e[10]||(e[10]=c=>r.editor&&r.editor.chain().setTextAlign("justify").run())},null,8,["selected"])])]),l.createElementVNode("p",eA,[l.createVNode(s,{editor:r.editor,class:"focus:shadow-none focus:outline-none"},null,8,["editor"])])],2)}const Qh=Pe(GD,[["render",tA]]),nA={name:"TournamentCard",components:{TournamentHeader:Mc,TournamentDetail:Cc},props:{detail:{type:Object,required:!0,default:()=>({TournamentId:null,Name:"",StartDate:"",EndDate:"",Description:"",ClubId:null,AddressId:null,"Club.Name":"",Address:[{Name:"",Address1:"",City:"",State:"",Zip:null,Coordinates:""}],SocialMedia:[],images:[],tags:[]})}}},rA={class:"rounded-xl w-72 shadow"};function iA(n,e,t,r,i,o){const a=l.resolveComponent("TournamentHeader"),s=l.resolveComponent("TournamentDetail");return l.openBlock(),l.createElementBlock("div",rA,[l.createVNode(a,{artwork:t.detail.images&&t.detail.images.length>0?t.detail.images[0].URL:"",tags:t.detail.tags},null,8,["artwork","tags"]),l.createVNode(s,{detail:t.detail},null,8,["detail"])])}const oA=Pe(nA,[["render",iA]]),aA={name:"FindLocation",components:{BaseText:Lt,BaseModal:Ba,AddressAutocomplete:Pa,BaseButton:ln,BaseIcon:pr,BaseInput:Vn},props:{locations:{type:Array,required:!0},addBorder:{type:Boolean,default:!1},addNewText:{type:String,default:"Add New"}},data(){return{formData:{locationName:"",address:"",coordinates:""},locationName:"",validAddress:!1,showNewLocation:!1,filteredLocations:this.locations,inputValue:"",showDropdown:!1,showAddNew:!1,debouncedTimeout:null}},watch:{inputValue(n){this.showDropdown=n.length>0,this.showAddNew=n.length>0&&this.filteredLocations.length===0,this.debounceSearch()}},methods:{updateInput(n){this.inputValue=n.target.value},selectItem(n){this.showDropdown=!1,this.inputValue=n.Name,this.$emit("item-selected",n),this.$nextTick(()=>{this.showDropdown=!1})},addNewItem(){this.$emit("add-new",this.inputValue),this.showDropdown=!1},onInputChanged(n){this.showDropdown&&(this.filteredLocations=this.locations.filter(e=>e.Name.toLowerCase().includes(n.toLowerCase())))},debounceSearch(){clearTimeout(this.debouncedTimeout),this.debouncedTimeout=setTimeout(()=>{this.onInputChanged(this.inputValue)},500)},handleLocationName(n){console.log(n),this.formData.locationName=n},handleAddressUpdate(n){console.log(n),this.formData.address=n.address,this.formData.coordinates=n.coordinates},handleSubmit(n){console.log(this.locationName),console.log("Form Data:",this.formData),this.showNewLocation=!1}}},sA={key:0,class:"relative"},lA={key:0,class:"absolute z-10 w-full bg-white border border-gray-300 rounded-md mt-1"},cA=["onClick"],dA={key:1};function uA(n,e,t,r,i,o){const a=l.resolveComponent("BaseInput"),s=l.resolveComponent("base-button"),c=l.resolveComponent("AddressAutocomplete"),d=l.resolveComponent("BaseModal");return l.openBlock(),l.createElementBlock("section",null,[i.showNewLocation?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",sA,[l.createVNode(a,{addBorder:t.addBorder,value:i.inputValue,onInput:o.updateInput,placeholder:"Enter Location Name"},null,8,["addBorder","value","onInput"]),i.showDropdown?(l.openBlock(),l.createElementBlock("div",lA,[l.createElementVNode("ul",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.filteredLocations,(u,p)=>(l.openBlock(),l.createElementBlock("li",{key:p,onClick:f=>o.selectItem(u),class:"p-2 hover:bg-gray-100 cursor-pointer"},l.toDisplayString(u.Name),9,cA))),128))]),l.createElementVNode("div",{onClick:e[1]||(e[1]=(...u)=>o.addNewItem&&o.addNewItem(...u)),class:"p-2 hover:bg-gray-100 cursor-pointer"},[l.createVNode(s,{type:"secondary",label:"Add New Location",iconName:"fa-location-dot",onClick:e[0]||(e[0]=u=>i.showNewLocation=!0)})])])):l.createCommentVNode("",!0)])),i.showNewLocation?(l.openBlock(),l.createElementBlock("div",dA,[l.createVNode(d,{show:i.showNewLocation,iconName:"fa-location-plus",buttonText:"Add Location",onSubmitModal:o.handleSubmit,"onUpdate:show":e[3]||(e[3]=u=>i.showNewLocation=!1)},{"modal-content":l.withCtx(()=>[l.createVNode(a,{addBorder:!0,value:i.locationName,invalid:!1,"onUpdate:value":o.handleLocationName,class:"pb-2",placeholder:"Enter Location Name",type:"formInput"},null,8,["value","onUpdate:value"]),l.createVNode(c,{modelValue:i.formData.address,"onUpdate:modelValue":e[2]||(e[2]=u=>i.formData.address=u),invalid:i.validAddress,"onUpdate:address":o.handleAddressUpdate,class:"text-lg"},null,8,["modelValue","invalid","onUpdate:address"])]),_:1},8,["show","onSubmitModal"])])):l.createCommentVNode("",!0)])}const pA=Pe(aA,[["render",uA]]),fA={name:"FindPerson",components:{BaseModal:Ba,BaseText:Lt,BaseButton:ln,BaseInput:Vn},props:{persons:{type:Array,required:!0},addBorder:{type:Boolean,default:!1},addNewText:{type:String,default:"Add New"}},data(){return{personEmail:"",personName:"",personPronouns:"",showNewPerson:!1,filteredPersons:this.persons,inputValue:"",showDropdown:!1,debouncedTimeout:null}},watch:{inputValue(n){this.showDropdown=n.length>0,this.showAddNew=n.length>0&&this.filteredPersons.length===0,this.debounceSearch()}},methods:{updateInput(n){this.inputValue=n.target.value},selectPerson(n){this.showDropdown=!1,this.inputValue=n.Name,this.$emit("person-selected",n),this.$nextTick(()=>{this.showDropdown=!1})},addNewPerson(){this.$emit("add-new-person",this.inputValue),this.showDropdown=!1},onInputChanged(n){this.showDropdown&&(this.filteredPersons=this.persons.filter(e=>e.DisplayName.toLowerCase().includes(n.toLowerCase())))},debounceSearch(){clearTimeout(this.debouncedTimeout),this.debouncedTimeout=setTimeout(()=>{this.onInputChanged(this.inputValue)},500)},handleSubmit(){console.log("submitting person")}}},hA={key:0,class:"relative"},mA={key:0,class:"absolute z-10 w-full bg-white border border-gray-300 rounded-md mt-1"},gA=["onClick"],yA={key:1};function vA(n,e,t,r,i,o){const a=l.resolveComponent("BaseInput"),s=l.resolveComponent("base-button"),c=l.resolveComponent("BaseText"),d=l.resolveComponent("BaseModal");return l.openBlock(),l.createElementBlock("section",null,[i.showNewPerson?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",hA,[l.createVNode(a,{addBorder:t.addBorder,value:i.inputValue,onInput:o.updateInput,placeholder:"Type to search person..."},null,8,["addBorder","value","onInput"]),i.showDropdown?(l.openBlock(),l.createElementBlock("div",mA,[l.createElementVNode("ul",null,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.filteredPersons,(u,p)=>(l.openBlock(),l.createElementBlock("li",{key:p,onClick:f=>o.selectPerson(u),class:"p-2 hover:bg-gray-100 cursor-pointer"},l.toDisplayString(u.DisplayName),9,gA))),128))]),l.createElementVNode("div",{onClick:e[1]||(e[1]=(...u)=>o.addNewPerson&&o.addNewPerson(...u)),class:"p-2 hover:bg-gray-100 cursor-pointer"},[l.createVNode(s,{type:"secondary",label:"Add New Person",iconName:"fa-user-plus",onClick:e[0]||(e[0]=u=>i.showNewPerson=!0)})])])):l.createCommentVNode("",!0)])),i.showNewPerson?(l.openBlock(),l.createElementBlock("div",yA,[l.createVNode(d,{show:i.showNewPerson,iconName:"fa-user",buttonText:"Add Person",onSubmitModal:o.handleSubmit,"onUpdate:show":e[6]||(e[6]=u=>i.showNewPerson=!1)},{"modal-content":l.withCtx(()=>[l.createVNode(c,{class:"pb-2",text:"Enter Primary Contacts Information"}),l.createVNode(a,{addBorder:!0,invalid:!1,value:i.personName,class:"pb-2",placeholder:"Display Name",type:"formInput","onUpdate:value":e[2]||(e[2]=u=>i.personName=u)},null,8,["value"]),l.createVNode(a,{addBorder:!0,invalid:!1,value:i.personName,class:"pb-2",placeholder:"Legal Name",type:"formInput","onUpdate:value":e[3]||(e[3]=u=>i.personName=u)},null,8,["value"]),l.createVNode(a,{addBorder:!0,invalid:!1,value:i.personEmail,class:"pb-2",placeholder:"Email",type:"formInput","onUpdate:value":e[4]||(e[4]=u=>i.personEmail=u)},null,8,["value"]),l.createVNode(a,{addBorder:!0,invalid:!1,value:i.personPronouns,class:"pb-2",placeholder:"Pronouns",type:"formInput","onUpdate:value":e[5]||(e[5]=u=>i.personPronouns=u)},null,8,["value"])]),_:1},8,["show","onSubmitModal"])])):l.createCommentVNode("",!0)])}const bA=Pe(fA,[["render",vA]]),wA={name:"TitledInput",components:{BaseIcon:pr,BaseInput:Vn,BaseText:Lt},props:{title:{type:String,required:!0},invalid:{type:Boolean,default:!1},inputValue:{type:String,required:!0},placeholder:{type:String,default:""}},methods:{handleUpdateValue(n){this.$emit("update:value",n)}}},kA={class:"flex flex-col mb-3"};function xA(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseInput");return l.openBlock(),l.createElementBlock("div",kA,[l.createVNode(a,{invalid:t.invalid,text:t.title,class:"mb-1 ml-1",color:"primary",size:"sm",weight:"normal"},null,8,["invalid","text"]),l.createVNode(s,{addBorder:!0,invalid:t.invalid,placeholder:t.placeholder,value:t.inputValue,"onUpdate:value":o.handleUpdateValue},null,8,["invalid","placeholder","value","onUpdate:value"])])}const CA={name:"AddTournamentPageOne",components:{TitledInput:Pe(wA,[["render",xA]]),FindPerson:bA,FindLocation:pA,BaseText:Lt,BaseInput:Vn,ImageCropper:Su,AddressAutocomplete:Pa,DatePicker:As,TextBoxEditor:Qh,BaseRadioGroup:kc,BaseButton:ln},props:{locations:[],persons:[]},data(){return{tournament:{name:"",imageLink:"",address:"",coordinates:"",startDate:"",totalDays:1,description:"",visibility:"",externalLinks:Array},validation:{name:!1,imageLink:!1,address:!1,coordinates:!1,startDate:!1,totalDays:!1,description:!1,visibility:!1},visibilityItems:[{label:"Open",value:"open",description:"Viewable To Everyone"},{label:"Club",value:"club",description:"Viewable Only to Members of Your Club"},{label:"Private",value:"private",description:"Only Viewable by you"}]}},methods:{handleSubmit(){this.setAllValidationStates(!1),this.tournament.name===""&&(this.validation.name=!0),this.tournament.coordinates===""&&(this.validation.address=!0),this.tournament.startDate===""&&(this.validation.startDate=!0),this.tournament.totalDays===""&&(this.validation.totalDays=!0),this.tournament.description===""&&(this.validation.description=!0),this.tournament.visibility===""&&(this.validation.visibility=!0),this.areAnyFieldsAreLeftInvalid||(this.$emit("update:tournament",this.tournament),this.$emit("update:step",2))},setAllValidationStates(n){Object.keys(this.validation).forEach(e=>{this.validation[e]=n})},handleAddressUpdate(n){this.tournament.address=n.address,this.tournament.coordinates=n.coordinates},handleDateUpdate(n){this.tournament.startDate=n,console.log("New Date"),console.log(n),console.log(As.props.invalid)},handleEditorUpdate(n){this.tournament.description=n}},computed:{areAnyFieldsAreLeftInvalid(){return Object.values(this.validation).every(n=>n)}}},TA={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},MA={class:"w-full flex flex-row justify-center"},SA={class:"w-full my-4"},DA={class:"w-full flex flex-row justify-center my-4"},AA={class:"w-fu--*ll flex flex-row justify-center"},EA={class:"w-96"},NA={class:"flex flex-col mb-3"},OA={class:"flex flex-row mb-3"},_A={class:"w-3/4 mr-1"},BA={class:"flex flex-col mb-3"},PA={class:"flex flex-col pb-4"},IA={class:"flex flex-col pb-4"};function RA(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("ImageCropper"),c=l.resolveComponent("TitledInput"),d=l.resolveComponent("FindLocation"),u=l.resolveComponent("DatePicker"),p=l.resolveComponent("TextBoxEditor"),f=l.resolveComponent("FindPerson"),h=l.resolveComponent("BaseRadioGroup"),m=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",TA,[l.createElementVNode("div",MA,[l.createVNode(a,{color:"quaternary",size:"sm",text:"Step 1 out of 2",weight:"normal","data-testid":"text-step"})]),l.createElementVNode("div",SA,[l.createVNode(a,{color:"primaryHighlight",size:"2xl",text:"Add Tournament",weight:"normal","data-testid":"text-add-tournament"})]),l.createElementVNode("div",DA,[l.createVNode(s,{personID:1})]),l.createElementVNode("div",AA,[l.createElementVNode("section",EA,[l.createVNode(c,{invalid:i.validation.name,title:"Tournament Name",inputValue:i.tournament.name,placeholder:"Enter Tournament Name","onUpdate:value":e[0]||(e[0]=y=>i.tournament.name=y)},null,8,["invalid","inputValue"]),l.createElementVNode("div",NA,[l.createVNode(a,{color:"primaryHighlight",invalid:i.validation.address,size:"sm",text:"Location",weight:"normal",class:"mb-1","data-testid":"text-address"},null,8,["invalid"]),l.createVNode(d,{addBorder:!0,locations:t.locations,addNewText:"Add New"},null,8,["locations"])]),l.createElementVNode("div",OA,[l.createElementVNode("div",_A,[l.createVNode(a,{color:"primaryHighlight",invalid:i.validation.startDate,size:"sm",text:"Start Date",weight:"normal",class:"mb-1","data-testid":"text-start-date"},null,8,["invalid"]),l.createVNode(u,{invalid:i.validation.startDate,setDate:i.tournament.startDate,"onUpdate:selectedDate":o.handleDateUpdate},null,8,["invalid","setDate","onUpdate:selectedDate"])]),l.createElementVNode("div",null,[l.createVNode(c,{invalid:i.validation.totalDays,title:"Number of Days",inputValue:i.tournament.totalDays,placeholder:"1","onUpdate:value":e[1]||(e[1]=y=>i.tournament.totalDays=y)},null,8,["invalid","inputValue"])])]),l.createElementVNode("div",BA,[l.createVNode(a,{color:"primaryHighlight",invalid:i.validation.description,size:"sm",text:"Description",weight:"normal",class:"mb-1","data-testid":"text-description"},null,8,["invalid"]),l.createVNode(p,{invalid:i.validation.description,"onUpdate:editorContent":o.handleEditorUpdate},null,8,["invalid","onUpdate:editorContent"])]),l.createElementVNode("div",PA,[l.createVNode(a,{color:"primaryHighlight",invalid:!1,size:"sm",text:"Primary Contact",weight:"normal",class:"mb-1","data-testid":"text-address"}),l.createVNode(f,{addBorder:!0,persons:t.persons,addNewText:"Add New Person"},null,8,["persons"])]),l.createElementVNode("div",IA,[l.createVNode(a,{color:"primaryHighlight",invalid:i.validation.visibility,size:"sm",text:"Tournament Visibility",weight:"normal",class:"mb-2","data-testid":"text-visibility"},null,8,["invalid"]),l.createVNode(h,{invalid:i.validation.visibility,items:i.visibilityItems,"onUpdate:value":e[2]||(e[2]=y=>i.tournament.visibility=y)},null,8,["invalid","items"])]),l.createElementVNode("div",null,[l.createVNode(m,{class:"w-full",color:"neutral",label:"Continue",size:"sm",type:"secondary",onClick:e[3]||(e[3]=y=>o.handleSubmit())})])])])])}const VA=Pe(CA,[["render",RA]]),LA={name:"AddTournamentPageTwo",components:{BaseIcon:pr,BaseText:Lt,BaseButton:ln,BaseInput:Vn},props:{tournament:Object},data(){return{ferrotasToHost:!1,linkInputVisible:!1,localTournament:JSON.parse(JSON.stringify(this.tournament))}},created(){Array.isArray(this.localTournament.externalLinks)||(this.localTournament.externalLinks=[]),this.localTournament.externalLinks.length===0&&this.localTournament.externalLinks.push({url:"",valid:!0})},methods:{updateLink(n,e){const t=e.target.value;this.localTournament.externalLinks[n].url=t,this.localTournament.externalLinks[n].valid=this.isValidUrl(t)},handleHosting(){this.ferrotasToHost=!this.ferrotasToHost},toggleLinkInput(){this.linkInputVisible=!this.linkInputVisible},addExternalLink(){this.localTournament.externalLinks.push({url:"",valid:!0})},removeLink(n){this.localTournament.externalLinks=this.localTournament.externalLinks.filter(e=>e.url!==n)},handleSubmit(){console.log("submitting ferrotas hosting"),this.areAllLinksValid()&&(console.log(this.localTournament),this.$emit("submit",this.localTournament))},isValidUrl(n){return/^(https?:\/\/)?([\da-z.-]+)\.([\da-z.]+)\.([\/\w\W]+)\/?$/.test(n)},areAllLinksValid(){return this.localTournament.externalLinks.forEach(n=>n.valid=this.isValidUrl(n.url)),this.localTournament.externalLinks.every(n=>n.valid)}}},$A={class:"border border-dropdownSelect rounded-lg p-9 bg-neutral"},FA={class:"w-full flex flex-row justify-center"},zA={class:"w-full flex flex-row justify-center"},HA={class:"w-96"},YA={class:"w-full flex flex-row justify-center text-center my-4"},jA={class:"w-full flex flex-col mb-3"},UA=l.createElementVNode("br",null,null,-1),WA=l.createElementVNode("br",null,null,-1),qA={class:"flex flex-row justify-center"},KA={key:0,class:"flex flex-col mb-3"};function GA(n,e,t,r,i,o){const a=l.resolveComponent("BaseText"),s=l.resolveComponent("BaseButton"),c=l.resolveComponent("BaseInput"),d=l.resolveComponent("BaseIcon");return l.openBlock(),l.createElementBlock("div",$A,[l.createElementVNode("div",FA,[l.createVNode(a,{color:"quaternary",size:"sm",text:"Step 2 out of 4",weight:"normal","data-testid":"text-step"})]),l.createElementVNode("div",zA,[l.createElementVNode("section",HA,[l.createElementVNode("div",YA,[l.createVNode(a,{color:"primaryHighlight",size:"2xl",text:"Do you want Ferrotas to host your tournament?",weight:"normal","data-testid":"text-ferrotas-to-host"})]),l.createElementVNode("div",jA,[l.createVNode(a,{color:"quaternary",size:"sm",text:"If you select 'No', your tournament will be featured on our main calendar. This will include a direct link to your tournament's webpage, making it easy for participants to find all the relevant information on your own site.",weight:"normal","data-testid":"text-select-no"},null,8,["text"]),UA,l.createVNode(a,{color:"quaternary",size:"sm",text:"By selecting 'Yes', you'll gain access to our comprehensive Ferrotas platform. This allows you to manage and conduct your tournament directly through our system, offering a seamless and integrated experience.",weight:"normal","data-testid":"text-select-yes"},null,8,["text"]),WA,l.createVNode(a,{color:"quaternary",size:"sm",text:"Need Assistance? Our support team is always ready to help. Contact us for any queries or guidance you need.",weight:"normal","data-testid":"text-need-help"},null,8,["text"])]),l.createElementVNode("div",qA,[l.createVNode(s,{class:"w-1/2 mr-1",color:"neutral",label:"Yes",selected:"selected",size:"sm",type:"square",onClick:e[0]||(e[0]=u=>o.handleHosting())}),l.createVNode(s,{class:"w-1/2 ml-1",color:"neutral",label:"No",size:"sm",type:"square",onClick:e[1]||(e[1]=u=>o.toggleLinkInput())})]),i.linkInputVisible?(l.openBlock(),l.createElementBlock("section",KA,[l.createVNode(a,{color:"quaternary",size:"sm",text:"Add links to external sites such as Facebook events",weight:"normal",class:"mb-1","data-testid":"text-need-help"}),(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.localTournament.externalLinks,(u,p)=>(l.openBlock(),l.createElementBlock("div",{key:p,class:"flex flex-row w-full"},[l.createVNode(c,{addBorder:!0,invalid:!u.valid,value:u.url,class:"pb-2 w-full","icon-name":"fa-dash",placeholder:"https://link1.com/yourevent",onInput:f=>o.updateLink(p,f)},null,8,["invalid","value","onInput"]),l.createVNode(d,{class:"mt-1.5 -ml-7 hover:text-primaryHighlight",color:"primary","data-testid":"base-icon","icon-name":"fa-circle-xmark",iconStyle:"fa-solid",size:"xl",onClick:f=>o.removeLink(u.url)},null,8,["onClick"])]))),128)),l.createVNode(s,{class:"w-full mt-3",color:"neutral",label:"Add New Link",size:"sm",type:"primary",onClick:e[2]||(e[2]=u=>o.addExternalLink())})])):l.createCommentVNode("",!0),l.createElementVNode("div",null,[l.createVNode(s,{color:"neutral",label:"Continue",size:"sm",type:"secondary",onClick:e[3]||(e[3]=u=>o.handleSubmit())})])])])])}const JA=Pe(LA,[["render",GA]]),QA={name:"AdminLeftMenu",components:{BaseButton:ln},props:{buttons:{type:Array,default:()=>[]}},methods:{handleButtonClick(n){this.$emit("button-click",n)}}},XA={class:"bg-secondary w-64 h-screen flex flex-col justify-between"},ZA=l.createElementVNode("section",{class:"h-28 border-b border-neutral"},[l.createElementVNode("div",{class:"flex flex-col justify-center h-28"},[l.createElementVNode("div",{class:"ml-8"},[l.createElementVNode("img",{class:"w-32",src:"https://ferrotas.com/assets/ferrotas-white-small-720502db.png",alt:"logo"})])])],-1),eE={class:"flex flex-col p-2 h-full"},tE={class:"flex flex-col justify-end p-2 flex-grow"},nE={class:"border-t border-neutral pt-2"};function rE(n,e,t,r,i,o){const a=l.resolveComponent("BaseButton");return l.openBlock(),l.createElementBlock("div",XA,[ZA,l.createElementVNode("section",eE,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.buttons,s=>(l.openBlock(),l.createBlock(a,{label:s.label,iconClass:"fa-solid fa-trophy text-white",type:"admin",hover:"admin",onClick:c=>o.handleButtonClick(s)},null,8,["label","onClick"]))),256))]),l.createElementVNode("section",tE,[l.createElementVNode("div",nE,[l.createVNode(a,{iconClass:"fa-solid fa-circle-user text-textSecondary",label:"Account",type:"adminSecondary",onClick:e[0]||(e[0]=s=>o.handleButtonClick(n.button))}),l.createVNode(a,{iconClass:"fa-solid fa-right-to-bracket fa-rotate-180 text-textSecondary",label:"Log Out",type:"adminSecondary",onClick:e[1]||(e[1]=s=>o.handleButtonClick(n.button))})])])])}const iE=Pe(QA,[["render",rE]]);_e.AddTournamentPageOne=VA,_e.AddTournamentPageTwo=JA,_e.AddressAutocomplete=Pa,_e.AdminLeftMenu=iE,_e.BaseButton=ln,_e.BaseIcon=pr,_e.BaseInput=Vn,_e.BaseModal=Ba,_e.BaseRadioGroup=kc,_e.BaseTag=xc,_e.BaseText=Lt,_e.Breadcrumb=ym,_e.DatePicker=As,_e.DropDownMenu=_a,_e.FilterAndSortBar=Hm,_e.FilterUpcomingPast=Km,_e.GridContainer=fw,_e.ImageCropper=Su,_e.TextBoxEditor=Qh,_e.TournamentCard=oA,_e.TournamentCardDetail=Cc,_e.TournamentCardHeader=Mc,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
|