@myissue/vue-website-page-builder 3.5.10 → 3.5.11
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.
|
@@ -18,7 +18,7 @@ Only state can be modified.`);l[0]="$state",eo=!1,o.set(a,l,o.state.value),eo=!0
|
|
|
18
18
|
state: () => new MyClass()
|
|
19
19
|
Found in store "${k.$id}".`),g&&a&&t.hydrate&&t.hydrate(k.$state,g),d=!0,c=!0,k}/*! #__NO_SIDE_EFFECTS__ */function T8(r,e,t){let o,n;const a=typeof e=="function";o=r,n=a?t:e;function l(s,p){const d=i.hasInjectionContext();if(s=(process.env.NODE_ENV==="test"&&Uo&&Uo._testing?null:s)||(d?i.inject(A3,null):null),s&&Wo(s),process.env.NODE_ENV!=="production"&&!Uo)throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
|
|
20
20
|
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
|
|
21
|
-
This will fail in production.`);s=Uo,s._s.has(o)||(a?dl(o,e,n,s):Y3(o,n,s),process.env.NODE_ENV!=="production"&&(l._pinia=s));const c=s._s.get(o);if(process.env.NODE_ENV!=="production"&&p){const m="__hot:"+o,b=a?dl(m,e,n,s,!0):Y3(m,it({},n),s,!0);p._hotUpdate(b),delete s.state.value[m],s._s.delete(m)}if(process.env.NODE_ENV!=="production"&&Zt){const m=i.getCurrentInstance();if(m&&m.proxy&&!p){const b=m.proxy,x="_pStores"in b?b._pStores:b._pStores={};x[o]=c}}return c}return l.$id=o,l}const X3=T8("pageBuilderState",{state:()=>({componentArrayAddMethod:null,localStorageItemName:null,showModalTipTap:!1,menuRight:!0,borderStyle:null,borderWidth:null,borderColor:null,borderRadiusGlobal:null,borderRadiusTopLeft:null,borderRadiusTopRight:null,borderRadiusBottomleft:null,borderRadiusBottomRight:null,elementContainsHyperlink:null,hyperlinkAbility:null,hyperlinkInput:null,hyperlinkMessage:null,hyperlinkError:null,hyberlinkEnable:!1,openHyperlinkinkInNewTab:null,opacity:null,backgroundOpacity:null,textAreaVueModel:null,currentClasses:[],currentStyles:{},fontVerticalPadding:null,fontHorizontalPadding:null,fontTopPadding:null,fontRightPadding:null,fontBottomPadding:null,fontLeftPadding:null,fontVerticalMargin:null,fontHorizontalMargin:null,fontTopMargin:null,fontRightMargin:null,fontBottomMargin:null,fontLeftMargin:null,fontStyle:null,fontFamily:null,fontWeight:null,fontBase:null,fontDesktop:null,fontTablet:null,fontMobile:null,backgroundColor:null,textColor:null,element:null,component:null,components:[],basePrimaryImage:null,imageObjectFit:null,imageObjectPosition:null,imageAspectRatio:null,imageSettingsPanelOpen:!1,configPageBuilder:null,showModalHTMLEditor:!1,toggleGlobalHtmlMode:!1,applyImageToSelection:{src:""},currentPreviewImage:null,builderStarted:!1,isLoadingGlobal:!0,isSaving:!1,hasLocalDraftForUpdate:!1,isResumeEditing:!1,isRestoring:!1,currentLanguage:null,historyIndex:-1,historyLength:0,addComponentAddIndex:null}),getters:{getComponentArrayAddMethod(r){return r.componentArrayAddMethod},getLocalStorageItemName(r){return r.localStorageItemName},getShowModalTipTap(r){return r.showModalTipTap},getMenuRight(r){return r.menuRight},getBorderStyle(r){return r.borderStyle},getBorderWidth(r){return r.borderWidth},getBorderColor(r){return r.borderColor},getBorderRadiusGlobal(r){return r.borderRadiusGlobal},getBorderRadiusTopLeft(r){return r.borderRadiusTopLeft},getBorderRadiusTopRight(r){return r.borderRadiusTopRight},getBorderRadiusBottomleft(r){return r.borderRadiusBottomleft},getBorderRadiusBottomRight(r){return r.borderRadiusBottomRight},getElementContainsHyperlink(r){return r.elementContainsHyperlink},getHyperlinkAbility(r){return r.hyperlinkAbility},getHyperlinkInput(r){return r.hyperlinkInput},getHyperlinkMessage(r){return r.hyperlinkMessage},getHyperlinkError(r){return r.hyperlinkError},getHyberlinkEnable(r){return r.hyberlinkEnable},getOpenHyperlinkInNewTab(r){return r.openHyperlinkinkInNewTab},getOpacity(r){return r.opacity},getBackgroundOpacity(r){return r.backgroundOpacity},getTextAreaVueModel(r){return r.textAreaVueModel},getCurrentClasses(r){return r.currentClasses},getCurrentStyles(r){return r.currentStyles},getFontStyle(r){return r.fontStyle},getFontVerticalPadding(r){return r.fontVerticalPadding},getFontHorizontalPadding(r){return r.fontHorizontalPadding},getFontTopPadding(r){return r.fontTopPadding},getFontRightPadding(r){return r.fontRightPadding},getFontBottomPadding(r){return r.fontBottomPadding},getFontLeftPadding(r){return r.fontLeftPadding},getFontVerticalMargin(r){return r.fontVerticalMargin},getFontHorizontalMargin(r){return r.fontHorizontalMargin},getFontTopMargin(r){return r.fontTopMargin},getFontRightMargin(r){return r.fontRightMargin},getFontBottomMargin(r){return r.fontBottomMargin},getFontLeftMargin(r){return r.fontLeftMargin},getFontFamily(r){return r.fontFamily},getFontWeight(r){return r.fontWeight},getFontBase(r){return r.fontBase},getFontDesktop(r){return r.fontDesktop},getFontTablet(r){return r.fontTablet},getFontMobile(r){return r.fontMobile},getBackgroundColor(r){return r.backgroundColor},getTextColor(r){return r.textColor},getElement(r){return r.element},getComponent(r){return r.component},getComponents(r){return r.components},getBasePrimaryImage(r){return r.basePrimaryImage},getImageObjectFit(r){return r.imageObjectFit},getImageObjectPosition(r){return r.imageObjectPosition},getImageAspectRatio(r){return r.imageAspectRatio},getImageSettingsPanelOpen(r){return r.imageSettingsPanelOpen},getPageBuilderConfig(r){return r.configPageBuilder},getShowModalHTMLEditor(r){return r.showModalHTMLEditor},getToggleGlobalHtmlMode(r){return r.toggleGlobalHtmlMode},getApplyImageToSelection(r){return r.applyImageToSelection},getCurrentPreviewImage(r){return r.currentPreviewImage},getBuilderStarted:r=>r.builderStarted,getIsLoadingGlobal:r=>r.isLoadingGlobal,getIsSaving:r=>r.isSaving,getHasLocalDraftForUpdate:r=>r.hasLocalDraftForUpdate,getIsLoadingResumeEditing:r=>r.isResumeEditing,getIsRestoring:r=>r.isRestoring,getCurrentLanguage:r=>r.currentLanguage,getHistoryIndex:r=>r.historyIndex,getHistoryLength:r=>r.historyLength,getAddComponentAddIndex:r=>r.addComponentAddIndex},actions:{setComponentArrayAddMethod(r){this.componentArrayAddMethod=r},setLocalStorageItemName(r){this.localStorageItemName=r},setShowModalTipTap(r){this.showModalTipTap=r},setMenuRight(r){this.menuRight=r},setBorderStyle(r){this.borderStyle=r},setBorderWidth(r){this.borderWidth=r},setBorderColor(r){this.borderColor=r},setBorderRadiusGlobal(r){this.borderRadiusGlobal=r},setBorderRadiusTopLeft(r){this.borderRadiusTopLeft=r},setBorderRadiusTopRight(r){this.borderRadiusTopRight=r},setBorderRadiusBottomleft(r){this.borderRadiusBottomleft=r},setBorderRadiusBottomRight(r){this.borderRadiusBottomRight=r},setElementContainsHyperlink(r){this.elementContainsHyperlink=r},setHyperlinkAbility(r){this.hyperlinkAbility=r},setHyperlinkInput(r){this.hyperlinkInput=r},setHyperlinkMessage(r){this.hyperlinkMessage=r},setHyperlinkError(r){this.hyperlinkError=r},setHyberlinkEnable(r){this.hyberlinkEnable=r},setOpenHyperlinkInNewTab(r){this.openHyperlinkinkInNewTab=r},setOpacity(r){this.opacity=r},setBackgroundOpacity(r){this.backgroundOpacity=r},setTextAreaVueModel(r){this.textAreaVueModel=r},setClass(r){this.currentClasses=[...this.currentClasses,r]},removeClass(r){this.currentClasses=this.currentClasses.filter(e=>e!==r)},setCurrentClasses(r){this.currentClasses=Array.from(r)},setCurrentStyles(r){this.currentStyles=r},setFontVerticalPadding(r){this.fontVerticalPadding=r},setFontHorizontalPadding(r){this.fontHorizontalPadding=r},setFontTopPadding(r){this.fontTopPadding=r},setFontRightPadding(r){this.fontRightPadding=r},setFontBottomPadding(r){this.fontBottomPadding=r},setFontLeftPadding(r){this.fontLeftPadding=r},setFontVerticalMargin(r){this.fontVerticalMargin=r},setFontHorizontalMargin(r){this.fontHorizontalMargin=r},setFontTopMargin(r){this.fontTopMargin=r},setFontRightMargin(r){this.fontRightMargin=r},setFontBottomMargin(r){this.fontBottomMargin=r},setFontLeftMargin(r){this.fontLeftMargin=r},setFontStyle(r){this.fontStyle=r},setFontFamily(r){this.fontFamily=r},setFontWeight(r){this.fontWeight=r},setFontBase(r){this.fontBase=r},setFontDesktop(r){this.fontDesktop=r},setFontTablet(r){this.fontTablet=r},setFontMobile(r){this.fontMobile=r},setBackgroundColor(r){this.backgroundColor=r},setTextColor(r){this.textColor=r},setElement(r){this.element=null,i.nextTick(()=>{this.element=r})},setComponent(r){if(!r){this.element=null,this.component=null;return}this.component=null,i.nextTick(()=>{this.component=r})},setComponents(r){this.components=[],i.nextTick(()=>{this.components=r||[]})},setPushComponents(r){const e=r.componentArrayAddMethod??"push";e==="push"?this.components.push(r.component):e==="unshift"&&this.components.unshift(r.component)},setBasePrimaryImage(r){this.element&&(this.element.src=r??void 0),this.basePrimaryImage=r},setImageObjectFit(r){this.imageObjectFit=r},setImageObjectPosition(r){this.imageObjectPosition=r},setImageAspectRatio(r){this.imageAspectRatio=r},setImageSettingsPanelOpen(r){this.imageSettingsPanelOpen=r},setCurrentLayoutPreview(r){localStorage.setItem("preview",r)},setPageBuilderConfig(r){this.configPageBuilder=r},setShowModalHTMLEditor(r){this.showModalHTMLEditor=r},setToggleGlobalHtmlMode(r){this.toggleGlobalHtmlMode=r},setApplyImageToSelection(r){this.applyImageToSelection=r},setCurrentPreviewImage(r){this.currentPreviewImage=r},setBuilderStarted(r){this.builderStarted=r},setIsLoadingGlobal(r){this.isLoadingGlobal=r},setIsSaving(r){this.isSaving=r},setHasLocalDraftForUpdate(r){this.hasLocalDraftForUpdate=r},setIsLoadingResumeEditing(r){this.isResumeEditing=r},setIsRestoring(r){this.isRestoring=r},setCurrentLanguage(r){this.currentLanguage=r},setHistoryIndex(r){this.historyIndex=r},setHistoryLength(r){this.historyLength=r},setAddComponentAddIndex(r){this.addComponentAddIndex=r}}}),cl=q3(),oe=X3(cl),er=function(r){return!r||typeof r=="object"&&r.constructor===Object&&Object.keys(r).length===0},M8="3.5.10",N8={class:"pbx-w-full pbx-inset-x-0 pbx-h-[90vh] pbx-bg-white pbx-overflow-x-scroll lg:pbx-pt-2 pbx-pt-2"},P8={class:"pbx-mt-4 pbx-mb-4 pbx-py-8 pbx-px-2 pbx-border pbx-border-solid pbx-border-gray-600 pbx-rounded-xl"},L8={class:"pbx-flex pbx-items-left pbx-flex-col pbx-gap-1"},B8={class:"pbx-myQuaternaryHeader"},A8={class:"pbx-myPrimaryParagraph pbx-text-xs"},D8={class:"pbx-px-2"},V8={class:"pbx-mt-8"},z8={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},I8={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},O8={class:"pbx-overflow-x-auto"},_8={class:"pbx-min-w-full"},H8={class:"pbx-bg-gray-50"},R8={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},j8={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},F8={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},q8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},U8={class:"pbx-min-w-[30rem] pbx-w-max"},W8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},G8={class:"pbx-min-w-[30rem] pbx-w-max"},K8={class:"pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium pbx-bg-blue-100 pbx-text-blue-800"},J8={key:0,class:"pbx-mt-4"},Y8={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},X8={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},Q8={class:"pbx-overflow-x-auto"},Z8={class:"pbx-min-w-full"},$8={class:"pbx-bg-gray-50"},e7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},t7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},r7={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},o7={key:0},i7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},n7={class:"pbx-min-w-[30rem] pbx-w-max"},a7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},l7={class:"pbx-min-w-[30rem] pbx-w-max"},s7={key:1},p7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},d7={class:"pbx-min-w-[30rem] pbx-w-max"},c7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},m7={class:"pbx-min-w-[30rem] pbx-w-max"},b7={key:1,class:"pbx-mt-8"},x7={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},g7={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},u7={class:"pbx-overflow-x-auto"},h7={class:"pbx-min-w-full"},f7={class:"pbx-bg-gray-50"},y7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},w7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},v7={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},k7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},S7={class:"pbx-min-w-[30rem] pbx-w-max"},C7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},E7={class:"pbx-min-w-[30rem] pbx-w-max"},T7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},M7={class:"pbx-min-w-[30rem] pbx-w-max"},N7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},P7={class:"pbx-min-w-[30rem] pbx-w-max"},L7={key:0,class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},B7={class:"pbx-min-w-[30rem] pbx-w-max"},A7={class:"pbx-flex pbx-items-center pbx-space-x-3"},D7=["src"],V7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},z7={class:"pbx-min-w-[30rem] pbx-w-max"},I7={key:0,class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},O7={class:"pbx-min-w-[30rem] pbx-w-max"},_7={key:2,class:"pbx-mt-8"},H7={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},R7={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},j7={class:"pbx-overflow-x-auto"},F7={class:"pbx-min-w-full"},q7={class:"pbx-bg-gray-50"},U7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},W7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},G7={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},K7={key:0},J7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},Y7={class:"pbx-min-w-[30rem] pbx-w-max"},X7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},Q7={class:"pbx-min-w-[30rem] pbx-w-max"},Z7={key:1},$7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},eM={class:"pbx-min-w-[30rem] pbx-w-max"},tM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},rM={class:"pbx-min-w-[30rem] pbx-w-max"},oM={key:2},iM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},nM={class:"pbx-min-w-[30rem] pbx-w-max"},aM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},lM={class:"pbx-min-w-[30rem] pbx-w-max"},sM={key:3,class:"pbx-mt-8"},pM={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},dM={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},cM={class:"pbx-overflow-x-auto"},mM={class:"pbx-min-w-full"},bM={class:"pbx-bg-gray-50"},xM={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},gM={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},uM={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},hM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},fM={class:"pbx-min-w-[30rem] pbx-w-max"},yM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},wM={class:"pbx-min-w-[30rem] pbx-w-max"},vM={class:"pbx-flex pbx-items-center pbx-space-x-3"},kM=["src"],SM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},CM={class:"pbx-min-w-[30rem] pbx-w-max"},EM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},TM={class:"pbx-min-w-[30rem] pbx-w-max"},MM={class:"pbx-flex pbx-items-center pbx-space-x-3"},NM={class:"pbx-pr-6"},PM={class:"pbx-flex pbx-items-center pbx-space-x-3"},LM={class:"pbx-whitespace-nowrap"},BM={key:4,class:"pbx-mt-8"},AM={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},DM={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},VM={class:"pbx-overflow-x-auto"},zM={class:"pbx-w-max"},IM={class:"pbx-bg-gray-50"},OM={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},_M={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},HM={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},RM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},jM={class:"pbx-min-w-[30rem] pbx-w-max"},FM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},qM={class:"pbx-min-w-[30rem] pbx-w-max"},UM={key:0},WM={key:1},GM={key:0},KM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},JM={class:"pbx-min-w-[30rem] pbx-w-max"},YM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},XM={class:"pbx-min-w-[30rem] pbx-w-max"},QM={class:"pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium"},ZM={class:"pbx-mt-4 pbx-mb-4 pbx-py-8 pbx-px-2 pbx-border pbx-border-solid pbx-border-gray-600 pbx-rounded-xl"},$M={class:"pbx-flex pbx-items-left pbx-flex-col pbx-gap-1"},eN={class:"pbx-myQuaternaryHeader"},tN={class:"pbx-myPrimaryParagraph pbx-text-xs"},rN={class:"pbx-mt-4 pbx-whitespace-pre-wrap pbx-text-white pbx-overflow-hidden pbx-bg-gray-900"},oN={class:"pbx-flex bg-gray-800/40 pbx-ring-1 ring-white/5"},iN={class:"pbx-mb-px pbx-flex pbx-text-xs pbx-font-medium pbx-text-myPrimaryMediumGrayColor"},nN={class:"pbx-px-4 pbx-py-4 pbx-text-white"},aN={class:"pbx-px-4 pbx-pb-8 pbx-pt-4 pbx-text-white pbx-text-xs pbx-break-all"},lN={class:"pbx-myPrimaryParagraph pbx-text-xs pbx-text-white"},sN=i.defineComponent({__name:"PageBuilderSettings",setup(r){const{translate:e}=re(),t=oe,o=i.computed(()=>t.getPageBuilderConfig);return(n,a)=>{var l,s,p,d,c,m,b,x,g,u,h,f,w,y;return i.openBlock(),i.createElementBlock("div",N8,[i.createElementVNode("div",P8,[i.createElementVNode("div",null,[i.createElementVNode("div",L8,[i.createElementVNode("h3",B8,i.toDisplayString(i.unref(e)("Configuration Overview")),1),i.createElementVNode("p",A8,i.toDisplayString(i.unref(e)("A summary of current user preferences, application settings, and system metadata including UI theme, language, saved components, and logo configuration.")),1)]),i.createElementVNode("div",D8,[i.createElementVNode("div",V8,[i.createElementVNode("h4",z8,i.toDisplayString(i.unref(e)("Version Information")),1),i.createElementVNode("div",I8,[i.createElementVNode("div",O8,[i.createElementVNode("table",_8,[i.createElementVNode("thead",H8,[i.createElementVNode("tr",null,[i.createElementVNode("th",R8,i.toDisplayString(i.unref(e)("App")),1),i.createElementVNode("th",j8,i.toDisplayString(i.unref(e)("Version")),1)])]),i.createElementVNode("tbody",F8,[i.createElementVNode("tr",null,[i.createElementVNode("td",q8,[i.createElementVNode("div",U8,i.toDisplayString(i.unref(e)("Page Builder")),1)]),i.createElementVNode("td",W8,[i.createElementVNode("div",G8,[i.createElementVNode("span",K8,i.toDisplayString(i.unref(M8)),1)])])])])])])])]),(l=o.value)!=null&&l.resourceData&&!i.unref(er)(o.value.resourceData)?(i.openBlock(),i.createElementBlock("div",J8,[i.createElementVNode("h4",Y8,i.toDisplayString(i.unref(e)("Resource Data")),1),i.createElementVNode("div",X8,[i.createElementVNode("div",Q8,[i.createElementVNode("table",Z8,[i.createElementVNode("thead",$8,[i.createElementVNode("tr",null,[i.createElementVNode("th",e7,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",t7,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",r7,[(p=(s=o.value)==null?void 0:s.resourceData)!=null&&p.title?(i.openBlock(),i.createElementBlock("tr",o7,[i.createElementVNode("td",i7,[i.createElementVNode("div",n7,i.toDisplayString(i.unref(e)("Title")),1)]),i.createElementVNode("td",a7,[i.createElementVNode("div",l7,i.toDisplayString(o.value.resourceData.title),1)])])):i.createCommentVNode("",!0),(c=(d=o.value)==null?void 0:d.resourceData)!=null&&c.id?(i.openBlock(),i.createElementBlock("tr",s7,[i.createElementVNode("td",p7,[i.createElementVNode("div",d7,i.toDisplayString(i.unref(e)("ID")),1)]),i.createElementVNode("td",c7,[i.createElementVNode("div",m7,i.toDisplayString(o.value.resourceData.id),1)])])):i.createCommentVNode("",!0)])])])])])):i.createCommentVNode("",!0),(m=o.value)!=null&&m.userForPageBuilder&&!i.unref(er)(o.value.userForPageBuilder)?(i.openBlock(),i.createElementBlock("div",b7,[i.createElementVNode("h4",x7,i.toDisplayString(i.unref(e)("User Information")),1),i.createElementVNode("div",g7,[i.createElementVNode("div",u7,[i.createElementVNode("table",h7,[i.createElementVNode("thead",f7,[i.createElementVNode("tr",null,[i.createElementVNode("th",y7,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",w7,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",v7,[i.createElementVNode("tr",null,[i.createElementVNode("td",k7,[i.createElementVNode("div",S7,i.toDisplayString(i.unref(e)("User Name")),1)]),i.createElementVNode("td",C7,[i.createElementVNode("div",E7,i.toDisplayString(o.value.userForPageBuilder.name),1)])]),i.createElementVNode("tr",null,[a[0]||(a[0]=i.createElementVNode("td",{class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},[i.createElementVNode("div",{class:"pbx-min-w-[30rem] pbx-w-max"},"ID")],-1)),i.createElementVNode("td",T7,[i.createElementVNode("div",M7,i.toDisplayString(o.value.userForPageBuilder.id),1)])]),i.createElementVNode("tr",null,[i.createElementVNode("td",N7,[i.createElementVNode("div",P7,i.toDisplayString(i.unref(e)("Image")),1)]),o.value.userForPageBuilder.image&&typeof o.value.userForPageBuilder.image=="string"&&o.value.userForPageBuilder.image.length>2?(i.openBlock(),i.createElementBlock("td",L7,[i.createElementVNode("div",B7,[i.createElementVNode("div",A7,[i.createElementVNode("img",{class:"pbx-block pbx-inset-0 pbx-object-top pbx-h-10 pbx-min-h-10 pbx-max-h-10 pbx-w-10 pbx-min-w-10 pbx-max-w-10 pbx-object-cover pbx-rounded-full",src:o.value.userForPageBuilder.image,alt:"image"},null,8,D7)])])])):i.createCommentVNode("",!0)]),i.createElementVNode("tr",null,[i.createElementVNode("td",V7,[i.createElementVNode("div",z7,i.toDisplayString(i.unref(e)("Image URL")),1)]),o.value.userForPageBuilder.image&&typeof o.value.userForPageBuilder.image=="string"&&o.value.userForPageBuilder.image.length>2?(i.openBlock(),i.createElementBlock("td",I7,[i.createElementVNode("div",O7,i.toDisplayString(o.value.userForPageBuilder.image),1)])):i.createCommentVNode("",!0)])])])])])])):i.createCommentVNode("",!0),(b=o.value)!=null&&b.userSettings&&!i.unref(er)(o.value.userSettings)?(i.openBlock(),i.createElementBlock("div",_7,[i.createElementVNode("h4",H7,i.toDisplayString(i.unref(e)("User Settings")),1),i.createElementVNode("div",R7,[i.createElementVNode("div",j7,[i.createElementVNode("table",F7,[i.createElementVNode("thead",q7,[i.createElementVNode("tr",null,[i.createElementVNode("th",U7,i.toDisplayString(i.unref(e)("Setting")),1),i.createElementVNode("th",W7,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",G7,[(g=(x=o.value)==null?void 0:x.userSettings)!=null&&g.language?(i.openBlock(),i.createElementBlock("tr",K7,[i.createElementVNode("td",J7,[i.createElementVNode("div",Y7,i.toDisplayString(i.unref(e)("Language")),1)]),i.createElementVNode("td",X7,[i.createElementVNode("div",Q7,i.toDisplayString(o.value.userSettings.language),1)])])):i.createCommentVNode("",!0),((h=(u=o.value)==null?void 0:u.userSettings)==null?void 0:h.autoSave)!==void 0?(i.openBlock(),i.createElementBlock("tr",Z7,[i.createElementVNode("td",$7,[i.createElementVNode("div",eM,i.toDisplayString(i.unref(e)("Auto Save")),1)]),i.createElementVNode("td",tM,[i.createElementVNode("div",rM,[i.createElementVNode("span",{class:i.normalizeClass(["pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium",o.value.userSettings.autoSave?"bg-green-100 text-green-800":"bg-red-100 text-red-800"])},i.toDisplayString(o.value.userSettings.autoSave?i.unref(e)("Enabled"):i.unref(e)("Disabled")),3)])])])):i.createCommentVNode("",!0),((w=(f=o.value)==null?void 0:f.userSettings)==null?void 0:w.notifications)!==void 0?(i.openBlock(),i.createElementBlock("tr",oM,[i.createElementVNode("td",iM,[i.createElementVNode("div",nM,i.toDisplayString(i.unref(e)("Notifications")),1)]),i.createElementVNode("td",aM,[i.createElementVNode("div",lM,[i.createElementVNode("span",{class:i.normalizeClass(["pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium",o.value.userSettings.notifications?"bg-green-100 text-green-800":"bg-red-100 text-red-800"])},i.toDisplayString(o.value.userSettings.notifications?i.unref(e)("Enabled"):i.unref(e)("Disabled")),3)])])])):i.createCommentVNode("",!0)])])])])])):i.createCommentVNode("",!0),o.value&&o.value.pageBuilderLogo&&!i.unref(er)(o.value.pageBuilderLogo)?(i.openBlock(),i.createElementBlock("div",sM,[i.createElementVNode("h4",pM,i.toDisplayString(i.unref(e)("Logo Configuration")),1),i.createElementVNode("div",dM,[i.createElementVNode("div",cM,[i.createElementVNode("table",mM,[i.createElementVNode("thead",bM,[i.createElementVNode("tr",null,[i.createElementVNode("th",xM,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",gM,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",uM,[i.createElementVNode("tr",null,[i.createElementVNode("td",hM,[i.createElementVNode("div",fM,i.toDisplayString(i.unref(e)("Logo")),1)]),i.createElementVNode("td",yM,[i.createElementVNode("div",wM,[i.createElementVNode("div",vM,[i.createElementVNode("img",{class:"pbx-h-4",src:o.value.pageBuilderLogo.src,alt:"Logo"},null,8,kM)])])])]),i.createElementVNode("tr",null,[i.createElementVNode("td",SM,[i.createElementVNode("div",CM,i.toDisplayString(i.unref(e)("Logo URL")),1)]),i.createElementVNode("td",EM,[i.createElementVNode("div",TM,[i.createElementVNode("div",MM,[i.createElementVNode("div",NM,[i.createElementVNode("div",PM,[i.createElementVNode("span",LM,i.toDisplayString(o.value.pageBuilderLogo.src),1)])])])])])])])])])])])):i.createCommentVNode("",!0),(y=o.value)!=null&&y.updateOrCreate&&!i.unref(er)(o.value.updateOrCreate)?(i.openBlock(),i.createElementBlock("div",BM,[i.createElementVNode("h4",AM,i.toDisplayString(i.unref(e)("Form Type")),1),i.createElementVNode("div",DM,[i.createElementVNode("div",VM,[i.createElementVNode("table",zM,[i.createElementVNode("thead",IM,[i.createElementVNode("tr",null,[i.createElementVNode("th",OM,i.toDisplayString(i.unref(e)("Mode")),1),i.createElementVNode("th",_M,i.toDisplayString(i.unref(e)("Description")),1)])]),i.createElementVNode("tbody",HM,[i.createElementVNode("tr",null,[i.createElementVNode("td",RM,[i.createElementVNode("div",jM,i.toDisplayString(i.unref(e)("Form Type")),1)]),i.createElementVNode("td",FM,[i.createElementVNode("div",qM,[i.createElementVNode("span",{class:i.normalizeClass(["pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium",o.value.updateOrCreate.formType==="create"?"bg-green-100 text-green-800":"bg-blue-100 text-blue-800"])},[o.value&&o.value.updateOrCreate.formType==="create"?(i.openBlock(),i.createElementBlock("span",UM,i.toDisplayString(o.value.updateOrCreate.formType),1)):i.createCommentVNode("",!0),o.value&&o.value.updateOrCreate.formType==="update"?(i.openBlock(),i.createElementBlock("span",WM,i.toDisplayString(o.value.updateOrCreate.formType),1)):i.createCommentVNode("",!0)],2)])])]),o.value.updateOrCreate.formName&&o.value.updateOrCreate.formName.length>0?(i.openBlock(),i.createElementBlock("tr",GM,[i.createElementVNode("td",KM,[i.createElementVNode("div",JM,i.toDisplayString(i.unref(e)("Form Name")),1)]),i.createElementVNode("td",YM,[i.createElementVNode("div",XM,[i.createElementVNode("span",QM,i.toDisplayString(o.value.updateOrCreate.formName),1)])])])):i.createCommentVNode("",!0)])])])])])):i.createCommentVNode("",!0)])])]),i.createElementVNode("div",ZM,[i.createElementVNode("div",$M,[i.createElementVNode("h3",eN,i.toDisplayString(i.unref(e)("Complete Configuration Overview")),1),i.createElementVNode("p",tN,i.toDisplayString(i.unref(e)("Complete configuration object currently used by the Page Builder. Includes user information, branding settings, and other context-specific data needed for rendering and managing the builder environment.")),1)]),i.createElementVNode("div",rN,[i.createElementVNode("div",oN,[i.createElementVNode("div",iN,[i.createElementVNode("div",nN,i.toDisplayString(i.unref(e)("Configuration")),1)])]),i.createElementVNode("div",aN,[i.createElementVNode("p",lN," config: "+i.toDisplayString(JSON.stringify(o.value,null,4)),1)])])])])}}}),pN={key:0,class:"pbx-fixed pbx-inset-0 pbx-z-[9999]"},dN={class:"pbx-flex pbx-gap-2 pbx-justify-between pbx-items-center pbx-py-2 pbx-px-2 pbx-mb-2 pbx-border-b pbx-border-gray-200"},cN={class:"pbx-myQuaternaryHeader pbx-my-0 pbx-py-0 pbx-text-black"},mN={class:"pbx-pt-4 pbx-px-2"},Q3=i.defineComponent({__name:"FloatingSidePanel",props:{title:{type:String,required:!1,default:null},showSidebarPanel:{type:Boolean,default:!1},position:{type:String,required:!0,default:"right",validator(r){const t=["left","right"].includes(r);return t||console.warn(`Invalid prop: position must be 'left' or 'right', got '${r}'`),t}},closeOnOverlayClick:{type:Boolean,default:!0}},emits:["closeSidebarPanel"],setup(r,{emit:e}){const t=r,o=e,n=()=>{o("closeSidebarPanel")},a=()=>{t.closeOnOverlayClick&&n()};return(l,s)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"popup-fade"},{default:i.withCtx(()=>[r.showSidebarPanel?(i.openBlock(),i.createElementBlock("div",pN,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-fixed pbx-inset-0 pbx-bg-black pbx-opacity-20 pbx-z-40",{"pbx-pointer-events-none":!r.closeOnOverlayClick}]),onClick:a},null,2),i.createElementVNode("div",{class:i.normalizeClass(["pbx-font-sans pbx-fixed pbx-top-0 pbx-rounded-3xl pbx-py-2 pbx-px-2 pbx-border pbx-border-gray-200 pbx-max-h-[80vh] lg:pbx-min-h-[98%] pbx-min-h-[80vh] lg:pbx-min-w-96 lg:pbx-w-96 pbx-w-[96%] pbx-overflow-y-auto pbx-z-50 pbx-bg-white lg:pbx-mt-2 pbx-mt-2",[r.position==="left"?"pbx-left-0 pbx-ml-[1%]":"",r.position==="right"?"pbx-right-0 pbx-mr-[1%]":""]]),onClick:s[0]||(s[0]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",dN,[i.createElementVNode("span",cN,i.toDisplayString(r.title),1),i.createElementVNode("span",{onClick:n},[...s[1]||(s[1]=[i.createElementVNode("div",{class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-text-black"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," close ")],-1)])])]),i.createElementVNode("div",mN,[i.renderSlot(l.$slots,"default")])],2)])):i.createCommentVNode("",!0)]),_:3})]))}}),bN={class:"pbx-flex pbx-flex-col pbx-items-center pbx-justify-center pbx-myPrimaryGap"},xN={class:"pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center pbx-relative"},gN={class:"pbx-overflow-y-auto"},uN={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2"},hN={class:"pbx-lg:pbx-text-base pbx-text-sm pbx-font-semibold pbx-text-center pbx-min-h-14 pbx-flex pbx-justify-center pbx-items-center"},fN={class:"pbx-bg-gray-100 pbx-rounded-full pbx-w-32 pbx-h-32 pbx-flex pbx-items-center pbx-justify-center"},yN={class:"pbx-text-center"},wN={class:"pbx-lg:pbx-text-7xl pbx-text-5xl"},vN={key:0,class:"pbx-w-full pbx-space-y-6"},kN={class:"pbx-text-xl pbx-font-semibold pbx-mb-4 pbx-text-center"},SN={class:"pbx-text-sm pbx-font-semibold pbx-uppercase pbx-tracking-widest pbx-text-gray-400 pbx-mb-3 pbx-px-1"},CN={class:"pbx-space-y-3"},EN={class:"pbx-flex-shrink-0 pbx-mt-1"},TN={key:0,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-myPrimaryLinkColor pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-white hover:pbx-text-white"},MN={key:1,class:"pbx-select-none pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-myPrimaryErrorColor pbx-aspect-square hover:pbx-bg-myPrimaryErrorColor hover:pbx-text-white pbx-text-white"},NN={class:"pbx-flex-1"},PN={class:"pbx-text-sm pbx-text-gray-600"},LN={key:1,class:"pbx-text-gray-500 pbx-text-center"},BN={class:"pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center"},AN=i.defineComponent({__name:"ComponentTopMenu",setup(r){const{translate:e}=re(),t=ce(),o=i.ref(!1),n=i.ref(!1),a=i.ref(""),l=i.ref(1),s=i.ref(""),p=i.ref(""),d=i.ref(""),c=i.ref(null),m=i.ref(null),b=i.ref(null),x=i.ref(null),g=i.ref(null),u=function(){n.value=!0,a.value="delete",l.value=2,s.value=e("Remove all Components"),p.value=e("Are you sure you want to remove all Components?"),d.value=e("Close"),c.value=null,m.value=e("Delete"),b.value=function(){n.value=!1},x.value=function(){},g.value=async function(){o.value=!0,await t.clearHtmlSelection(),await t.handleFormSubmission(),await se(500),n.value=!1,o.value=!1}},h=i.ref(!1),f=function(){h.value=!1},w=function(){h.value=!0},y=i.ref(null),S=i.ref(!1),E=i.computed(()=>{if(!y.value)return[];const N=new Map;for(const C of y.value.checks){const A=C.category??"Other";N.has(A)||N.set(A,[]),N.get(A).push(C)}return Array.from(N.entries()).map(([C,A])=>({title:C,checks:A}))}),P=async function(){S.value=!S.value,S.value&&(y.value=await t.analyzeSEO())},k=function(){S.value=!1};return(N,C)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",bN,[i.createElementVNode("div",xN,[i.createElementVNode("div",{onClick:P,"pbx-bg-myPrimaryLinkColor":"",class:i.normalizeClass(["pbx-select-none pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white",{"pbx-bg-myPrimaryLinkColor pbx-text-white":S.value}])},[...C[4]||(C[4]=[i.createElementVNode("div",{class:"pbx-font-semibold pbx-text-sm"},"SEO",-1)])],2),i.createVNode(Q3,{title:"SEO",showSidebarPanel:S.value,onCloseSidebarPanel:k,position:"left"},{default:i.withCtx(()=>[i.createElementVNode("div",gN,[i.createElementVNode("div",null,[i.createElementVNode("div",uN,[i.createElementVNode("div",hN,[y.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:"pbx-relative pbx-my-4 pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center pbx-w-36 pbx-h-36",style:i.normalizeStyle({background:`conic-gradient(${y.value.score<50?"#ef4444":"#50C878"} ${y.value.score}%, #e5e7eb 0)`})},[i.createElementVNode("div",fN,[i.createElementVNode("div",yN,[i.createElementVNode("span",wN,i.toDisplayString(y.value.score),1),C[5]||(C[5]=i.createElementVNode("span",{class:"pbx-text-xl"},"%",-1))])])],4)):i.createCommentVNode("",!0)])]),E.value.length?(i.openBlock(),i.createElementBlock("div",vN,[i.createElementVNode("h3",kN,i.toDisplayString(i.unref(e)("SEO Check Results")),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.value,A=>(i.openBlock(),i.createElementBlock("div",{key:A.title},[i.createElementVNode("h4",SN,i.toDisplayString(i.unref(e)(A.title)),1),i.createElementVNode("ul",CN,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.checks,(T,v)=>(i.openBlock(),i.createElementBlock("li",{key:v,class:i.normalizeClass(["pbx-flex pbx-items-start pbx-gap-4 pbx-p-4 pbx-bg-white pbx-rounded-lg pbx-border-solid pbx-border-2",T.passed?"pbx-border-emerald-500":"pbx-border-red-600"])},[i.createElementVNode("div",EN,[T.passed?(i.openBlock(),i.createElementBlock("div",TN,[...C[6]||(C[6]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," check ",-1)])])):i.createCommentVNode("",!0),T.passed?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",MN,[...C[7]||(C[7]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," check_indeterminate_small ",-1)])]))]),i.createElementVNode("div",NN,[i.createElementVNode("p",{class:i.normalizeClass(["pbx-text-lg pbx-font-medium",T.passed?"pbx-text-green-700":"pbx-text-red-700"])},i.toDisplayString(i.unref(e)(T.check)),3),i.createElementVNode("p",PN,i.toDisplayString(T.details),1)])],2))),128))])]))),128))])):(i.openBlock(),i.createElementBlock("div",LN,i.toDisplayString(i.unref(e)("No SEO checks available.")),1))])])]),_:1},8,["showSidebarPanel"])]),i.createElementVNode("div",{class:"pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center"},[i.createElementVNode("div",{onClick:u,class:"pbx-select-none pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryErrorColor hover:pbx-text-white pbx-text-myPrimaryErrorColor"},[...C[8]||(C[8]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," delete_forever ",-1)])])]),C[10]||(C[10]=i.createElementVNode("div",{class:"pbx-w-full pbx-border-t pbx-border-solid pbx-border-gray-200"},null,-1)),i.createElementVNode("div",BN,[i.createElementVNode("div",{onClick:C[0]||(C[0]=async()=>{await i.unref(t).clearHtmlSelection(),w()}),class:"pbx-select-none pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},[...C[9]||(C[9]=[i.createElementVNode("svg",{fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",class:"css-1a6490m"},[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M15.192 5.393A6.965 6.965 0 0012 4.071V2h-2v2.07a6.964 6.964 0 00-3.192 1.323L5.344 3.93 3.93 5.343l1.464 1.464A6.964 6.964 0 004.07 10H2v2h2.07a6.964 6.964 0 001.324 3.193L3.93 16.657l1.414 1.414 1.464-1.464A6.964 6.964 0 0010 17.929V20h2v-2.07a6.964 6.964 0 003.192-1.323l1.465 1.464 1.414-1.414-1.465-1.465A6.964 6.964 0 0017.93 12H20v-2h-2.07a6.963 6.963 0 00-1.324-3.193l1.464-1.464-1.414-1.414-1.464 1.464zM11 16a5 5 0 100-10 5 5 0 000 10z","fill-rule":"evenodd"})],-1)])])])]),i.createVNode(gt,{showDynamicModalBuilder:n.value,type:a.value,gridColumnAmount:l.value,title:s.value,description:p.value,isLoading:o.value,firstButtonText:d.value,secondButtonText:c.value??void 0,thirdButtonText:m.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:C[1]||(C[1]=()=>{var A;return(A=b.value)==null?void 0:A.call(b)}),onSecondModalButtonFunctionDynamicModalBuilder:C[2]||(C[2]=()=>{var A;return(A=x.value)==null?void 0:A.call(x)}),onThirdModalButtonFunctionDynamicModalBuilder:C[3]||(C[3]=()=>{var A;return(A=g.value)==null?void 0:A.call(g)})},{default:i.withCtx(()=>[...C[11]||(C[11]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","type","gridColumnAmount","title","description","isLoading","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode($e,{maxWidth:"5xl",showModalBuilder:h.value,title:"Main Settings",onCloseMainModalBuilder:f,minHeight:"",maxHeight:""},{default:i.withCtx(()=>[i.createVNode(sN)]),_:1},8,["showModalBuilder"])]))}});function Me(r){this.content=r}Me.prototype={constructor:Me,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var o=t&&t!=r?this.remove(t):this,n=o.find(r),a=o.content.slice();return n==-1?a.push(t||r,e):(a[n+1]=e,t&&(a[n]=t)),new Me(a)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Me(t)},addToStart:function(r,e){return new Me([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Me(t)},addBefore:function(r,e,t){var o=this.remove(e),n=o.content.slice(),a=o.find(r);return n.splice(a==-1?n.length:a,0,e,t),new Me(n)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Me.from(r),r.size?new Me(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Me.from(r),r.size?new Me(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Me.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}},Me.from=function(r){if(r instanceof Me)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Me(e)};function Z3(r,e,t){for(let o=0;;o++){if(o==r.childCount||o==e.childCount)return r.childCount==e.childCount?null:t;let n=r.child(o),a=e.child(o);if(n==a){t+=n.nodeSize;continue}if(!n.sameMarkup(a))return t;if(n.isText&&n.text!=a.text){let l=n.text,s=a.text,p=0;for(;l[p]==s[p];p++)t++;return p&&p<l.length&&p<s.length&&t4(l.charCodeAt(p-1))&&e4(l.charCodeAt(p))&&t--,t}if(n.content.size||a.content.size){let l=Z3(n.content,a.content,t+1);if(l!=null)return l}t+=n.nodeSize}}function $3(r,e,t,o){for(let n=r.childCount,a=e.childCount;;){if(n==0||a==0)return n==a?null:{a:t,b:o};let l=r.child(--n),s=e.child(--a),p=l.nodeSize;if(l==s){t-=p,o-=p;continue}if(!l.sameMarkup(s))return{a:t,b:o};if(l.isText&&l.text!=s.text){let d=l.text,c=s.text,m=d.length,b=c.length;for(;m>0&&b>0&&d[m-1]==c[b-1];)m--,b--,t--,o--;return m&&b&&m<d.length&&t4(d.charCodeAt(m-1))&&e4(d.charCodeAt(m))&&(t++,o++),{a:t,b:o}}if(l.content.size||s.content.size){let d=$3(l.content,s.content,t-1,o-1);if(d)return d}t-=p,o-=p}}function e4(r){return r>=56320&&r<57344}function t4(r){return r>=55296&&r<56320}let I=class We{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let o=0;o<e.length;o++)this.size+=e[o].nodeSize}nodesBetween(e,t,o,n=0,a){for(let l=0,s=0;s<t;l++){let p=this.content[l],d=s+p.nodeSize;if(d>e&&o(p,n+s,a||null,l)!==!1&&p.content.size){let c=s+1;p.nodesBetween(Math.max(0,e-c),Math.min(p.content.size,t-c),o,n+c)}s=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,o,n){let a="",l=!0;return this.nodesBetween(e,t,(s,p)=>{let d=s.isText?s.text.slice(Math.max(e,p)-p,t-p):s.isLeaf?n?typeof n=="function"?n(s):n:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&d||s.isTextblock)&&o&&(l?l=!1:a+=o),a+=d},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,o=e.firstChild,n=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(o)&&(n[n.length-1]=t.withText(t.text+o.text),a=1);a<e.content.length;a++)n.push(e.content[a]);return new We(n,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let o=[],n=0;if(t>e)for(let a=0,l=0;l<t;a++){let s=this.content[a],p=l+s.nodeSize;p>e&&((l<e||p>t)&&(s.isText?s=s.cut(Math.max(0,e-l),Math.min(s.text.length,t-l)):s=s.cut(Math.max(0,e-l-1),Math.min(s.content.size,t-l-1))),o.push(s),n+=s.nodeSize),l=p}return new We(o,n)}cutByIndex(e,t){return e==t?We.empty:e==0&&t==this.content.length?this:new We(this.content.slice(e,t))}replaceChild(e,t){let o=this.content[e];if(o==t)return this;let n=this.content.slice(),a=this.size+t.nodeSize-o.nodeSize;return n[e]=t,new We(n,a)}addToStart(e){return new We([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new We(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,o=0;t<this.content.length;t++){let n=this.content[t];e(n,o,t),o+=n.nodeSize}}findDiffStart(e,t=0){return Z3(this,e,t)}findDiffEnd(e,t=this.size,o=e.size){return $3(this,e,t,o)}findIndex(e){if(e==0)return cn(0,e);if(e==this.size)return cn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,o=0;;t++){let n=this.child(t),a=o+n.nodeSize;if(a>=e)return a==e?cn(t+1,a):cn(t,o);o=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 We.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return We.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return We.empty;let t,o=0;for(let n=0;n<e.length;n++){let a=e[n];o+=a.nodeSize,n&&a.isText&&e[n-1].sameMarkup(a)?(t||(t=e.slice(0,n)),t[t.length-1]=a.withText(t[t.length-1].text+a.text)):t&&t.push(a)}return new We(t||e,o)}static from(e){if(!e)return We.empty;if(e instanceof We)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new We([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};I.empty=new I([],0);const ml={index:0,offset:0};function cn(r,e){return ml.index=r,ml.offset=e,ml}function mn(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let o=0;o<r.length;o++)if(!mn(r[o],e[o]))return!1}else{for(let o in r)if(!(o in e)||!mn(r[o],e[o]))return!1;for(let o in e)if(!(o in r))return!1}return!0}let te=class Ap{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,o=!1;for(let n=0;n<e.length;n++){let a=e[n];if(this.eq(a))return e;if(this.type.excludes(a.type))t||(t=e.slice(0,n));else{if(a.type.excludes(this.type))return e;!o&&a.type.rank>this.type.rank&&(t||(t=e.slice(0,n)),t.push(this),o=!0),t&&t.push(a)}}return t||(t=e.slice()),o||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&&mn(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 o=e.marks[t.type];if(!o)throw new RangeError(`There is no mark type ${t.type} in this schema`);let n=o.create(t.attrs);return o.checkAttrs(n.attrs),n}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let o=0;o<e.length;o++)if(!e[o].eq(t[o]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ap.none;if(e instanceof Ap)return[e];let t=e.slice();return t.sort((o,n)=>o.type.rank-n.type.rank),t}};te.none=[];let Go=class extends Error{},H=class Ro{constructor(e,t,o){this.content=e,this.openStart=t,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let o=o4(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return o&&new Ro(o,this.openStart,this.openEnd)}removeBetween(e,t){return new Ro(r4(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 Ro.empty;let o=t.openStart||0,n=t.openEnd||0;if(typeof o!="number"||typeof n!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ro(I.fromJSON(e,t.content),o,n)}static maxOpen(e,t=!0){let o=0,n=0;for(let a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)o++;for(let a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)n++;return new Ro(e,o,n)}};H.empty=new H(I.empty,0,0);function r4(r,e,t){let{index:o,offset:n}=r.findIndex(e),a=r.maybeChild(o),{index:l,offset:s}=r.findIndex(t);if(n==e||a.isText){if(s!=t&&!r.child(l).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(o!=l)throw new RangeError("Removing non-flat range");return r.replaceChild(o,a.copy(r4(a.content,e-n-1,t-n-1)))}function o4(r,e,t,o,n,a){let{index:l,offset:s}=r.findIndex(e),p=r.maybeChild(l);if(s==e||p.isText)return a&&o<=0&&n<=0&&!a.canReplace(l,l,t)?null:r.cut(0,e).append(t).append(r.cut(e));let d=o4(p.content,e-s-1,t,l==0?o-1:0,l==r.childCount-1?n-1:0,p);return d&&r.replaceChild(l,p.copy(d))}function DN(r,e,t){if(t.openStart>r.depth)throw new Go("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new Go("Inconsistent open depths");return i4(r,e,t,0)}function i4(r,e,t,o){let n=r.index(o),a=r.node(o);if(n==e.index(o)&&o<r.depth-t.openStart){let l=i4(r,e,t,o+1);return a.copy(a.content.replaceChild(n,l))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==o&&e.depth==o){let l=r.parent,s=l.content;return Mr(l,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:l,end:s}=VN(t,r);return Mr(a,a4(r,l,s,e,o))}else return Mr(a,bn(r,e,o))}function n4(r,e){if(!e.type.compatibleContent(r.type))throw new Go("Cannot join "+e.type.name+" onto "+r.type.name)}function bl(r,e,t){let o=r.node(t);return n4(o,e.node(t)),o}function Tr(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function Ko(r,e,t,o){let n=(e||r).node(t),a=0,l=e?e.index(t):n.childCount;r&&(a=r.index(t),r.depth>t?a++:r.textOffset&&(Tr(r.nodeAfter,o),a++));for(let s=a;s<l;s++)Tr(n.child(s),o);e&&e.depth==t&&e.textOffset&&Tr(e.nodeBefore,o)}function Mr(r,e){if(!r.type.validContent(e))throw new Go("Invalid content for node "+r.type.name);return r.copy(e)}function a4(r,e,t,o,n){let a=r.depth>n&&bl(r,e,n+1),l=o.depth>n&&bl(t,o,n+1),s=[];return Ko(null,r,n,s),a&&l&&e.index(n)==t.index(n)?(n4(a,l),Tr(Mr(a,a4(r,e,t,o,n+1)),s)):(a&&Tr(Mr(a,bn(r,e,n+1)),s),Ko(e,t,n,s),l&&Tr(Mr(l,bn(t,o,n+1)),s)),Ko(o,null,n,s),new I(s)}function bn(r,e,t){let o=[];if(Ko(null,r,t,o),r.depth>t){let n=bl(r,e,t+1);Tr(Mr(n,bn(r,e,t+1)),o)}return Ko(e,null,t,o),new I(o)}function VN(r,e){let t=e.depth-r.openStart,n=e.node(t).copy(r.content);for(let a=t-1;a>=0;a--)n=e.node(a).copy(I.from(n));return{start:n.resolveNoCache(r.openStart+t),end:n.resolveNoCache(n.content.size-r.openEnd-t)}}class Jo{constructor(e,t,o){this.pos=e,this.path=t,this.parentOffset=o,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 o=this.pos-this.path[this.path.length-1],n=e.child(t);return o?e.child(t).cut(o):n}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 o=this.path[t*3],n=t==0?0:this.path[t*3-1]+1;for(let a=0;a<e;a++)n+=o.child(a).nodeSize;return n}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return te.none;if(this.textOffset)return e.child(t).marks;let o=e.maybeChild(t-1),n=e.maybeChild(t);if(!o){let s=o;o=n,n=s}let a=o.marks;for(var l=0;l<a.length;l++)a[l].type.spec.inclusive===!1&&(!n||!a[l].isInSet(n.marks))&&(a=a[l--].removeFromSet(a));return a}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let o=t.marks,n=e.parent.maybeChild(e.index());for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!n||!o[a].isInSet(n.marks))&&(o=o[a--].removeFromSet(o));return o}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 o=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);o>=0;o--)if(e.pos<=this.end(o)&&(!t||t(this.node(o))))return new xn(this,e,o);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 o=[],n=0,a=t;for(let l=e;;){let{index:s,offset:p}=l.content.findIndex(a),d=a-p;if(o.push(l,s,n+p),!d||(l=l.child(s),l.isText))break;a=d-1,n+=p+1}return new Jo(t,o,a)}static resolveCached(e,t){let o=l4.get(e);if(o)for(let a=0;a<o.elts.length;a++){let l=o.elts[a];if(l.pos==t)return l}else l4.set(e,o=new zN);let n=o.elts[o.i]=Jo.resolve(e,t);return o.i=(o.i+1)%IN,n}}class zN{constructor(){this.elts=[],this.i=0}}const IN=12,l4=new WeakMap;class xn{constructor(e,t,o){this.$from=e,this.$to=t,this.depth=o}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 ON=Object.create(null);let tr=class Dp{constructor(e,t,o,n=te.none){this.type=e,this.attrs=t,this.marks=n,this.content=o||I.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,o,n=0){this.content.nodesBetween(e,t,o,n,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,o,n){return this.content.textBetween(e,t,o,n)}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,o){return this.type==e&&mn(this.attrs,t||e.defaultAttrs||ON)&&te.sameSet(this.marks,o||te.none)}copy(e=null){return e==this.content?this:new Dp(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Dp(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,o=!1){if(e==t)return H.empty;let n=this.resolve(e),a=this.resolve(t),l=o?0:n.sharedDepth(t),s=n.start(l),d=n.node(l).content.cut(n.pos-s,a.pos-s);return new H(d,n.depth-l,a.depth-l)}replace(e,t,o){return DN(this.resolve(e),this.resolve(t),o)}nodeAt(e){for(let t=this;;){let{index:o,offset:n}=t.content.findIndex(e);if(t=t.maybeChild(o),!t)return null;if(n==e||t.isText)return t;e-=n+1}}childAfter(e){let{index:t,offset:o}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:o}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:o}=this.content.findIndex(e);if(o<e)return{node:this.content.child(t),index:t,offset:o};let n=this.content.child(t-1);return{node:n,index:t-1,offset:o-n.nodeSize}}resolve(e){return Jo.resolveCached(this,e)}resolveNoCache(e){return Jo.resolve(this,e)}rangeHasMark(e,t,o){let n=!1;return t>e&&this.nodesBetween(e,t,a=>(o.isInSet(a.marks)&&(n=!0),!n)),n}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()+")"),s4(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,o=I.empty,n=0,a=o.childCount){let l=this.contentMatchAt(e).matchFragment(o,n,a),s=l&&l.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let p=n;p<a;p++)if(!this.type.allowsMarks(o.child(p).marks))return!1;return!0}canReplaceWith(e,t,o,n){if(n&&!this.type.allowsMarks(n))return!1;let a=this.contentMatchAt(e).matchType(o),l=a&&a.matchFragment(this.content,t);return l?l.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),this.type.checkAttrs(this.attrs);let e=te.none;for(let t=0;t<this.marks.length;t++){let o=this.marks[t];o.type.checkAttrs(o.attrs),e=o.addToSet(e)}if(!te.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 o;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=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,o)}let n=I.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,n,o);return a.type.checkAttrs(a.attrs),a}};tr.prototype.text=void 0;class gn extends tr{constructor(e,t,o,n){if(super(e,t,null,n),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):s4(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 gn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new gn(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 s4(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class Nr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let o=new _N(e,t);if(o.next==null)return Nr.empty;let n=p4(o);o.next&&o.err("Unexpected trailing text");let a=WN(UN(n));return GN(a,o),a}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,o=e.childCount){let n=this;for(let a=t;n&&a<o;a++)n=n.matchType(e.child(a).type);return n}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 o=0;o<e.next.length;o++)if(this.next[t].type==e.next[o].type)return!0;return!1}fillBefore(e,t=!1,o=0){let n=[this];function a(l,s){let p=l.matchFragment(e,o);if(p&&(!t||p.validEnd))return I.from(s.map(d=>d.createAndFill()));for(let d=0;d<l.next.length;d++){let{type:c,next:m}=l.next[d];if(!(c.isText||c.hasRequiredAttrs())&&n.indexOf(m)==-1){n.push(m);let b=a(m,s.concat(c));if(b)return b}}return null}return a(this,[])}findWrapping(e){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==e)return this.wrapCache[o+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let n=o.shift(),a=n.match;if(a.matchType(e)){let l=[];for(let s=n;s.type;s=s.via)l.push(s.type);return l.reverse()}for(let l=0;l<a.next.length;l++){let{type:s,next:p}=a.next[l];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!n.type||p.validEnd)&&(o.push({match:s.contentMatch,type:s,via:n}),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(o){e.push(o);for(let n=0;n<o.next.length;n++)e.indexOf(o.next[n].next)==-1&&t(o.next[n].next)}return t(this),e.map((o,n)=>{let a=n+(o.validEnd?"*":" ")+" ";for(let l=0;l<o.next.length;l++)a+=(l?", ":"")+o.next[l].type.name+"->"+e.indexOf(o.next[l].next);return a}).join(`
|
|
21
|
+
This will fail in production.`);s=Uo,s._s.has(o)||(a?dl(o,e,n,s):Y3(o,n,s),process.env.NODE_ENV!=="production"&&(l._pinia=s));const c=s._s.get(o);if(process.env.NODE_ENV!=="production"&&p){const m="__hot:"+o,b=a?dl(m,e,n,s,!0):Y3(m,it({},n),s,!0);p._hotUpdate(b),delete s.state.value[m],s._s.delete(m)}if(process.env.NODE_ENV!=="production"&&Zt){const m=i.getCurrentInstance();if(m&&m.proxy&&!p){const b=m.proxy,x="_pStores"in b?b._pStores:b._pStores={};x[o]=c}}return c}return l.$id=o,l}const X3=T8("pageBuilderState",{state:()=>({componentArrayAddMethod:null,localStorageItemName:null,showModalTipTap:!1,menuRight:!0,borderStyle:null,borderWidth:null,borderColor:null,borderRadiusGlobal:null,borderRadiusTopLeft:null,borderRadiusTopRight:null,borderRadiusBottomleft:null,borderRadiusBottomRight:null,elementContainsHyperlink:null,hyperlinkAbility:null,hyperlinkInput:null,hyperlinkMessage:null,hyperlinkError:null,hyberlinkEnable:!1,openHyperlinkinkInNewTab:null,opacity:null,backgroundOpacity:null,textAreaVueModel:null,currentClasses:[],currentStyles:{},fontVerticalPadding:null,fontHorizontalPadding:null,fontTopPadding:null,fontRightPadding:null,fontBottomPadding:null,fontLeftPadding:null,fontVerticalMargin:null,fontHorizontalMargin:null,fontTopMargin:null,fontRightMargin:null,fontBottomMargin:null,fontLeftMargin:null,fontStyle:null,fontFamily:null,fontWeight:null,fontBase:null,fontDesktop:null,fontTablet:null,fontMobile:null,backgroundColor:null,textColor:null,element:null,component:null,components:[],basePrimaryImage:null,imageObjectFit:null,imageObjectPosition:null,imageAspectRatio:null,imageSettingsPanelOpen:!1,configPageBuilder:null,showModalHTMLEditor:!1,toggleGlobalHtmlMode:!1,applyImageToSelection:{src:""},currentPreviewImage:null,builderStarted:!1,isLoadingGlobal:!0,isSaving:!1,hasLocalDraftForUpdate:!1,isResumeEditing:!1,isRestoring:!1,currentLanguage:null,historyIndex:-1,historyLength:0,addComponentAddIndex:null}),getters:{getComponentArrayAddMethod(r){return r.componentArrayAddMethod},getLocalStorageItemName(r){return r.localStorageItemName},getShowModalTipTap(r){return r.showModalTipTap},getMenuRight(r){return r.menuRight},getBorderStyle(r){return r.borderStyle},getBorderWidth(r){return r.borderWidth},getBorderColor(r){return r.borderColor},getBorderRadiusGlobal(r){return r.borderRadiusGlobal},getBorderRadiusTopLeft(r){return r.borderRadiusTopLeft},getBorderRadiusTopRight(r){return r.borderRadiusTopRight},getBorderRadiusBottomleft(r){return r.borderRadiusBottomleft},getBorderRadiusBottomRight(r){return r.borderRadiusBottomRight},getElementContainsHyperlink(r){return r.elementContainsHyperlink},getHyperlinkAbility(r){return r.hyperlinkAbility},getHyperlinkInput(r){return r.hyperlinkInput},getHyperlinkMessage(r){return r.hyperlinkMessage},getHyperlinkError(r){return r.hyperlinkError},getHyberlinkEnable(r){return r.hyberlinkEnable},getOpenHyperlinkInNewTab(r){return r.openHyperlinkinkInNewTab},getOpacity(r){return r.opacity},getBackgroundOpacity(r){return r.backgroundOpacity},getTextAreaVueModel(r){return r.textAreaVueModel},getCurrentClasses(r){return r.currentClasses},getCurrentStyles(r){return r.currentStyles},getFontStyle(r){return r.fontStyle},getFontVerticalPadding(r){return r.fontVerticalPadding},getFontHorizontalPadding(r){return r.fontHorizontalPadding},getFontTopPadding(r){return r.fontTopPadding},getFontRightPadding(r){return r.fontRightPadding},getFontBottomPadding(r){return r.fontBottomPadding},getFontLeftPadding(r){return r.fontLeftPadding},getFontVerticalMargin(r){return r.fontVerticalMargin},getFontHorizontalMargin(r){return r.fontHorizontalMargin},getFontTopMargin(r){return r.fontTopMargin},getFontRightMargin(r){return r.fontRightMargin},getFontBottomMargin(r){return r.fontBottomMargin},getFontLeftMargin(r){return r.fontLeftMargin},getFontFamily(r){return r.fontFamily},getFontWeight(r){return r.fontWeight},getFontBase(r){return r.fontBase},getFontDesktop(r){return r.fontDesktop},getFontTablet(r){return r.fontTablet},getFontMobile(r){return r.fontMobile},getBackgroundColor(r){return r.backgroundColor},getTextColor(r){return r.textColor},getElement(r){return r.element},getComponent(r){return r.component},getComponents(r){return r.components},getBasePrimaryImage(r){return r.basePrimaryImage},getImageObjectFit(r){return r.imageObjectFit},getImageObjectPosition(r){return r.imageObjectPosition},getImageAspectRatio(r){return r.imageAspectRatio},getImageSettingsPanelOpen(r){return r.imageSettingsPanelOpen},getPageBuilderConfig(r){return r.configPageBuilder},getShowModalHTMLEditor(r){return r.showModalHTMLEditor},getToggleGlobalHtmlMode(r){return r.toggleGlobalHtmlMode},getApplyImageToSelection(r){return r.applyImageToSelection},getCurrentPreviewImage(r){return r.currentPreviewImage},getBuilderStarted:r=>r.builderStarted,getIsLoadingGlobal:r=>r.isLoadingGlobal,getIsSaving:r=>r.isSaving,getHasLocalDraftForUpdate:r=>r.hasLocalDraftForUpdate,getIsLoadingResumeEditing:r=>r.isResumeEditing,getIsRestoring:r=>r.isRestoring,getCurrentLanguage:r=>r.currentLanguage,getHistoryIndex:r=>r.historyIndex,getHistoryLength:r=>r.historyLength,getAddComponentAddIndex:r=>r.addComponentAddIndex},actions:{setComponentArrayAddMethod(r){this.componentArrayAddMethod=r},setLocalStorageItemName(r){this.localStorageItemName=r},setShowModalTipTap(r){this.showModalTipTap=r},setMenuRight(r){this.menuRight=r},setBorderStyle(r){this.borderStyle=r},setBorderWidth(r){this.borderWidth=r},setBorderColor(r){this.borderColor=r},setBorderRadiusGlobal(r){this.borderRadiusGlobal=r},setBorderRadiusTopLeft(r){this.borderRadiusTopLeft=r},setBorderRadiusTopRight(r){this.borderRadiusTopRight=r},setBorderRadiusBottomleft(r){this.borderRadiusBottomleft=r},setBorderRadiusBottomRight(r){this.borderRadiusBottomRight=r},setElementContainsHyperlink(r){this.elementContainsHyperlink=r},setHyperlinkAbility(r){this.hyperlinkAbility=r},setHyperlinkInput(r){this.hyperlinkInput=r},setHyperlinkMessage(r){this.hyperlinkMessage=r},setHyperlinkError(r){this.hyperlinkError=r},setHyberlinkEnable(r){this.hyberlinkEnable=r},setOpenHyperlinkInNewTab(r){this.openHyperlinkinkInNewTab=r},setOpacity(r){this.opacity=r},setBackgroundOpacity(r){this.backgroundOpacity=r},setTextAreaVueModel(r){this.textAreaVueModel=r},setClass(r){this.currentClasses=[...this.currentClasses,r]},removeClass(r){this.currentClasses=this.currentClasses.filter(e=>e!==r)},setCurrentClasses(r){this.currentClasses=Array.from(r)},setCurrentStyles(r){this.currentStyles=r},setFontVerticalPadding(r){this.fontVerticalPadding=r},setFontHorizontalPadding(r){this.fontHorizontalPadding=r},setFontTopPadding(r){this.fontTopPadding=r},setFontRightPadding(r){this.fontRightPadding=r},setFontBottomPadding(r){this.fontBottomPadding=r},setFontLeftPadding(r){this.fontLeftPadding=r},setFontVerticalMargin(r){this.fontVerticalMargin=r},setFontHorizontalMargin(r){this.fontHorizontalMargin=r},setFontTopMargin(r){this.fontTopMargin=r},setFontRightMargin(r){this.fontRightMargin=r},setFontBottomMargin(r){this.fontBottomMargin=r},setFontLeftMargin(r){this.fontLeftMargin=r},setFontStyle(r){this.fontStyle=r},setFontFamily(r){this.fontFamily=r},setFontWeight(r){this.fontWeight=r},setFontBase(r){this.fontBase=r},setFontDesktop(r){this.fontDesktop=r},setFontTablet(r){this.fontTablet=r},setFontMobile(r){this.fontMobile=r},setBackgroundColor(r){this.backgroundColor=r},setTextColor(r){this.textColor=r},setElement(r){this.element=null,i.nextTick(()=>{this.element=r})},setComponent(r){if(!r){this.element=null,this.component=null;return}this.component=null,i.nextTick(()=>{this.component=r})},setComponents(r){this.components=[],i.nextTick(()=>{this.components=r||[]})},setPushComponents(r){const e=r.componentArrayAddMethod??"push";e==="push"?this.components.push(r.component):e==="unshift"&&this.components.unshift(r.component)},setBasePrimaryImage(r){this.element&&(this.element.src=r??void 0),this.basePrimaryImage=r},setImageObjectFit(r){this.imageObjectFit=r},setImageObjectPosition(r){this.imageObjectPosition=r},setImageAspectRatio(r){this.imageAspectRatio=r},setImageSettingsPanelOpen(r){this.imageSettingsPanelOpen=r},setCurrentLayoutPreview(r){localStorage.setItem("preview",r)},setPageBuilderConfig(r){this.configPageBuilder=r},setShowModalHTMLEditor(r){this.showModalHTMLEditor=r},setToggleGlobalHtmlMode(r){this.toggleGlobalHtmlMode=r},setApplyImageToSelection(r){this.applyImageToSelection=r},setCurrentPreviewImage(r){this.currentPreviewImage=r},setBuilderStarted(r){this.builderStarted=r},setIsLoadingGlobal(r){this.isLoadingGlobal=r},setIsSaving(r){this.isSaving=r},setHasLocalDraftForUpdate(r){this.hasLocalDraftForUpdate=r},setIsLoadingResumeEditing(r){this.isResumeEditing=r},setIsRestoring(r){this.isRestoring=r},setCurrentLanguage(r){this.currentLanguage=r},setHistoryIndex(r){this.historyIndex=r},setHistoryLength(r){this.historyLength=r},setAddComponentAddIndex(r){this.addComponentAddIndex=r}}}),cl=q3(),oe=X3(cl),er=function(r){return!r||typeof r=="object"&&r.constructor===Object&&Object.keys(r).length===0},M8="3.5.11",N8={class:"pbx-w-full pbx-inset-x-0 pbx-h-[90vh] pbx-bg-white pbx-overflow-x-scroll lg:pbx-pt-2 pbx-pt-2"},P8={class:"pbx-mt-4 pbx-mb-4 pbx-py-8 pbx-px-2 pbx-border pbx-border-solid pbx-border-gray-600 pbx-rounded-xl"},L8={class:"pbx-flex pbx-items-left pbx-flex-col pbx-gap-1"},B8={class:"pbx-myQuaternaryHeader"},A8={class:"pbx-myPrimaryParagraph pbx-text-xs"},D8={class:"pbx-px-2"},V8={class:"pbx-mt-8"},z8={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},I8={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},O8={class:"pbx-overflow-x-auto"},_8={class:"pbx-min-w-full"},H8={class:"pbx-bg-gray-50"},R8={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},j8={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},F8={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},q8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},U8={class:"pbx-min-w-[30rem] pbx-w-max"},W8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},G8={class:"pbx-min-w-[30rem] pbx-w-max"},K8={class:"pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium pbx-bg-blue-100 pbx-text-blue-800"},J8={key:0,class:"pbx-mt-4"},Y8={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},X8={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},Q8={class:"pbx-overflow-x-auto"},Z8={class:"pbx-min-w-full"},$8={class:"pbx-bg-gray-50"},e7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},t7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},r7={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},o7={key:0},i7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},n7={class:"pbx-min-w-[30rem] pbx-w-max"},a7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},l7={class:"pbx-min-w-[30rem] pbx-w-max"},s7={key:1},p7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},d7={class:"pbx-min-w-[30rem] pbx-w-max"},c7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},m7={class:"pbx-min-w-[30rem] pbx-w-max"},b7={key:1,class:"pbx-mt-8"},x7={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},g7={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},u7={class:"pbx-overflow-x-auto"},h7={class:"pbx-min-w-full"},f7={class:"pbx-bg-gray-50"},y7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},w7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},v7={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},k7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},S7={class:"pbx-min-w-[30rem] pbx-w-max"},C7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},E7={class:"pbx-min-w-[30rem] pbx-w-max"},T7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},M7={class:"pbx-min-w-[30rem] pbx-w-max"},N7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},P7={class:"pbx-min-w-[30rem] pbx-w-max"},L7={key:0,class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},B7={class:"pbx-min-w-[30rem] pbx-w-max"},A7={class:"pbx-flex pbx-items-center pbx-space-x-3"},D7=["src"],V7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},z7={class:"pbx-min-w-[30rem] pbx-w-max"},I7={key:0,class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},O7={class:"pbx-min-w-[30rem] pbx-w-max"},_7={key:2,class:"pbx-mt-8"},H7={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},R7={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},j7={class:"pbx-overflow-x-auto"},F7={class:"pbx-min-w-full"},q7={class:"pbx-bg-gray-50"},U7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},W7={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},G7={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},K7={key:0},J7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},Y7={class:"pbx-min-w-[30rem] pbx-w-max"},X7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},Q7={class:"pbx-min-w-[30rem] pbx-w-max"},Z7={key:1},$7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},eM={class:"pbx-min-w-[30rem] pbx-w-max"},tM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},rM={class:"pbx-min-w-[30rem] pbx-w-max"},oM={key:2},iM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},nM={class:"pbx-min-w-[30rem] pbx-w-max"},aM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},lM={class:"pbx-min-w-[30rem] pbx-w-max"},sM={key:3,class:"pbx-mt-8"},pM={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},dM={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},cM={class:"pbx-overflow-x-auto"},mM={class:"pbx-min-w-full"},bM={class:"pbx-bg-gray-50"},xM={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},gM={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},uM={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},hM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},fM={class:"pbx-min-w-[30rem] pbx-w-max"},yM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},wM={class:"pbx-min-w-[30rem] pbx-w-max"},vM={class:"pbx-flex pbx-items-center pbx-space-x-3"},kM=["src"],SM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},CM={class:"pbx-min-w-[30rem] pbx-w-max"},EM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},TM={class:"pbx-min-w-[30rem] pbx-w-max"},MM={class:"pbx-flex pbx-items-center pbx-space-x-3"},NM={class:"pbx-pr-6"},PM={class:"pbx-flex pbx-items-center pbx-space-x-3"},LM={class:"pbx-whitespace-nowrap"},BM={key:4,class:"pbx-mt-8"},AM={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},DM={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},VM={class:"pbx-overflow-x-auto"},zM={class:"pbx-w-max"},IM={class:"pbx-bg-gray-50"},OM={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},_M={scope:"col",class:"pbx-px-6 pbx-py-3 pbx-text-left pbx-text-xs pbx-font-medium pbx-text-gray-500 pbx-uppercase pbx-tracking-wider"},HM={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},RM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},jM={class:"pbx-min-w-[30rem] pbx-w-max"},FM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},qM={class:"pbx-min-w-[30rem] pbx-w-max"},UM={key:0},WM={key:1},GM={key:0},KM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},JM={class:"pbx-min-w-[30rem] pbx-w-max"},YM={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},XM={class:"pbx-min-w-[30rem] pbx-w-max"},QM={class:"pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium"},ZM={class:"pbx-mt-4 pbx-mb-4 pbx-py-8 pbx-px-2 pbx-border pbx-border-solid pbx-border-gray-600 pbx-rounded-xl"},$M={class:"pbx-flex pbx-items-left pbx-flex-col pbx-gap-1"},eN={class:"pbx-myQuaternaryHeader"},tN={class:"pbx-myPrimaryParagraph pbx-text-xs"},rN={class:"pbx-mt-4 pbx-whitespace-pre-wrap pbx-text-white pbx-overflow-hidden pbx-bg-gray-900"},oN={class:"pbx-flex bg-gray-800/40 pbx-ring-1 ring-white/5"},iN={class:"pbx-mb-px pbx-flex pbx-text-xs pbx-font-medium pbx-text-myPrimaryMediumGrayColor"},nN={class:"pbx-px-4 pbx-py-4 pbx-text-white"},aN={class:"pbx-px-4 pbx-pb-8 pbx-pt-4 pbx-text-white pbx-text-xs pbx-break-all"},lN={class:"pbx-myPrimaryParagraph pbx-text-xs pbx-text-white"},sN=i.defineComponent({__name:"PageBuilderSettings",setup(r){const{translate:e}=re(),t=oe,o=i.computed(()=>t.getPageBuilderConfig);return(n,a)=>{var l,s,p,d,c,m,b,x,g,u,h,f,w,y;return i.openBlock(),i.createElementBlock("div",N8,[i.createElementVNode("div",P8,[i.createElementVNode("div",null,[i.createElementVNode("div",L8,[i.createElementVNode("h3",B8,i.toDisplayString(i.unref(e)("Configuration Overview")),1),i.createElementVNode("p",A8,i.toDisplayString(i.unref(e)("A summary of current user preferences, application settings, and system metadata including UI theme, language, saved components, and logo configuration.")),1)]),i.createElementVNode("div",D8,[i.createElementVNode("div",V8,[i.createElementVNode("h4",z8,i.toDisplayString(i.unref(e)("Version Information")),1),i.createElementVNode("div",I8,[i.createElementVNode("div",O8,[i.createElementVNode("table",_8,[i.createElementVNode("thead",H8,[i.createElementVNode("tr",null,[i.createElementVNode("th",R8,i.toDisplayString(i.unref(e)("App")),1),i.createElementVNode("th",j8,i.toDisplayString(i.unref(e)("Version")),1)])]),i.createElementVNode("tbody",F8,[i.createElementVNode("tr",null,[i.createElementVNode("td",q8,[i.createElementVNode("div",U8,i.toDisplayString(i.unref(e)("Page Builder")),1)]),i.createElementVNode("td",W8,[i.createElementVNode("div",G8,[i.createElementVNode("span",K8,i.toDisplayString(i.unref(M8)),1)])])])])])])])]),(l=o.value)!=null&&l.resourceData&&!i.unref(er)(o.value.resourceData)?(i.openBlock(),i.createElementBlock("div",J8,[i.createElementVNode("h4",Y8,i.toDisplayString(i.unref(e)("Resource Data")),1),i.createElementVNode("div",X8,[i.createElementVNode("div",Q8,[i.createElementVNode("table",Z8,[i.createElementVNode("thead",$8,[i.createElementVNode("tr",null,[i.createElementVNode("th",e7,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",t7,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",r7,[(p=(s=o.value)==null?void 0:s.resourceData)!=null&&p.title?(i.openBlock(),i.createElementBlock("tr",o7,[i.createElementVNode("td",i7,[i.createElementVNode("div",n7,i.toDisplayString(i.unref(e)("Title")),1)]),i.createElementVNode("td",a7,[i.createElementVNode("div",l7,i.toDisplayString(o.value.resourceData.title),1)])])):i.createCommentVNode("",!0),(c=(d=o.value)==null?void 0:d.resourceData)!=null&&c.id?(i.openBlock(),i.createElementBlock("tr",s7,[i.createElementVNode("td",p7,[i.createElementVNode("div",d7,i.toDisplayString(i.unref(e)("ID")),1)]),i.createElementVNode("td",c7,[i.createElementVNode("div",m7,i.toDisplayString(o.value.resourceData.id),1)])])):i.createCommentVNode("",!0)])])])])])):i.createCommentVNode("",!0),(m=o.value)!=null&&m.userForPageBuilder&&!i.unref(er)(o.value.userForPageBuilder)?(i.openBlock(),i.createElementBlock("div",b7,[i.createElementVNode("h4",x7,i.toDisplayString(i.unref(e)("User Information")),1),i.createElementVNode("div",g7,[i.createElementVNode("div",u7,[i.createElementVNode("table",h7,[i.createElementVNode("thead",f7,[i.createElementVNode("tr",null,[i.createElementVNode("th",y7,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",w7,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",v7,[i.createElementVNode("tr",null,[i.createElementVNode("td",k7,[i.createElementVNode("div",S7,i.toDisplayString(i.unref(e)("User Name")),1)]),i.createElementVNode("td",C7,[i.createElementVNode("div",E7,i.toDisplayString(o.value.userForPageBuilder.name),1)])]),i.createElementVNode("tr",null,[a[0]||(a[0]=i.createElementVNode("td",{class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},[i.createElementVNode("div",{class:"pbx-min-w-[30rem] pbx-w-max"},"ID")],-1)),i.createElementVNode("td",T7,[i.createElementVNode("div",M7,i.toDisplayString(o.value.userForPageBuilder.id),1)])]),i.createElementVNode("tr",null,[i.createElementVNode("td",N7,[i.createElementVNode("div",P7,i.toDisplayString(i.unref(e)("Image")),1)]),o.value.userForPageBuilder.image&&typeof o.value.userForPageBuilder.image=="string"&&o.value.userForPageBuilder.image.length>2?(i.openBlock(),i.createElementBlock("td",L7,[i.createElementVNode("div",B7,[i.createElementVNode("div",A7,[i.createElementVNode("img",{class:"pbx-block pbx-inset-0 pbx-object-top pbx-h-10 pbx-min-h-10 pbx-max-h-10 pbx-w-10 pbx-min-w-10 pbx-max-w-10 pbx-object-cover pbx-rounded-full",src:o.value.userForPageBuilder.image,alt:"image"},null,8,D7)])])])):i.createCommentVNode("",!0)]),i.createElementVNode("tr",null,[i.createElementVNode("td",V7,[i.createElementVNode("div",z7,i.toDisplayString(i.unref(e)("Image URL")),1)]),o.value.userForPageBuilder.image&&typeof o.value.userForPageBuilder.image=="string"&&o.value.userForPageBuilder.image.length>2?(i.openBlock(),i.createElementBlock("td",I7,[i.createElementVNode("div",O7,i.toDisplayString(o.value.userForPageBuilder.image),1)])):i.createCommentVNode("",!0)])])])])])])):i.createCommentVNode("",!0),(b=o.value)!=null&&b.userSettings&&!i.unref(er)(o.value.userSettings)?(i.openBlock(),i.createElementBlock("div",_7,[i.createElementVNode("h4",H7,i.toDisplayString(i.unref(e)("User Settings")),1),i.createElementVNode("div",R7,[i.createElementVNode("div",j7,[i.createElementVNode("table",F7,[i.createElementVNode("thead",q7,[i.createElementVNode("tr",null,[i.createElementVNode("th",U7,i.toDisplayString(i.unref(e)("Setting")),1),i.createElementVNode("th",W7,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",G7,[(g=(x=o.value)==null?void 0:x.userSettings)!=null&&g.language?(i.openBlock(),i.createElementBlock("tr",K7,[i.createElementVNode("td",J7,[i.createElementVNode("div",Y7,i.toDisplayString(i.unref(e)("Language")),1)]),i.createElementVNode("td",X7,[i.createElementVNode("div",Q7,i.toDisplayString(o.value.userSettings.language),1)])])):i.createCommentVNode("",!0),((h=(u=o.value)==null?void 0:u.userSettings)==null?void 0:h.autoSave)!==void 0?(i.openBlock(),i.createElementBlock("tr",Z7,[i.createElementVNode("td",$7,[i.createElementVNode("div",eM,i.toDisplayString(i.unref(e)("Auto Save")),1)]),i.createElementVNode("td",tM,[i.createElementVNode("div",rM,[i.createElementVNode("span",{class:i.normalizeClass(["pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium",o.value.userSettings.autoSave?"bg-green-100 text-green-800":"bg-red-100 text-red-800"])},i.toDisplayString(o.value.userSettings.autoSave?i.unref(e)("Enabled"):i.unref(e)("Disabled")),3)])])])):i.createCommentVNode("",!0),((w=(f=o.value)==null?void 0:f.userSettings)==null?void 0:w.notifications)!==void 0?(i.openBlock(),i.createElementBlock("tr",oM,[i.createElementVNode("td",iM,[i.createElementVNode("div",nM,i.toDisplayString(i.unref(e)("Notifications")),1)]),i.createElementVNode("td",aM,[i.createElementVNode("div",lM,[i.createElementVNode("span",{class:i.normalizeClass(["pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium",o.value.userSettings.notifications?"bg-green-100 text-green-800":"bg-red-100 text-red-800"])},i.toDisplayString(o.value.userSettings.notifications?i.unref(e)("Enabled"):i.unref(e)("Disabled")),3)])])])):i.createCommentVNode("",!0)])])])])])):i.createCommentVNode("",!0),o.value&&o.value.pageBuilderLogo&&!i.unref(er)(o.value.pageBuilderLogo)?(i.openBlock(),i.createElementBlock("div",sM,[i.createElementVNode("h4",pM,i.toDisplayString(i.unref(e)("Logo Configuration")),1),i.createElementVNode("div",dM,[i.createElementVNode("div",cM,[i.createElementVNode("table",mM,[i.createElementVNode("thead",bM,[i.createElementVNode("tr",null,[i.createElementVNode("th",xM,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",gM,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",uM,[i.createElementVNode("tr",null,[i.createElementVNode("td",hM,[i.createElementVNode("div",fM,i.toDisplayString(i.unref(e)("Logo")),1)]),i.createElementVNode("td",yM,[i.createElementVNode("div",wM,[i.createElementVNode("div",vM,[i.createElementVNode("img",{class:"pbx-h-4",src:o.value.pageBuilderLogo.src,alt:"Logo"},null,8,kM)])])])]),i.createElementVNode("tr",null,[i.createElementVNode("td",SM,[i.createElementVNode("div",CM,i.toDisplayString(i.unref(e)("Logo URL")),1)]),i.createElementVNode("td",EM,[i.createElementVNode("div",TM,[i.createElementVNode("div",MM,[i.createElementVNode("div",NM,[i.createElementVNode("div",PM,[i.createElementVNode("span",LM,i.toDisplayString(o.value.pageBuilderLogo.src),1)])])])])])])])])])])])):i.createCommentVNode("",!0),(y=o.value)!=null&&y.updateOrCreate&&!i.unref(er)(o.value.updateOrCreate)?(i.openBlock(),i.createElementBlock("div",BM,[i.createElementVNode("h4",AM,i.toDisplayString(i.unref(e)("Form Type")),1),i.createElementVNode("div",DM,[i.createElementVNode("div",VM,[i.createElementVNode("table",zM,[i.createElementVNode("thead",IM,[i.createElementVNode("tr",null,[i.createElementVNode("th",OM,i.toDisplayString(i.unref(e)("Mode")),1),i.createElementVNode("th",_M,i.toDisplayString(i.unref(e)("Description")),1)])]),i.createElementVNode("tbody",HM,[i.createElementVNode("tr",null,[i.createElementVNode("td",RM,[i.createElementVNode("div",jM,i.toDisplayString(i.unref(e)("Form Type")),1)]),i.createElementVNode("td",FM,[i.createElementVNode("div",qM,[i.createElementVNode("span",{class:i.normalizeClass(["pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium",o.value.updateOrCreate.formType==="create"?"bg-green-100 text-green-800":"bg-blue-100 text-blue-800"])},[o.value&&o.value.updateOrCreate.formType==="create"?(i.openBlock(),i.createElementBlock("span",UM,i.toDisplayString(o.value.updateOrCreate.formType),1)):i.createCommentVNode("",!0),o.value&&o.value.updateOrCreate.formType==="update"?(i.openBlock(),i.createElementBlock("span",WM,i.toDisplayString(o.value.updateOrCreate.formType),1)):i.createCommentVNode("",!0)],2)])])]),o.value.updateOrCreate.formName&&o.value.updateOrCreate.formName.length>0?(i.openBlock(),i.createElementBlock("tr",GM,[i.createElementVNode("td",KM,[i.createElementVNode("div",JM,i.toDisplayString(i.unref(e)("Form Name")),1)]),i.createElementVNode("td",YM,[i.createElementVNode("div",XM,[i.createElementVNode("span",QM,i.toDisplayString(o.value.updateOrCreate.formName),1)])])])):i.createCommentVNode("",!0)])])])])])):i.createCommentVNode("",!0)])])]),i.createElementVNode("div",ZM,[i.createElementVNode("div",$M,[i.createElementVNode("h3",eN,i.toDisplayString(i.unref(e)("Complete Configuration Overview")),1),i.createElementVNode("p",tN,i.toDisplayString(i.unref(e)("Complete configuration object currently used by the Page Builder. Includes user information, branding settings, and other context-specific data needed for rendering and managing the builder environment.")),1)]),i.createElementVNode("div",rN,[i.createElementVNode("div",oN,[i.createElementVNode("div",iN,[i.createElementVNode("div",nN,i.toDisplayString(i.unref(e)("Configuration")),1)])]),i.createElementVNode("div",aN,[i.createElementVNode("p",lN," config: "+i.toDisplayString(JSON.stringify(o.value,null,4)),1)])])])])}}}),pN={key:0,class:"pbx-fixed pbx-inset-0 pbx-z-[9999]"},dN={class:"pbx-flex pbx-gap-2 pbx-justify-between pbx-items-center pbx-py-2 pbx-px-2 pbx-mb-2 pbx-border-b pbx-border-gray-200"},cN={class:"pbx-myQuaternaryHeader pbx-my-0 pbx-py-0 pbx-text-black"},mN={class:"pbx-pt-4 pbx-px-2"},Q3=i.defineComponent({__name:"FloatingSidePanel",props:{title:{type:String,required:!1,default:null},showSidebarPanel:{type:Boolean,default:!1},position:{type:String,required:!0,default:"right",validator(r){const t=["left","right"].includes(r);return t||console.warn(`Invalid prop: position must be 'left' or 'right', got '${r}'`),t}},closeOnOverlayClick:{type:Boolean,default:!0}},emits:["closeSidebarPanel"],setup(r,{emit:e}){const t=r,o=e,n=()=>{o("closeSidebarPanel")},a=()=>{t.closeOnOverlayClick&&n()};return(l,s)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"popup-fade"},{default:i.withCtx(()=>[r.showSidebarPanel?(i.openBlock(),i.createElementBlock("div",pN,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-fixed pbx-inset-0 pbx-bg-black pbx-opacity-20 pbx-z-40",{"pbx-pointer-events-none":!r.closeOnOverlayClick}]),onClick:a},null,2),i.createElementVNode("div",{class:i.normalizeClass(["pbx-font-sans pbx-fixed pbx-top-0 pbx-rounded-3xl pbx-py-2 pbx-px-2 pbx-border pbx-border-gray-200 pbx-max-h-[80vh] lg:pbx-min-h-[98%] pbx-min-h-[80vh] lg:pbx-min-w-96 lg:pbx-w-96 pbx-w-[96%] pbx-overflow-y-auto pbx-z-50 pbx-bg-white lg:pbx-mt-2 pbx-mt-2",[r.position==="left"?"pbx-left-0 pbx-ml-[1%]":"",r.position==="right"?"pbx-right-0 pbx-mr-[1%]":""]]),onClick:s[0]||(s[0]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",dN,[i.createElementVNode("span",cN,i.toDisplayString(r.title),1),i.createElementVNode("span",{onClick:n},[...s[1]||(s[1]=[i.createElementVNode("div",{class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-text-black"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," close ")],-1)])])]),i.createElementVNode("div",mN,[i.renderSlot(l.$slots,"default")])],2)])):i.createCommentVNode("",!0)]),_:3})]))}}),bN={class:"pbx-flex pbx-flex-col pbx-items-center pbx-justify-center pbx-myPrimaryGap"},xN={class:"pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center pbx-relative"},gN={class:"pbx-overflow-y-auto"},uN={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2"},hN={class:"pbx-lg:pbx-text-base pbx-text-sm pbx-font-semibold pbx-text-center pbx-min-h-14 pbx-flex pbx-justify-center pbx-items-center"},fN={class:"pbx-bg-gray-100 pbx-rounded-full pbx-w-32 pbx-h-32 pbx-flex pbx-items-center pbx-justify-center"},yN={class:"pbx-text-center"},wN={class:"pbx-lg:pbx-text-7xl pbx-text-5xl"},vN={key:0,class:"pbx-w-full pbx-space-y-6"},kN={class:"pbx-text-xl pbx-font-semibold pbx-mb-4 pbx-text-center"},SN={class:"pbx-text-sm pbx-font-semibold pbx-uppercase pbx-tracking-widest pbx-text-gray-400 pbx-mb-3 pbx-px-1"},CN={class:"pbx-space-y-3"},EN={class:"pbx-flex-shrink-0 pbx-mt-1"},TN={key:0,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-myPrimaryLinkColor pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-white hover:pbx-text-white"},MN={key:1,class:"pbx-select-none pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-myPrimaryErrorColor pbx-aspect-square hover:pbx-bg-myPrimaryErrorColor hover:pbx-text-white pbx-text-white"},NN={class:"pbx-flex-1"},PN={class:"pbx-text-sm pbx-text-gray-600"},LN={key:1,class:"pbx-text-gray-500 pbx-text-center"},BN={class:"pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center"},AN=i.defineComponent({__name:"ComponentTopMenu",setup(r){const{translate:e}=re(),t=ce(),o=i.ref(!1),n=i.ref(!1),a=i.ref(""),l=i.ref(1),s=i.ref(""),p=i.ref(""),d=i.ref(""),c=i.ref(null),m=i.ref(null),b=i.ref(null),x=i.ref(null),g=i.ref(null),u=function(){n.value=!0,a.value="delete",l.value=2,s.value=e("Remove all Components"),p.value=e("Are you sure you want to remove all Components?"),d.value=e("Close"),c.value=null,m.value=e("Delete"),b.value=function(){n.value=!1},x.value=function(){},g.value=async function(){o.value=!0,await t.clearHtmlSelection(),await t.handleFormSubmission(),await se(500),n.value=!1,o.value=!1}},h=i.ref(!1),f=function(){h.value=!1},w=function(){h.value=!0},y=i.ref(null),S=i.ref(!1),E=i.computed(()=>{if(!y.value)return[];const N=new Map;for(const C of y.value.checks){const A=C.category??"Other";N.has(A)||N.set(A,[]),N.get(A).push(C)}return Array.from(N.entries()).map(([C,A])=>({title:C,checks:A}))}),P=async function(){S.value=!S.value,S.value&&(y.value=await t.analyzeSEO())},k=function(){S.value=!1};return(N,C)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",bN,[i.createElementVNode("div",xN,[i.createElementVNode("div",{onClick:P,"pbx-bg-myPrimaryLinkColor":"",class:i.normalizeClass(["pbx-select-none pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white",{"pbx-bg-myPrimaryLinkColor pbx-text-white":S.value}])},[...C[4]||(C[4]=[i.createElementVNode("div",{class:"pbx-font-semibold pbx-text-sm"},"SEO",-1)])],2),i.createVNode(Q3,{title:"SEO",showSidebarPanel:S.value,onCloseSidebarPanel:k,position:"left"},{default:i.withCtx(()=>[i.createElementVNode("div",gN,[i.createElementVNode("div",null,[i.createElementVNode("div",uN,[i.createElementVNode("div",hN,[y.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:"pbx-relative pbx-my-4 pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center pbx-w-36 pbx-h-36",style:i.normalizeStyle({background:`conic-gradient(${y.value.score<50?"#ef4444":"#50C878"} ${y.value.score}%, #e5e7eb 0)`})},[i.createElementVNode("div",fN,[i.createElementVNode("div",yN,[i.createElementVNode("span",wN,i.toDisplayString(y.value.score),1),C[5]||(C[5]=i.createElementVNode("span",{class:"pbx-text-xl"},"%",-1))])])],4)):i.createCommentVNode("",!0)])]),E.value.length?(i.openBlock(),i.createElementBlock("div",vN,[i.createElementVNode("h3",kN,i.toDisplayString(i.unref(e)("SEO Check Results")),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(E.value,A=>(i.openBlock(),i.createElementBlock("div",{key:A.title},[i.createElementVNode("h4",SN,i.toDisplayString(i.unref(e)(A.title)),1),i.createElementVNode("ul",CN,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.checks,(T,v)=>(i.openBlock(),i.createElementBlock("li",{key:v,class:i.normalizeClass(["pbx-flex pbx-items-start pbx-gap-4 pbx-p-4 pbx-bg-white pbx-rounded-lg pbx-border-solid pbx-border-2",T.passed?"pbx-border-emerald-500":"pbx-border-red-600"])},[i.createElementVNode("div",EN,[T.passed?(i.openBlock(),i.createElementBlock("div",TN,[...C[6]||(C[6]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," check ",-1)])])):i.createCommentVNode("",!0),T.passed?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",MN,[...C[7]||(C[7]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," check_indeterminate_small ",-1)])]))]),i.createElementVNode("div",NN,[i.createElementVNode("p",{class:i.normalizeClass(["pbx-text-lg pbx-font-medium",T.passed?"pbx-text-green-700":"pbx-text-red-700"])},i.toDisplayString(i.unref(e)(T.check)),3),i.createElementVNode("p",PN,i.toDisplayString(T.details),1)])],2))),128))])]))),128))])):(i.openBlock(),i.createElementBlock("div",LN,i.toDisplayString(i.unref(e)("No SEO checks available.")),1))])])]),_:1},8,["showSidebarPanel"])]),i.createElementVNode("div",{class:"pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center"},[i.createElementVNode("div",{onClick:u,class:"pbx-select-none pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryErrorColor hover:pbx-text-white pbx-text-myPrimaryErrorColor"},[...C[8]||(C[8]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," delete_forever ",-1)])])]),C[10]||(C[10]=i.createElementVNode("div",{class:"pbx-w-full pbx-border-t pbx-border-solid pbx-border-gray-200"},null,-1)),i.createElementVNode("div",BN,[i.createElementVNode("div",{onClick:C[0]||(C[0]=async()=>{await i.unref(t).clearHtmlSelection(),w()}),class:"pbx-select-none pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},[...C[9]||(C[9]=[i.createElementVNode("svg",{fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",class:"css-1a6490m"},[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M15.192 5.393A6.965 6.965 0 0012 4.071V2h-2v2.07a6.964 6.964 0 00-3.192 1.323L5.344 3.93 3.93 5.343l1.464 1.464A6.964 6.964 0 004.07 10H2v2h2.07a6.964 6.964 0 001.324 3.193L3.93 16.657l1.414 1.414 1.464-1.464A6.964 6.964 0 0010 17.929V20h2v-2.07a6.964 6.964 0 003.192-1.323l1.465 1.464 1.414-1.414-1.465-1.465A6.964 6.964 0 0017.93 12H20v-2h-2.07a6.963 6.963 0 00-1.324-3.193l1.464-1.464-1.414-1.414-1.464 1.464zM11 16a5 5 0 100-10 5 5 0 000 10z","fill-rule":"evenodd"})],-1)])])])]),i.createVNode(gt,{showDynamicModalBuilder:n.value,type:a.value,gridColumnAmount:l.value,title:s.value,description:p.value,isLoading:o.value,firstButtonText:d.value,secondButtonText:c.value??void 0,thirdButtonText:m.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:C[1]||(C[1]=()=>{var A;return(A=b.value)==null?void 0:A.call(b)}),onSecondModalButtonFunctionDynamicModalBuilder:C[2]||(C[2]=()=>{var A;return(A=x.value)==null?void 0:A.call(x)}),onThirdModalButtonFunctionDynamicModalBuilder:C[3]||(C[3]=()=>{var A;return(A=g.value)==null?void 0:A.call(g)})},{default:i.withCtx(()=>[...C[11]||(C[11]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","type","gridColumnAmount","title","description","isLoading","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode($e,{maxWidth:"5xl",showModalBuilder:h.value,title:"Main Settings",onCloseMainModalBuilder:f,minHeight:"",maxHeight:""},{default:i.withCtx(()=>[i.createVNode(sN)]),_:1},8,["showModalBuilder"])]))}});function Me(r){this.content=r}Me.prototype={constructor:Me,find:function(r){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===r)return e;return-1},get:function(r){var e=this.find(r);return e==-1?void 0:this.content[e+1]},update:function(r,e,t){var o=t&&t!=r?this.remove(t):this,n=o.find(r),a=o.content.slice();return n==-1?a.push(t||r,e):(a[n+1]=e,t&&(a[n]=t)),new Me(a)},remove:function(r){var e=this.find(r);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new Me(t)},addToStart:function(r,e){return new Me([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Me(t)},addBefore:function(r,e,t){var o=this.remove(e),n=o.content.slice(),a=o.find(r);return n.splice(a==-1?n.length:a,0,e,t),new Me(n)},forEach:function(r){for(var e=0;e<this.content.length;e+=2)r(this.content[e],this.content[e+1])},prepend:function(r){return r=Me.from(r),r.size?new Me(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Me.from(r),r.size?new Me(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Me.from(r);for(var t=0;t<r.content.length;t+=2)e=e.remove(r.content[t]);return e},toObject:function(){var r={};return this.forEach(function(e,t){r[e]=t}),r},get size(){return this.content.length>>1}},Me.from=function(r){if(r instanceof Me)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Me(e)};function Z3(r,e,t){for(let o=0;;o++){if(o==r.childCount||o==e.childCount)return r.childCount==e.childCount?null:t;let n=r.child(o),a=e.child(o);if(n==a){t+=n.nodeSize;continue}if(!n.sameMarkup(a))return t;if(n.isText&&n.text!=a.text){let l=n.text,s=a.text,p=0;for(;l[p]==s[p];p++)t++;return p&&p<l.length&&p<s.length&&t4(l.charCodeAt(p-1))&&e4(l.charCodeAt(p))&&t--,t}if(n.content.size||a.content.size){let l=Z3(n.content,a.content,t+1);if(l!=null)return l}t+=n.nodeSize}}function $3(r,e,t,o){for(let n=r.childCount,a=e.childCount;;){if(n==0||a==0)return n==a?null:{a:t,b:o};let l=r.child(--n),s=e.child(--a),p=l.nodeSize;if(l==s){t-=p,o-=p;continue}if(!l.sameMarkup(s))return{a:t,b:o};if(l.isText&&l.text!=s.text){let d=l.text,c=s.text,m=d.length,b=c.length;for(;m>0&&b>0&&d[m-1]==c[b-1];)m--,b--,t--,o--;return m&&b&&m<d.length&&t4(d.charCodeAt(m-1))&&e4(d.charCodeAt(m))&&(t++,o++),{a:t,b:o}}if(l.content.size||s.content.size){let d=$3(l.content,s.content,t-1,o-1);if(d)return d}t-=p,o-=p}}function e4(r){return r>=56320&&r<57344}function t4(r){return r>=55296&&r<56320}let I=class We{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let o=0;o<e.length;o++)this.size+=e[o].nodeSize}nodesBetween(e,t,o,n=0,a){for(let l=0,s=0;s<t;l++){let p=this.content[l],d=s+p.nodeSize;if(d>e&&o(p,n+s,a||null,l)!==!1&&p.content.size){let c=s+1;p.nodesBetween(Math.max(0,e-c),Math.min(p.content.size,t-c),o,n+c)}s=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,o,n){let a="",l=!0;return this.nodesBetween(e,t,(s,p)=>{let d=s.isText?s.text.slice(Math.max(e,p)-p,t-p):s.isLeaf?n?typeof n=="function"?n(s):n:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&d||s.isTextblock)&&o&&(l?l=!1:a+=o),a+=d},0),a}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,o=e.firstChild,n=this.content.slice(),a=0;for(t.isText&&t.sameMarkup(o)&&(n[n.length-1]=t.withText(t.text+o.text),a=1);a<e.content.length;a++)n.push(e.content[a]);return new We(n,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let o=[],n=0;if(t>e)for(let a=0,l=0;l<t;a++){let s=this.content[a],p=l+s.nodeSize;p>e&&((l<e||p>t)&&(s.isText?s=s.cut(Math.max(0,e-l),Math.min(s.text.length,t-l)):s=s.cut(Math.max(0,e-l-1),Math.min(s.content.size,t-l-1))),o.push(s),n+=s.nodeSize),l=p}return new We(o,n)}cutByIndex(e,t){return e==t?We.empty:e==0&&t==this.content.length?this:new We(this.content.slice(e,t))}replaceChild(e,t){let o=this.content[e];if(o==t)return this;let n=this.content.slice(),a=this.size+t.nodeSize-o.nodeSize;return n[e]=t,new We(n,a)}addToStart(e){return new We([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new We(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,o=0;t<this.content.length;t++){let n=this.content[t];e(n,o,t),o+=n.nodeSize}}findDiffStart(e,t=0){return Z3(this,e,t)}findDiffEnd(e,t=this.size,o=e.size){return $3(this,e,t,o)}findIndex(e){if(e==0)return cn(0,e);if(e==this.size)return cn(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,o=0;;t++){let n=this.child(t),a=o+n.nodeSize;if(a>=e)return a==e?cn(t+1,a):cn(t,o);o=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 We.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return We.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return We.empty;let t,o=0;for(let n=0;n<e.length;n++){let a=e[n];o+=a.nodeSize,n&&a.isText&&e[n-1].sameMarkup(a)?(t||(t=e.slice(0,n)),t[t.length-1]=a.withText(t[t.length-1].text+a.text)):t&&t.push(a)}return new We(t||e,o)}static from(e){if(!e)return We.empty;if(e instanceof We)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new We([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};I.empty=new I([],0);const ml={index:0,offset:0};function cn(r,e){return ml.index=r,ml.offset=e,ml}function mn(r,e){if(r===e)return!0;if(!(r&&typeof r=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(r);if(Array.isArray(e)!=t)return!1;if(t){if(r.length!=e.length)return!1;for(let o=0;o<r.length;o++)if(!mn(r[o],e[o]))return!1}else{for(let o in r)if(!(o in e)||!mn(r[o],e[o]))return!1;for(let o in e)if(!(o in r))return!1}return!0}let te=class Ap{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,o=!1;for(let n=0;n<e.length;n++){let a=e[n];if(this.eq(a))return e;if(this.type.excludes(a.type))t||(t=e.slice(0,n));else{if(a.type.excludes(this.type))return e;!o&&a.type.rank>this.type.rank&&(t||(t=e.slice(0,n)),t.push(this),o=!0),t&&t.push(a)}}return t||(t=e.slice()),o||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&&mn(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 o=e.marks[t.type];if(!o)throw new RangeError(`There is no mark type ${t.type} in this schema`);let n=o.create(t.attrs);return o.checkAttrs(n.attrs),n}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let o=0;o<e.length;o++)if(!e[o].eq(t[o]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Ap.none;if(e instanceof Ap)return[e];let t=e.slice();return t.sort((o,n)=>o.type.rank-n.type.rank),t}};te.none=[];let Go=class extends Error{},H=class Ro{constructor(e,t,o){this.content=e,this.openStart=t,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let o=o4(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return o&&new Ro(o,this.openStart,this.openEnd)}removeBetween(e,t){return new Ro(r4(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 Ro.empty;let o=t.openStart||0,n=t.openEnd||0;if(typeof o!="number"||typeof n!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Ro(I.fromJSON(e,t.content),o,n)}static maxOpen(e,t=!0){let o=0,n=0;for(let a=e.firstChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.firstChild)o++;for(let a=e.lastChild;a&&!a.isLeaf&&(t||!a.type.spec.isolating);a=a.lastChild)n++;return new Ro(e,o,n)}};H.empty=new H(I.empty,0,0);function r4(r,e,t){let{index:o,offset:n}=r.findIndex(e),a=r.maybeChild(o),{index:l,offset:s}=r.findIndex(t);if(n==e||a.isText){if(s!=t&&!r.child(l).isText)throw new RangeError("Removing non-flat range");return r.cut(0,e).append(r.cut(t))}if(o!=l)throw new RangeError("Removing non-flat range");return r.replaceChild(o,a.copy(r4(a.content,e-n-1,t-n-1)))}function o4(r,e,t,o,n,a){let{index:l,offset:s}=r.findIndex(e),p=r.maybeChild(l);if(s==e||p.isText)return a&&o<=0&&n<=0&&!a.canReplace(l,l,t)?null:r.cut(0,e).append(t).append(r.cut(e));let d=o4(p.content,e-s-1,t,l==0?o-1:0,l==r.childCount-1?n-1:0,p);return d&&r.replaceChild(l,p.copy(d))}function DN(r,e,t){if(t.openStart>r.depth)throw new Go("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new Go("Inconsistent open depths");return i4(r,e,t,0)}function i4(r,e,t,o){let n=r.index(o),a=r.node(o);if(n==e.index(o)&&o<r.depth-t.openStart){let l=i4(r,e,t,o+1);return a.copy(a.content.replaceChild(n,l))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&r.depth==o&&e.depth==o){let l=r.parent,s=l.content;return Mr(l,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:l,end:s}=VN(t,r);return Mr(a,a4(r,l,s,e,o))}else return Mr(a,bn(r,e,o))}function n4(r,e){if(!e.type.compatibleContent(r.type))throw new Go("Cannot join "+e.type.name+" onto "+r.type.name)}function bl(r,e,t){let o=r.node(t);return n4(o,e.node(t)),o}function Tr(r,e){let t=e.length-1;t>=0&&r.isText&&r.sameMarkup(e[t])?e[t]=r.withText(e[t].text+r.text):e.push(r)}function Ko(r,e,t,o){let n=(e||r).node(t),a=0,l=e?e.index(t):n.childCount;r&&(a=r.index(t),r.depth>t?a++:r.textOffset&&(Tr(r.nodeAfter,o),a++));for(let s=a;s<l;s++)Tr(n.child(s),o);e&&e.depth==t&&e.textOffset&&Tr(e.nodeBefore,o)}function Mr(r,e){if(!r.type.validContent(e))throw new Go("Invalid content for node "+r.type.name);return r.copy(e)}function a4(r,e,t,o,n){let a=r.depth>n&&bl(r,e,n+1),l=o.depth>n&&bl(t,o,n+1),s=[];return Ko(null,r,n,s),a&&l&&e.index(n)==t.index(n)?(n4(a,l),Tr(Mr(a,a4(r,e,t,o,n+1)),s)):(a&&Tr(Mr(a,bn(r,e,n+1)),s),Ko(e,t,n,s),l&&Tr(Mr(l,bn(t,o,n+1)),s)),Ko(o,null,n,s),new I(s)}function bn(r,e,t){let o=[];if(Ko(null,r,t,o),r.depth>t){let n=bl(r,e,t+1);Tr(Mr(n,bn(r,e,t+1)),o)}return Ko(e,null,t,o),new I(o)}function VN(r,e){let t=e.depth-r.openStart,n=e.node(t).copy(r.content);for(let a=t-1;a>=0;a--)n=e.node(a).copy(I.from(n));return{start:n.resolveNoCache(r.openStart+t),end:n.resolveNoCache(n.content.size-r.openEnd-t)}}class Jo{constructor(e,t,o){this.pos=e,this.path=t,this.parentOffset=o,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 o=this.pos-this.path[this.path.length-1],n=e.child(t);return o?e.child(t).cut(o):n}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 o=this.path[t*3],n=t==0?0:this.path[t*3-1]+1;for(let a=0;a<e;a++)n+=o.child(a).nodeSize;return n}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return te.none;if(this.textOffset)return e.child(t).marks;let o=e.maybeChild(t-1),n=e.maybeChild(t);if(!o){let s=o;o=n,n=s}let a=o.marks;for(var l=0;l<a.length;l++)a[l].type.spec.inclusive===!1&&(!n||!a[l].isInSet(n.marks))&&(a=a[l--].removeFromSet(a));return a}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let o=t.marks,n=e.parent.maybeChild(e.index());for(var a=0;a<o.length;a++)o[a].type.spec.inclusive===!1&&(!n||!o[a].isInSet(n.marks))&&(o=o[a--].removeFromSet(o));return o}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 o=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);o>=0;o--)if(e.pos<=this.end(o)&&(!t||t(this.node(o))))return new xn(this,e,o);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 o=[],n=0,a=t;for(let l=e;;){let{index:s,offset:p}=l.content.findIndex(a),d=a-p;if(o.push(l,s,n+p),!d||(l=l.child(s),l.isText))break;a=d-1,n+=p+1}return new Jo(t,o,a)}static resolveCached(e,t){let o=l4.get(e);if(o)for(let a=0;a<o.elts.length;a++){let l=o.elts[a];if(l.pos==t)return l}else l4.set(e,o=new zN);let n=o.elts[o.i]=Jo.resolve(e,t);return o.i=(o.i+1)%IN,n}}class zN{constructor(){this.elts=[],this.i=0}}const IN=12,l4=new WeakMap;class xn{constructor(e,t,o){this.$from=e,this.$to=t,this.depth=o}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 ON=Object.create(null);let tr=class Dp{constructor(e,t,o,n=te.none){this.type=e,this.attrs=t,this.marks=n,this.content=o||I.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,o,n=0){this.content.nodesBetween(e,t,o,n,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,o,n){return this.content.textBetween(e,t,o,n)}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,o){return this.type==e&&mn(this.attrs,t||e.defaultAttrs||ON)&&te.sameSet(this.marks,o||te.none)}copy(e=null){return e==this.content?this:new Dp(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Dp(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,o=!1){if(e==t)return H.empty;let n=this.resolve(e),a=this.resolve(t),l=o?0:n.sharedDepth(t),s=n.start(l),d=n.node(l).content.cut(n.pos-s,a.pos-s);return new H(d,n.depth-l,a.depth-l)}replace(e,t,o){return DN(this.resolve(e),this.resolve(t),o)}nodeAt(e){for(let t=this;;){let{index:o,offset:n}=t.content.findIndex(e);if(t=t.maybeChild(o),!t)return null;if(n==e||t.isText)return t;e-=n+1}}childAfter(e){let{index:t,offset:o}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:o}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:o}=this.content.findIndex(e);if(o<e)return{node:this.content.child(t),index:t,offset:o};let n=this.content.child(t-1);return{node:n,index:t-1,offset:o-n.nodeSize}}resolve(e){return Jo.resolveCached(this,e)}resolveNoCache(e){return Jo.resolve(this,e)}rangeHasMark(e,t,o){let n=!1;return t>e&&this.nodesBetween(e,t,a=>(o.isInSet(a.marks)&&(n=!0),!n)),n}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()+")"),s4(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,o=I.empty,n=0,a=o.childCount){let l=this.contentMatchAt(e).matchFragment(o,n,a),s=l&&l.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let p=n;p<a;p++)if(!this.type.allowsMarks(o.child(p).marks))return!1;return!0}canReplaceWith(e,t,o,n){if(n&&!this.type.allowsMarks(n))return!1;let a=this.contentMatchAt(e).matchType(o),l=a&&a.matchFragment(this.content,t);return l?l.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),this.type.checkAttrs(this.attrs);let e=te.none;for(let t=0;t<this.marks.length;t++){let o=this.marks[t];o.type.checkAttrs(o.attrs),e=o.addToSet(e)}if(!te.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 o;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=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,o)}let n=I.fromJSON(e,t.content),a=e.nodeType(t.type).create(t.attrs,n,o);return a.type.checkAttrs(a.attrs),a}};tr.prototype.text=void 0;class gn extends tr{constructor(e,t,o,n){if(super(e,t,null,n),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):s4(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 gn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new gn(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 s4(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class Nr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let o=new _N(e,t);if(o.next==null)return Nr.empty;let n=p4(o);o.next&&o.err("Unexpected trailing text");let a=WN(UN(n));return GN(a,o),a}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,o=e.childCount){let n=this;for(let a=t;n&&a<o;a++)n=n.matchType(e.child(a).type);return n}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 o=0;o<e.next.length;o++)if(this.next[t].type==e.next[o].type)return!0;return!1}fillBefore(e,t=!1,o=0){let n=[this];function a(l,s){let p=l.matchFragment(e,o);if(p&&(!t||p.validEnd))return I.from(s.map(d=>d.createAndFill()));for(let d=0;d<l.next.length;d++){let{type:c,next:m}=l.next[d];if(!(c.isText||c.hasRequiredAttrs())&&n.indexOf(m)==-1){n.push(m);let b=a(m,s.concat(c));if(b)return b}}return null}return a(this,[])}findWrapping(e){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==e)return this.wrapCache[o+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let n=o.shift(),a=n.match;if(a.matchType(e)){let l=[];for(let s=n;s.type;s=s.via)l.push(s.type);return l.reverse()}for(let l=0;l<a.next.length;l++){let{type:s,next:p}=a.next[l];!s.isLeaf&&!s.hasRequiredAttrs()&&!(s.name in t)&&(!n.type||p.validEnd)&&(o.push({match:s.contentMatch,type:s,via:n}),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(o){e.push(o);for(let n=0;n<o.next.length;n++)e.indexOf(o.next[n].next)==-1&&t(o.next[n].next)}return t(this),e.map((o,n)=>{let a=n+(o.validEnd?"*":" ")+" ";for(let l=0;l<o.next.length;l++)a+=(l?", ":"")+o.next[l].type.name+"->"+e.indexOf(o.next[l].next);return a}).join(`
|
|
22
22
|
`)}}Nr.empty=new Nr(!0);class _N{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 p4(r){let e=[];do e.push(HN(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function HN(r){let e=[];do e.push(RN(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function RN(r){let e=qN(r);for(;;)if(r.eat("+"))e={type:"plus",expr:e};else if(r.eat("*"))e={type:"star",expr:e};else if(r.eat("?"))e={type:"opt",expr:e};else if(r.eat("{"))e=jN(r,e);else break;return e}function d4(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function jN(r,e){let t=d4(r),o=t;return r.eat(",")&&(r.next!="}"?o=d4(r):o=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:o,expr:e}}function FN(r,e){let t=r.nodeTypes,o=t[e];if(o)return[o];let n=[];for(let a in t){let l=t[a];l.isInGroup(e)&&n.push(l)}return n.length==0&&r.err("No node type or group '"+e+"' found"),n}function qN(r){if(r.eat("(")){let e=p4(r);return r.eat(")")||r.err("Missing closing paren"),e}else if(/\W/.test(r.next))r.err("Unexpected token '"+r.next+"'");else{let e=FN(r,r.next).map(t=>(r.inline==null?r.inline=t.isInline:r.inline!=t.isInline&&r.err("Mixing inline and block content"),{type:"name",value:t}));return r.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function UN(r){let e=[[]];return n(a(r,0),t()),e;function t(){return e.push([])-1}function o(l,s,p){let d={term:p,to:s};return e[l].push(d),d}function n(l,s){l.forEach(p=>p.to=s)}function a(l,s){if(l.type=="choice")return l.exprs.reduce((p,d)=>p.concat(a(d,s)),[]);if(l.type=="seq")for(let p=0;;p++){let d=a(l.exprs[p],s);if(p==l.exprs.length-1)return d;n(d,s=t())}else if(l.type=="star"){let p=t();return o(s,p),n(a(l.expr,p),p),[o(p)]}else if(l.type=="plus"){let p=t();return n(a(l.expr,s),p),n(a(l.expr,p),p),[o(p)]}else{if(l.type=="opt")return[o(s)].concat(a(l.expr,s));if(l.type=="range"){let p=s;for(let d=0;d<l.min;d++){let c=t();n(a(l.expr,p),c),p=c}if(l.max==-1)n(a(l.expr,p),p);else for(let d=l.min;d<l.max;d++){let c=t();o(p,c),n(a(l.expr,p),c),p=c}return[o(p)]}else{if(l.type=="name")return[o(s,void 0,l.value)];throw new Error("Unknown expr type")}}}}function c4(r,e){return e-r}function m4(r,e){let t=[];return o(e),t.sort(c4);function o(n){let a=r[n];if(a.length==1&&!a[0].term)return o(a[0].to);t.push(n);for(let l=0;l<a.length;l++){let{term:s,to:p}=a[l];!s&&t.indexOf(p)==-1&&o(p)}}}function WN(r){let e=Object.create(null);return t(m4(r,0));function t(o){let n=[];o.forEach(l=>{r[l].forEach(({term:s,to:p})=>{if(!s)return;let d;for(let c=0;c<n.length;c++)n[c][0]==s&&(d=n[c][1]);m4(r,p).forEach(c=>{d||n.push([s,d=[]]),d.indexOf(c)==-1&&d.push(c)})})});let a=e[o.join(",")]=new Nr(o.indexOf(r.length-1)>-1);for(let l=0;l<n.length;l++){let s=n[l][1].sort(c4);a.next.push({type:n[l][0],next:e[s.join(",")]||t(s)})}return a}}function GN(r,e){for(let t=0,o=[r];t<o.length;t++){let n=o[t],a=!n.validEnd,l=[];for(let s=0;s<n.next.length;s++){let{type:p,next:d}=n.next[s];l.push(p.name),a&&!(p.isText||p.hasRequiredAttrs())&&(a=!1),o.indexOf(d)==-1&&o.push(d)}a&&e.err("Only non-generatable nodes ("+l.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function b4(r){let e=Object.create(null);for(let t in r){let o=r[t];if(!o.hasDefault)return null;e[t]=o.default}return e}function x4(r,e){let t=Object.create(null);for(let o in r){let n=e&&e[o];if(n===void 0){let a=r[o];if(a.hasDefault)n=a.default;else throw new RangeError("No value supplied for attribute "+o)}t[o]=n}return t}function g4(r,e,t,o){for(let n in e)if(!(n in r))throw new RangeError(`Unsupported attribute ${n} for ${t} of type ${o}`);for(let n in r)r[n].validate&&r[n].validate(e[n])}function u4(r,e){let t=Object.create(null);if(e)for(let o in e)t[o]=new JN(r,o,e[o]);return t}let h4=class uT{constructor(e,t,o){this.name=e,this.schema=t,this.spec=o,this.markSet=null,this.groups=o.group?o.group.split(" "):[],this.attrs=u4(e,o.attrs),this.defaultAttrs=b4(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(o.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Nr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:x4(this.attrs,e)}create(e=null,t,o){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new tr(this,this.computeAttrs(e),I.from(t),te.setFrom(o))}createChecked(e=null,t,o){return t=I.from(t),this.checkContent(t),new tr(this,this.computeAttrs(e),t,te.setFrom(o))}createAndFill(e=null,t,o){if(e=this.computeAttrs(e),t=I.from(t),t.size){let l=this.contentMatch.fillBefore(t);if(!l)return null;t=l.append(t)}let n=this.contentMatch.matchFragment(t),a=n&&n.fillBefore(I.empty,!0);return a?new tr(this,e,t.append(a),te.setFrom(o)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let o=0;o<e.childCount;o++)if(!this.allowsMarks(e.child(o).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)}`)}checkAttrs(e){g4(this.attrs,e,"node",this.name)}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 o=0;o<e.length;o++)this.allowsMarkType(e[o].type)?t&&t.push(e[o]):t||(t=e.slice(0,o));return t?t.length?t:te.none:e}static compile(e,t){let o=Object.create(null);e.forEach((a,l)=>o[a]=new uT(a,t,l));let n=t.spec.topNode||"doc";if(!o[n])throw new RangeError("Schema is missing its top node type ('"+n+"')");if(!o.text)throw new RangeError("Every schema needs a 'text' type");for(let a in o.text.attrs)throw new RangeError("The text node type should not have attributes");return o}};function KN(r,e,t){let o=t.split("|");return n=>{let a=n===null?"null":typeof n;if(o.indexOf(a)<0)throw new RangeError(`Expected value of type ${o} for attribute ${e} on type ${r}, got ${a}`)}}class JN{constructor(e,t,o){this.hasDefault=Object.prototype.hasOwnProperty.call(o,"default"),this.default=o.default,this.validate=typeof o.validate=="string"?KN(e,t,o.validate):o.validate}get isRequired(){return!this.hasDefault}}class un{constructor(e,t,o,n){this.name=e,this.rank=t,this.schema=o,this.spec=n,this.attrs=u4(e,n.attrs),this.excluded=null;let a=b4(this.attrs);this.instance=a?new te(this,a):null}create(e=null){return!e&&this.instance?this.instance:new te(this,x4(this.attrs,e))}static compile(e,t){let o=Object.create(null),n=0;return e.forEach((a,l)=>o[a]=new un(a,n++,t,l)),o}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){g4(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class f4{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=Me.from(e.nodes),t.marks=Me.from(e.marks||{}),this.nodes=h4.compile(this.spec.nodes,this),this.marks=un.compile(this.spec.marks,this);let o=Object.create(null);for(let n in this.nodes){if(n in this.marks)throw new RangeError(n+" can not be both a node and a mark");let a=this.nodes[n],l=a.spec.content||"",s=a.spec.marks;if(a.contentMatch=o[l]||(o[l]=Nr.parse(l,this.nodes)),a.inlineContent=a.contentMatch.inlineContent,a.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!a.isInline||!a.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=a}a.markSet=s=="_"?null:s?y4(this,s.split(" ")):s==""||!a.inlineContent?[]:null}for(let n in this.marks){let a=this.marks[n],l=a.spec.excludes;a.excluded=l==null?[a]:l==""?[]:y4(this,l.split(" "))}this.nodeFromJSON=n=>tr.fromJSON(this,n),this.markFromJSON=n=>te.fromJSON(this,n),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,o,n){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof h4){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,o,n)}text(e,t){let o=this.nodes.text;return new gn(o,o.defaultAttrs,e,te.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function y4(r,e){let t=[];for(let o=0;o<e.length;o++){let n=e[o],a=r.marks[n],l=a;if(a)t.push(a);else for(let s in r.marks){let p=r.marks[s];(n=="_"||p.spec.group&&p.spec.group.split(" ").indexOf(n)>-1)&&t.push(l=p)}if(!l)throw new SyntaxError("Unknown mark type: '"+e[o]+"'")}return t}function YN(r){return r.tag!=null}function XN(r){return r.style!=null}let Yo=class Vp{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let o=this.matchedStyles=[];t.forEach(n=>{if(YN(n))this.tags.push(n);else if(XN(n)){let a=/[^=]*/.exec(n.style)[0];o.indexOf(a)<0&&o.push(a),this.styles.push(n)}}),this.normalizeLists=!this.tags.some(n=>{if(!/^(ul|ol)\b/.test(n.tag)||!n.node)return!1;let a=e.nodes[n.node];return a.contentMatch.matchType(a)})}parse(e,t={}){let o=new S4(this,t,!1);return o.addAll(e,te.none,t.from,t.to),o.finish()}parseSlice(e,t={}){let o=new S4(this,t,!0);return o.addAll(e,te.none,t.from,t.to),H.maxOpen(o.finish())}matchTag(e,t,o){for(let n=o?this.tags.indexOf(o)+1:0;n<this.tags.length;n++){let a=this.tags[n];if($N(e,a.tag)&&(a.namespace===void 0||e.namespaceURI==a.namespace)&&(!a.context||t.matchesContext(a.context))){if(a.getAttrs){let l=a.getAttrs(e);if(l===!1)continue;a.attrs=l||void 0}return a}}}matchStyle(e,t,o,n){for(let a=n?this.styles.indexOf(n)+1:0;a<this.styles.length;a++){let l=this.styles[a],s=l.style;if(!(s.indexOf(e)!=0||l.context&&!o.matchesContext(l.context)||s.length>e.length&&(s.charCodeAt(e.length)!=61||s.slice(e.length+1)!=t))){if(l.getAttrs){let p=l.getAttrs(t);if(p===!1)continue;l.attrs=p||void 0}return l}}}static schemaRules(e){let t=[];function o(n){let a=n.priority==null?50:n.priority,l=0;for(;l<t.length;l++){let s=t[l];if((s.priority==null?50:s.priority)<a)break}t.splice(l,0,n)}for(let n in e.marks){let a=e.marks[n].spec.parseDOM;a&&a.forEach(l=>{o(l=C4(l)),l.mark||l.ignore||l.clearMark||(l.mark=n)})}for(let n in e.nodes){let a=e.nodes[n].spec.parseDOM;a&&a.forEach(l=>{o(l=C4(l)),l.node||l.ignore||l.mark||(l.node=n)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Vp(e,Vp.schemaRules(e)))}};const w4={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},QN={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},v4={ol:!0,ul:!0},Xo=1,xl=2,Qo=4;function k4(r,e,t){return e!=null?(e?Xo:0)|(e==="full"?xl:0):r&&r.whitespace=="pre"?Xo|xl:t&~Qo}class hn{constructor(e,t,o,n,a,l){this.type=e,this.attrs=t,this.marks=o,this.solid=n,this.options=l,this.content=[],this.activeMarks=te.none,this.match=a||(l&Qo?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(I.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let o=this.type.contentMatch,n;return(n=o.findWrapping(e.type))?(this.match=o,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Xo)){let o=this.content[this.content.length-1],n;if(o&&o.isText&&(n=/[ \t\r\n\u000c]+$/.exec(o.text))){let a=o;o.text.length==n[0].length?this.content.pop():this.content[this.content.length-1]=a.withText(a.text.slice(0,a.text.length-n[0].length))}}let t=I.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(I.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!w4.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class S4{constructor(e,t,o){this.parser=e,this.options=t,this.isOpen=o,this.open=0,this.localPreserveWS=!1;let n=t.topNode,a,l=k4(null,t.preserveWhitespace,0)|(o?Qo:0);n?a=new hn(n.type,n.attrs,te.none,!0,t.topMatch||n.type.contentMatch,l):o?a=new hn(null,null,te.none,!0,null,l):a=new hn(e.schema.topNodeType,null,te.none,!0,null,l),this.nodes=[a],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let o=e.nodeValue,n=this.top,a=n.options&xl?"full":this.localPreserveWS||(n.options&Xo)>0,{schema:l}=this.parser;if(a==="full"||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(o)){if(a)if(a==="full")o=o.replace(/\r\n?/g,`
|
|
23
23
|
`);else if(l.linebreakReplacement&&/[\r\n]/.test(o)&&this.top.findWrapping(l.linebreakReplacement.create())){let s=o.split(/\r?\n|\r/);for(let p=0;p<s.length;p++)p&&this.insertNode(l.linebreakReplacement.create(),t,!0),s[p]&&this.insertNode(l.text(s[p]),t,!/\S/.test(s[p]));o=""}else o=o.replace(/\r?\n|\r/g," ");else if(o=o.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(o)&&this.open==this.nodes.length-1){let s=n.content[n.content.length-1],p=e.previousSibling;(!s||p&&p.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(o=o.slice(1))}o&&this.insertNode(l.text(o),t,!/\S/.test(o)),this.findInText(e)}else this.findInside(e)}addElement(e,t,o){let n=this.localPreserveWS,a=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let l=e.nodeName.toLowerCase(),s;v4.hasOwnProperty(l)&&this.parser.normalizeLists&&ZN(e);let p=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,o));e:if(p?p.ignore:QN.hasOwnProperty(l))this.findInside(e),this.ignoreFallback(e,t);else if(!p||p.skip||p.closeParent){p&&p.closeParent?this.open=Math.max(0,this.open-1):p&&p.skip.nodeType&&(e=p.skip);let d,c=this.needsBlock;if(w4.hasOwnProperty(l))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),d=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let m=p&&p.skip?t:this.readStyles(e,t);m&&this.addAll(e,m),d&&this.sync(a),this.needsBlock=c}else{let d=this.readStyles(e,t);d&&this.addElementByRule(e,p,d,p.consuming===!1?s:void 0)}this.localPreserveWS=n}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
24
24
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let o=e.style;if(o&&o.length)for(let n=0;n<this.parser.matchedStyles.length;n++){let a=this.parser.matchedStyles[n],l=o.getPropertyValue(a);if(l)for(let s=void 0;;){let p=this.parser.matchStyle(a,l,this,s);if(!p)break;if(p.ignore)return null;if(p.clearMark?t=t.filter(d=>!p.clearMark(d)):t=t.concat(this.parser.schema.marks[p.mark].create(p.attrs)),p.consuming===!1)s=p;else break}}return t}addElementByRule(e,t,o,n){let a,l;if(t.node)if(l=this.parser.schema.nodes[t.node],l.isLeaf)this.insertNode(l.create(t.attrs),o,e.nodeName=="BR")||this.leafFallback(e,o);else{let p=this.enter(l,t.attrs||null,o,t.preserveWhitespace);p&&(a=!0,o=p)}else{let p=this.parser.schema.marks[t.mark];o=o.concat(p.create(t.attrs))}let s=this.top;if(l&&l.isLeaf)this.findInside(e);else if(n)this.addElement(e,o,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(p=>this.insertNode(p,o,!1));else{let p=e;typeof t.contentElement=="string"?p=e.querySelector(t.contentElement):typeof t.contentElement=="function"?p=t.contentElement(e):t.contentElement&&(p=t.contentElement),this.findAround(e,p,!0),this.addAll(p,o),this.findAround(e,p,!1)}a&&this.sync(s)&&this.open--}addAll(e,t,o,n){let a=o||0;for(let l=o?e.childNodes[o]:e.firstChild,s=n==null?null:e.childNodes[n];l!=s;l=l.nextSibling,++a)this.findAtPoint(e,a),this.addDOM(l,t);this.findAtPoint(e,a)}findPlace(e,t,o){let n,a;for(let l=this.open,s=0;l>=0;l--){let p=this.nodes[l],d=p.findWrapping(e);if(d&&(!n||n.length>d.length+s)&&(n=d,a=p,!d.length))break;if(p.solid){if(o)break;s+=2}}if(!n)return null;this.sync(a);for(let l=0;l<n.length;l++)t=this.enterInner(n[l],null,t,!1);return t}insertNode(e,t,o){if(e.isInline&&this.needsBlock&&!this.top.type){let a=this.textblockFromContext();a&&(t=this.enterInner(a,null,t))}let n=this.findPlace(e,t,o);if(n){this.closeExtra();let a=this.top;a.match&&(a.match=a.match.matchType(e.type));let l=te.none;for(let s of n.concat(e.marks))(a.type?a.type.allowsMarkType(s.type):E4(s.type,e.type))&&(l=s.addToSet(l));return a.content.push(e.mark(l)),!0}return!1}enter(e,t,o,n){let a=this.findPlace(e.create(t),o,!1);return a&&(a=this.enterInner(e,t,o,!0,n)),a}enterInner(e,t,o,n=!1,a){this.closeExtra();let l=this.top;l.match=l.match&&l.match.matchType(e);let s=k4(e,a,l.options);l.options&Qo&&l.content.length==0&&(s|=Qo);let p=te.none;return o=o.filter(d=>(l.type?l.type.allowsMarkType(d.type):E4(d.type,e))?(p=d.addToSet(p),!1):!0),this.nodes.push(new hn(e,t,p,n,null,s)),this.open++,o}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;this.localPreserveWS&&(this.nodes[t].options|=Xo)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let o=this.nodes[t].content;for(let n=o.length-1;n>=0;n--)e+=o[n].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let o=0;o<this.find.length;o++)this.find[o].node==e&&this.find[o].offset==t&&(this.find[o].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,o){if(e!=t&&this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&t.compareDocumentPosition(this.find[n].node)&(o?2:4)&&(this.find[n].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("/"),o=this.options.context,n=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),a=-(o?o.depth+1:0)+(n?0:1),l=(s,p)=>{for(;s>=0;s--){let d=t[s];if(d==""){if(s==t.length-1||s==0)continue;for(;p>=a;p--)if(l(s-1,p))return!0;return!1}else{let c=p>0||p==0&&n?this.nodes[p].type:o&&p>=a?o.node(p-a).type:null;if(!c||c.name!=d&&!c.isInGroup(d))return!1;p--}}return!0};return l(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let o=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(o&&o.isTextblock&&o.defaultAttrs)return o}for(let t in this.parser.schema.nodes){let o=this.parser.schema.nodes[t];if(o.isTextblock&&o.defaultAttrs)return o}}}function ZN(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let o=e.nodeType==1?e.nodeName.toLowerCase():null;o&&v4.hasOwnProperty(o)&&t?(t.appendChild(e),e=t):o=="li"?t=e:o&&(t=null)}}function $N(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function C4(r){let e={};for(let t in r)e[t]=r[t];return e}function E4(r,e){let t=e.schema.nodes;for(let o in t){let n=t[o];if(!n.allowsMarkType(r))continue;let a=[],l=s=>{a.push(s);for(let p=0;p<s.edgeCount;p++){let{type:d,next:c}=s.edge(p);if(d==e||a.indexOf(c)<0&&l(c))return!0}};if(l(n.contentMatch))return!0}}class Pr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},o){o||(o=fn(t).createDocumentFragment());let n=o,a=[];return e.forEach(l=>{if(a.length||l.marks.length){let s=0,p=0;for(;s<a.length&&p<l.marks.length;){let d=l.marks[p];if(!this.marks[d.type.name]){p++;continue}if(!d.eq(a[s][0])||d.type.spec.spanning===!1)break;s++,p++}for(;s<a.length;)n=a.pop()[1];for(;p<l.marks.length;){let d=l.marks[p++],c=this.serializeMark(d,l.isInline,t);c&&(a.push([d,n]),n.appendChild(c.dom),n=c.contentDOM||c.dom)}}n.appendChild(this.serializeNodeInner(l,t))}),o}serializeNodeInner(e,t){if(e.isText)return fn(t).createTextNode(e.text);let{dom:o,contentDOM:n}=yn(fn(t),this.nodes[e.type.name](e),null,e.attrs);if(n){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,n)}return o}serializeNode(e,t={}){let o=this.serializeNodeInner(e,t);for(let n=e.marks.length-1;n>=0;n--){let a=this.serializeMark(e.marks[n],e.isInline,t);a&&((a.contentDOM||a.dom).appendChild(o),o=a.dom)}return o}serializeMark(e,t,o={}){let n=this.marks[e.type.name];return n&&yn(fn(o),n(e,t),null,e.attrs)}static renderSpec(e,t,o=null,n){return typeof t=="string"?{dom:e.createTextNode(t)}:yn(e,t,o,n)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Pr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=T4(e.nodes);return t.text||(t.text=o=>o.text),t}static marksFromSchema(e){return T4(e.marks)}}function T4(r){let e={};for(let t in r){let o=r[t].spec.toDOM;o&&(e[t]=o)}return e}function fn(r){return r.document||window.document}const M4=new WeakMap;function eP(r){let e=M4.get(r);return e===void 0&&M4.set(r,e=tP(r)),e}function tP(r){let e=null;function t(o){if(o&&typeof o=="object")if(Array.isArray(o))if(typeof o[0]=="string")e||(e=[]),e.push(o);else for(let n=0;n<o.length;n++)t(o[n]);else for(let n in o)t(o[n])}return t(r),e}function yn(r,e,t,o){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let n=e[0],a;if(typeof n!="string")throw new RangeError("Invalid array passed to renderSpec");if(o&&(a=eP(o))&&a.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let l=n.indexOf(" ");l>0&&(t=n.slice(0,l),n=n.slice(l+1));let s,p=t?r.createElementNS(t,n):r.createElement(n),d=e[1],c=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){c=2;for(let m in d)if(d[m]!=null){let b=m.indexOf(" ");b>0?p.setAttributeNS(m.slice(0,b),m.slice(b+1),d[m]):m=="style"&&p.style?p.style.cssText=d[m]:p.setAttribute(m,d[m])}}for(let m=c;m<e.length;m++){let b=e[m];if(b===0){if(m<e.length-1||m>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:p,contentDOM:p}}else if(typeof b=="string")p.appendChild(r.createTextNode(b));else{let{dom:x,contentDOM:g}=yn(r,b,t,o);if(p.appendChild(x),g){if(s)throw new RangeError("Multiple content holes");s=g}}}return{dom:p,contentDOM:s}}const N4=65535,P4=Math.pow(2,16);function rP(r,e){return r+e*P4}function L4(r){return r&N4}function oP(r){return(r-(r&N4))/P4}const B4=1,A4=2,wn=4,D4=8;let gl=class{constructor(e,t,o){this.pos=e,this.delInfo=t,this.recover=o}get deleted(){return(this.delInfo&D4)>0}get deletedBefore(){return(this.delInfo&(B4|wn))>0}get deletedAfter(){return(this.delInfo&(A4|wn))>0}get deletedAcross(){return(this.delInfo&wn)>0}},Lr=class jo{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&jo.empty)return jo.empty}recover(e){let t=0,o=L4(e);if(!this.inverted)for(let n=0;n<o;n++)t+=this.ranges[n*3+2]-this.ranges[n*3+1];return this.ranges[o*3]+t+oP(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,o){let n=0,a=this.inverted?2:1,l=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let p=this.ranges[s]-(this.inverted?n:0);if(p>e)break;let d=this.ranges[s+a],c=this.ranges[s+l],m=p+d;if(e<=m){let b=d?e==p?-1:e==m?1:t:t,x=p+n+(b<0?0:c);if(o)return x;let g=e==(t<0?p:m)?null:rP(s/3,e-p),u=e==p?A4:e==m?B4:wn;return(t<0?e!=p:e!=m)&&(u|=D4),new gl(x,u,g)}n+=c-d}return o?e+n:new gl(e+n,0,null)}touches(e,t){let o=0,n=L4(t),a=this.inverted?2:1,l=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let p=this.ranges[s]-(this.inverted?o:0);if(p>e)break;let d=this.ranges[s+a],c=p+d;if(e<=c&&s==n*3)return!0;o+=this.ranges[s+l]-d}return!1}forEach(e){let t=this.inverted?2:1,o=this.inverted?1:2;for(let n=0,a=0;n<this.ranges.length;n+=3){let l=this.ranges[n],s=l-(this.inverted?a:0),p=l+(this.inverted?0:a),d=this.ranges[n+t],c=this.ranges[n+o];e(s,s+d,p,p+c),a+=c-d}}invert(){return new jo(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?jo.empty:new jo(e<0?[0,-e,0]:[0,0,e])}};Lr.empty=new Lr([]);class Zo{constructor(e,t,o=0,n=e?e.length:0){this.mirror=t,this.from=o,this.to=n,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new Zo(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,o=this._maps.length;t<e._maps.length;t++){let n=e.getMirror(t);this.appendMap(e._maps[t],n!=null&&n<t?o+n: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,o=this._maps.length+e._maps.length;t>=0;t--){let n=e.getMirror(t);this.appendMap(e._maps[t].invert(),n!=null&&n>t?o-n-1:void 0)}}invert(){let e=new Zo;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let o=this.from;o<this.to;o++)e=this._maps[o].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,o){let n=0;for(let a=this.from;a<this.to;a++){let l=this._maps[a],s=l.mapResult(e,t);if(s.recover!=null){let p=this.getMirror(a);if(p!=null&&p>a&&p<this.to){a=p,e=this._maps[p].recover(s.recover);continue}}n|=s.delInfo,e=s.pos}return o?e:new gl(e,n,null)}}const ul=Object.create(null);let De=class{getMap(){return Lr.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let o=ul[t.stepType];if(!o)throw new RangeError(`No step type ${t.stepType} defined`);return o.fromJSON(e,t)}static jsonID(e,t){if(e in ul)throw new RangeError("Duplicate use of step JSON ID "+e);return ul[e]=t,t.prototype.jsonID=e,t}},_e=class Wi{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Wi(e,null)}static fail(e){return new Wi(null,e)}static fromReplace(e,t,o,n){try{return Wi.ok(e.replace(t,o,n))}catch(a){if(a instanceof Go)return Wi.fail(a.message);throw a}}};function hl(r,e,t){let o=[];for(let n=0;n<r.childCount;n++){let a=r.child(n);a.content.size&&(a=a.copy(hl(a.content,e,a))),a.isInline&&(a=e(a,t,n)),o.push(a)}return I.fromArray(o)}let fl=class Gi extends De{constructor(e,t,o){super(),this.from=e,this.to=t,this.mark=o}apply(e){let t=e.slice(this.from,this.to),o=e.resolve(this.from),n=o.node(o.sharedDepth(this.to)),a=new H(hl(t.content,(l,s)=>!l.isAtom||!s.type.allowsMarkType(this.mark.type)?l:l.mark(this.mark.addToSet(l.marks)),n),t.openStart,t.openEnd);return _e.fromReplace(e,this.from,this.to,a)}invert(){return new ro(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return t.deleted&&o.deleted||t.pos>=o.pos?null:new Gi(t.pos,o.pos,this.mark)}merge(e){return e instanceof Gi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Gi(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 Gi(t.from,t.to,e.markFromJSON(t.mark))}};De.jsonID("addMark",fl);let ro=class Ki extends De{constructor(e,t,o){super(),this.from=e,this.to=t,this.mark=o}apply(e){let t=e.slice(this.from,this.to),o=new H(hl(t.content,n=>n.mark(this.mark.removeFromSet(n.marks)),e),t.openStart,t.openEnd);return _e.fromReplace(e,this.from,this.to,o)}invert(){return new fl(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),o=e.mapResult(this.to,-1);return t.deleted&&o.deleted||t.pos>=o.pos?null:new Ki(t.pos,o.pos,this.mark)}merge(e){return e instanceof Ki&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ki(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 Ki(t.from,t.to,e.markFromJSON(t.mark))}};De.jsonID("removeMark",ro);let yl=class Ji extends De{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return _e.fail("No node at mark step's position");let o=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return _e.fromReplace(e,this.pos,this.pos+1,new H(I.from(o),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let o=this.mark.addToSet(t.marks);if(o.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(o))return new Ji(this.pos,t.marks[n]);return new Ji(this.pos,this.mark)}}return new vn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ji(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 Ji(t.pos,e.markFromJSON(t.mark))}};De.jsonID("addNodeMark",yl);let vn=class zp extends De{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return _e.fail("No node at mark step's position");let o=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return _e.fromReplace(e,this.pos,this.pos+1,new H(I.from(o),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new yl(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new zp(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 zp(t.pos,e.markFromJSON(t.mark))}};De.jsonID("removeNodeMark",vn);let nt=class vr extends De{constructor(e,t,o,n=!1){super(),this.from=e,this.to=t,this.slice=o,this.structure=n}apply(e){return this.structure&&wl(e,this.from,this.to)?_e.fail("Structure replace would overwrite content"):_e.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Lr([this.from,this.to-this.from,this.slice.size])}invert(e){return new vr(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),o=this.from==this.to&&vr.MAP_BIAS<0?t:e.mapResult(this.from,1);return o.deletedAcross&&t.deletedAcross?null:new vr(o.pos,Math.max(o.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof vr)||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?H.empty:new H(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new vr(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?H.empty:new H(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new vr(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 vr(t.from,t.to,H.fromJSON(e,t.slice),!!t.structure)}};nt.MAP_BIAS=1,De.jsonID("replace",nt);let Ke=class Ya extends De{constructor(e,t,o,n,a,l,s=!1){super(),this.from=e,this.to=t,this.gapFrom=o,this.gapTo=n,this.slice=a,this.insert=l,this.structure=s}apply(e){if(this.structure&&(wl(e,this.from,this.gapFrom)||wl(e,this.gapTo,this.to)))return _e.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return _e.fail("Gap is not a flat range");let o=this.slice.insertAt(this.insert,t.content);return o?_e.fromReplace(e,this.from,this.to,o):_e.fail("Content does not fit in gap")}getMap(){return new Lr([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 Ya(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),o=e.mapResult(this.to,-1),n=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),a=this.to==this.gapTo?o.pos:e.map(this.gapTo,1);return t.deletedAcross&&o.deletedAcross||n<t.pos||a>o.pos?null:new Ya(t.pos,o.pos,n,a,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 Ya(t.from,t.to,t.gapFrom,t.gapTo,H.fromJSON(e,t.slice),t.insert,!!t.structure)}};De.jsonID("replaceAround",Ke);function wl(r,e,t){let o=r.resolve(e),n=t-e,a=o.depth;for(;n>0&&a>0&&o.indexAfter(a)==o.node(a).childCount;)a--,n--;if(n>0){let l=o.node(a).maybeChild(o.indexAfter(a));for(;n>0;){if(!l||l.isLeaf)return!0;l=l.firstChild,n--}}return!1}function iP(r,e,t,o){let n=[],a=[],l,s;r.doc.nodesBetween(e,t,(p,d,c)=>{if(!p.isInline)return;let m=p.marks;if(!o.isInSet(m)&&c.type.allowsMarkType(o.type)){let b=Math.max(d,e),x=Math.min(d+p.nodeSize,t),g=o.addToSet(m);for(let u=0;u<m.length;u++)m[u].isInSet(g)||(l&&l.to==b&&l.mark.eq(m[u])?l.to=x:n.push(l=new ro(b,x,m[u])));s&&s.to==b?s.to=x:a.push(s=new fl(b,x,o))}}),n.forEach(p=>r.step(p)),a.forEach(p=>r.step(p))}function nP(r,e,t,o){let n=[],a=0;r.doc.nodesBetween(e,t,(l,s)=>{if(!l.isInline)return;a++;let p=null;if(o instanceof un){let d=l.marks,c;for(;c=o.isInSet(d);)(p||(p=[])).push(c),d=c.removeFromSet(d)}else o?o.isInSet(l.marks)&&(p=[o]):p=l.marks;if(p&&p.length){let d=Math.min(s+l.nodeSize,t);for(let c=0;c<p.length;c++){let m=p[c],b;for(let x=0;x<n.length;x++){let g=n[x];g.step==a-1&&m.eq(n[x].style)&&(b=g)}b?(b.to=d,b.step=a):n.push({style:m,from:Math.max(s,e),to:d,step:a})}}}),n.forEach(l=>r.step(new ro(l.from,l.to,l.style)))}function vl(r,e,t,o=t.contentMatch,n=!0){let a=r.doc.nodeAt(e),l=[],s=e+1;for(let p=0;p<a.childCount;p++){let d=a.child(p),c=s+d.nodeSize,m=o.matchType(d.type);if(!m)l.push(new nt(s,c,H.empty));else{o=m;for(let b=0;b<d.marks.length;b++)t.allowsMarkType(d.marks[b].type)||r.step(new ro(s,c,d.marks[b]));if(n&&d.isText&&t.whitespace!="pre"){let b,x=/\r?\n|\r/g,g;for(;b=x.exec(d.text);)g||(g=new H(I.from(t.schema.text(" ",t.allowedMarks(d.marks))),0,0)),l.push(new nt(s+b.index,s+b.index+b[0].length,g))}}s=c}if(!o.validEnd){let p=o.fillBefore(I.empty,!0);r.replace(s,s,new H(p,0,0))}for(let p=l.length-1;p>=0;p--)r.step(l[p])}function aP(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function oo(r){let t=r.parent.content.cutByIndex(r.startIndex,r.endIndex);for(let o=r.depth,n=0,a=0;;--o){let l=r.$from.node(o),s=r.$from.index(o)+n,p=r.$to.indexAfter(o)-a;if(o<r.depth&&l.canReplace(s,p,t))return o;if(o==0||l.type.spec.isolating||!aP(l,s,p))break;s&&(n=1),p<l.childCount&&(a=1)}return null}function lP(r,e,t){let{$from:o,$to:n,depth:a}=e,l=o.before(a+1),s=n.after(a+1),p=l,d=s,c=I.empty,m=0;for(let g=a,u=!1;g>t;g--)u||o.index(g)>0?(u=!0,c=I.from(o.node(g).copy(c)),m++):p--;let b=I.empty,x=0;for(let g=a,u=!1;g>t;g--)u||n.after(g+1)<n.end(g)?(u=!0,b=I.from(n.node(g).copy(b)),x++):d++;r.step(new Ke(p,d,l,s,new H(c.append(b),m,x),c.size-m,!0))}function kl(r,e,t=null,o=r){let n=sP(r,e),a=n&&pP(o,e);return a?n.map(V4).concat({type:e,attrs:t}).concat(a.map(V4)):null}function V4(r){return{type:r,attrs:null}}function sP(r,e){let{parent:t,startIndex:o,endIndex:n}=r,a=t.contentMatchAt(o).findWrapping(e);if(!a)return null;let l=a.length?a[0]:e;return t.canReplaceWith(o,n,l)?a:null}function pP(r,e){let{parent:t,startIndex:o,endIndex:n}=r,a=t.child(o),l=e.contentMatch.findWrapping(a.type);if(!l)return null;let p=(l.length?l[l.length-1]:e).contentMatch;for(let d=o;p&&d<n;d++)p=p.matchType(t.child(d).type);return!p||!p.validEnd?null:l}function dP(r,e,t){let o=I.empty;for(let l=t.length-1;l>=0;l--){if(o.size){let s=t[l].type.contentMatch.matchFragment(o);if(!s||!s.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=I.from(t[l].type.create(t[l].attrs,o))}let n=e.start,a=e.end;r.step(new Ke(n,a,n,a,new H(o,0,0),t.length,!0))}function cP(r,e,t,o,n){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let a=r.steps.length;r.doc.nodesBetween(e,t,(l,s)=>{let p=typeof n=="function"?n(l):n;if(l.isTextblock&&!l.hasMarkup(o,p)&&mP(r.doc,r.mapping.slice(a).map(s),o)){let d=null;if(o.schema.linebreakReplacement){let x=o.whitespace=="pre",g=!!o.contentMatch.matchType(o.schema.linebreakReplacement);x&&!g?d=!1:!x&&g&&(d=!0)}d===!1&&I4(r,l,s,a),vl(r,r.mapping.slice(a).map(s,1),o,void 0,d===null);let c=r.mapping.slice(a),m=c.map(s,1),b=c.map(s+l.nodeSize,1);return r.step(new Ke(m,b,m+1,b-1,new H(I.from(o.create(p,null,l.marks)),0,0),1,!0)),d===!0&&z4(r,l,s,a),!1}})}function z4(r,e,t,o){e.forEach((n,a)=>{if(n.isText){let l,s=/\r?\n|\r/g;for(;l=s.exec(n.text);){let p=r.mapping.slice(o).map(t+1+a+l.index);r.replaceWith(p,p+1,e.type.schema.linebreakReplacement.create())}}})}function I4(r,e,t,o){e.forEach((n,a)=>{if(n.type==n.type.schema.linebreakReplacement){let l=r.mapping.slice(o).map(t+1+a);r.replaceWith(l,l+1,e.type.schema.text(`
|
|
@@ -174,7 +174,7 @@ ${t}
|
|
|
174
174
|
inset 0 0 0 1px rgba(96, 96, 96, 0.1)`,transition:`box-shadow 0.15s,
|
|
175
175
|
border-color 0.15s`}])},null,4)],8,II),u.value===N.id?(i.openBlock(),i.createElementBlock("div",{key:0,class:"pbx-fixed pbx-inset-0 pbx-z-40",onClick:f})):i.createCommentVNode("",!0),u.value===N.id?(i.openBlock(),i.createElementBlock("div",{key:1,class:"pbx-absolute pbx-right-0 pbx-z-50 pbx-bg-white pbx-rounded-xl pbx-border pbx-border-gray-100 pbx-overflow-hidden",style:{top:"calc(100% + 8px)",width:"200px","box-shadow":`0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
176
176
|
0 2px 4px -2px rgba(0, 0, 0, 0.07),
|
|
177
|
-
0 0 0 1px rgba(0, 0, 0, 0.04)`},onClick:k[0]||(k[0]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",{style:i.normalizeStyle([{backgroundColor:N.color},{width:"100%",height:"72px"}])},null,4),i.createElementVNode("div",OI,[i.createElementVNode("p",_I,i.toDisplayString(N.color),1),i.createElementVNode("label",{for:"color-wheel-"+N.id,class:"pbx-myPrimaryButton pbx-flex pbx-items-center pbx-justify-center pbx-gap-2 pbx-w-full pbx-cursor-pointer"},[k[1]||(k[1]=i.createElementVNode("span",{class:"material-symbols-outlined pbx-text-base pbx-leading-none"}," colorize ",-1)),i.createTextVNode(" "+i.toDisplayString(i.unref(e)("Color wheel")),1)],8,HI)]),i.createElementVNode("input",{id:"color-wheel-"+N.id,value:N.color,type:"color",style:{position:"absolute",opacity:"0",width:"1px",height:"1px","pointer-events":"none"},onInput:C=>g(N,C)},null,40,RI)])):i.createCommentVNode("",!0)])])]))),128))]),i.createElementVNode("div",jI,[i.createElementVNode("div",null,[i.createElementVNode("p",FI,i.toDisplayString(i.unref(e)("Reset to provided defaults")),1),i.createElementVNode("p",qI,i.toDisplayString(i.unref(e)("Restore the original colors provided to the page builder")),1)]),i.createElementVNode("button",{type:"button",class:"pbx-mySecondaryButton pbx-flex pbx-items-center pbx-gap-1 pbx-shrink-0",onClick:y},[k[2]||(k[2]=i.createElementVNode("span",{class:"material-symbols-outlined pbx-text-base pbx-leading-none"},"restart_alt",-1)),i.createTextVNode(" "+i.toDisplayString(i.unref(e)("Reset")),1)])])]),i.createVNode(gt,{showDynamicModalBuilder:w.value,type:"delete",gridColumnAmount:2,title:i.unref(e)("Reset to provided defaults"),description:i.unref(e)("This will restore the original colors provided to the page builder. Any changes you have made to colors or enabled states will be lost."),firstButtonText:i.unref(e)("Close"),thirdButtonText:i.unref(e)("Reset"),onFirstModalButtonFunctionDynamicModalBuilder:S,onThirdModalButtonFunctionDynamicModalBuilder:E},{default:i.withCtx(()=>[...k[3]||(k[3]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","title","description","firstButtonText","thirdButtonText"])],64))}}),UI={class:"pbx-relative"},WI={class:"pbx-flex pbx-justify-start pbx-items-center pbx-gap-2"},GI={key:0,class:"material-symbols-outlined"},KI=["title"],JI={class:"pbx-flex pbx-flex-col"},YI={class:"pbx-flex pbx-gap-2 pbx-items-center"},XI={class:"pbx-px-3 pbx-py-2 pbx-text-xs pbx-font-semibold pbx-text-gray-500"},QI={class:"pbx-flex pbx-items-center"},ZI={class:"pbx-ml-3"},$I={key:0,class:"pbx-flex pbx-items-center"},eO={class:"pbx-ml-3"},tO={key:1,class:"pbx-flex pbx-items-center"},rO={class:"pbx-ml-3"},ZE=i.defineComponent({__name:"TextColorEditor",props:{globalPageLayout:{type:Boolean}},setup(r){const{translate:e}=re(),t=ce(),o=oe,n=i.ref(null),a=i.ref(!1),l=i.computed(()=>o.getTextColor),s=i.computed(()=>o.getPageBuilderConfig),{enabledThemeColorPresets:p}=gp(s),d=i.computed(()=>{var m;return(m=n.value)!=null&&m.startsWith("custom:")?n.value.replace("custom:",""):""});function c(m){n.value=`custom:${m}`,t.handleCustomTextColor(m)}return i.watch(l,async m=>{n.value=m,await t.initializeElementStyles()},{immediate:!0}),(m,b)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(i.unref(Di),{as:"div",modelValue:n.value,"onUpdate:modelValue":b[2]||(b[2]=x=>n.value=x)},{default:i.withCtx(()=>[i.createElementVNode("div",UI,[i.createElementVNode("div",{class:i.normalizeClass([r.globalPageLayout?"pbx-flex pbx-flex-col pbx-border-solid pbx-border pbx-border-gray-400":"pbx-flex pbx-gap-2 pbx-items-center"])},[r.globalPageLayout?(i.openBlock(),i.createBlock(i.unref(Gr),{key:0,class:"pbx-flex pbx-flex-row pbx-justify-between pbx-items-center pbx-pl-3 pbx-pr-3 pbx-py-5 pbx-cursor-pointer pbx-duration-200 hover:pbx-bg-myPrimaryLightGrayColor pbx-bg-white hover:pbx-text-black pbx-text-black pbx-font-sans pbx-font-medium pbx-border-0"},{default:i.withCtx(()=>{var x;return[i.createElementVNode("div",WI,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border pbx-border-gray-600 pbx-rounded-sm pbx-bg-none pbx-border-solid",d.value?"":`pbx-bg-${(x=n.value)==null?void 0:x.replace("pbx-text-","")}`]),style:i.normalizeStyle(d.value?{backgroundColor:d.value}:void 0)},null,6),i.createElementVNode("div",null,[i.createElementVNode("div",null,i.toDisplayString(i.unref(e)("Text Color")),1)])]),r.globalPageLayout?(i.openBlock(),i.createElementBlock("span",GI," chevron_right ")):i.createCommentVNode("",!0)]}),_:1})):i.createCommentVNode("",!0),r.globalPageLayout?(i.openBlock(),i.createElementBlock("button",{key:1,type:"button",class:"pbx-m-2 pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-xl pbx-border-0 pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",title:i.unref(e)("Theme Color Presets"),onClick:b[0]||(b[0]=i.withModifiers(x=>a.value=!0,["stop"]))},[...b[4]||(b[4]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," palette ",-1)])],8,KI)):i.createCommentVNode("",!0),r.globalPageLayout?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(Gr),{key:2,as:"div",class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"},{default:i.withCtx(()=>{var x;return[i.createElementVNode("div",JI,[i.createElementVNode("div",YI,[i.createElementVNode("span",{class:i.normalizeClass(["material-symbols-outlined",d.value?"":`pbx-text-${(x=n.value)==null?void 0:x.replace("pbx-text-","")}`]),style:i.normalizeStyle([{"text-shadow":"rgb(0 0 0 / 10%) 1.5px 1.5px 0px"},d.value?{color:d.value}:void 0])}," format_color_text ",6)])])]}),_:1}))],2),i.createVNode(i.Transition,{"leave-active-class":"pbx-transition pbx-ease-in pbx-duration-100","leave-from-class":"pbx-opacity-100","leave-to-class":"pbx-opacity-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(Vi),{class:"pbx-headless-dropdown pbx-absolute pbx-min-w-[12rem] pbx-z-40 pbx-mt-1 pbx-max-h-56 pbx-w-full pbx-overflow-auto pbx-rounded-md pbx-bg-gray-50 pbx-py-1 pbx-text-base pbx-shadow-lg pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 focus:pbx-outline-none sm:pbx-text-sm"},{default:i.withCtx(()=>[i.unref(p).length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",XI,i.toDisplayString(i.unref(e)("Theme Color Presets")),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(p),x=>(i.openBlock(),i.createBlock(i.unref(Kr),{as:"template",key:x.id,value:`custom:${x.color}`,onClick:g=>c(x.color)},{default:i.withCtx(({active:g})=>[i.createElementVNode("li",{class:i.normalizeClass([g?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-text-myPrimaryDarkGrayColor","pbx-relative pbx-cursor-default pbx-select-none pbx-py-2 pbx-pl-3 pbx-pr-9"])},[i.createElementVNode("div",QI,[i.createElementVNode("div",{class:"pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border-solid pbx-border pbx-border-gray-100 pbx-rounded-sm",style:i.normalizeStyle({backgroundColor:x.color})},null,4),i.createElementVNode("span",ZI,i.toDisplayString(i.unref(e)(x.label)),1)])],2)]),_:2},1032,["value","onClick"]))),128)),b[5]||(b[5]=i.createElementVNode("div",{class:"pbx-my-1 pbx-border-0 pbx-border-t pbx-border-solid pbx-border-gray-200"},null,-1))],64)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(So).textColorVariables,x=>(i.openBlock(),i.createBlock(i.unref(Kr),{as:"template",onClick:b[1]||(b[1]=g=>i.unref(t).handleTextColor(n.value??void 0)),key:x,value:x},{default:i.withCtx(({active:g})=>[i.createElementVNode("li",{class:i.normalizeClass([g?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-text-myPrimaryDarkGrayColor","pbx-relative pbx-cursor-default pbx-select-none pbx-py-2 pbx-pl-3 pbx-pr-9"])},[x==="none"?(i.openBlock(),i.createElementBlock("div",$I,[b[6]||(b[6]=i.createElementVNode("span",{class:"material-symbols-outlined"}," invert_colors ",-1)),i.createElementVNode("span",eO,i.toDisplayString(i.unref(e)("Default black")),1)])):i.createCommentVNode("",!0),x!=="none"?(i.openBlock(),i.createElementBlock("div",tO,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border-solid pbx-border pbx-border-gray-100 pbx-rounded-sm",`pbx-bg-${x.replace("pbx-text-","")}`])},null,2),i.createElementVNode("span",rO,i.toDisplayString(x),1)])):i.createCommentVNode("",!0)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})])]),_:1},8,["modelValue"]),i.createVNode($e,{maxWidth:"3xl",showModalBuilder:a.value,title:i.unref(e)("Theme Color Presets"),onCloseMainModalBuilder:b[3]||(b[3]=x=>a.value=!1)},{default:i.withCtx(()=>[i.createVNode(up)]),_:1},8,["showModalBuilder","title"])],64))}}),oO={class:"pbx-relative"},iO={class:"pbx-flex pbx-justify-start pbx-items-center pbx-gap-2"},nO={key:0,class:"material-symbols-outlined"},aO=["title"],lO={class:"pbx-flex pbx-flex-col"},sO={class:"pbx-flex pbx-gap-2 pbx-items-center"},pO={fill:"currentColor",height:"25",viewBox:"0 0 22 22",width:"26",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},dO={class:"pbx-px-3 pbx-py-2 pbx-text-xs pbx-font-semibold pbx-text-gray-500"},cO={class:"pbx-flex pbx-items-center"},mO={class:"pbx-ml-3"},bO={key:0,class:"pbx-flex pbx-items-center"},xO={class:"pbx-ml-3"},gO={key:1,class:"pbx-flex pbx-items-center"},uO={class:"pbx-ml-3"},$E=i.defineComponent({__name:"BackgroundColorEditor",props:{globalPageLayout:{type:Boolean}},setup(r){const{translate:e}=re(),t=ce(),o=oe,n=i.ref(null),a=i.ref(!1),l=i.computed(()=>o.getBackgroundColor),s=i.computed(()=>o.getPageBuilderConfig),{enabledThemeColorPresets:p}=gp(s),d=i.computed(()=>{var m;return(m=n.value)!=null&&m.startsWith("custom:")?n.value.replace("custom:",""):""});function c(m){n.value=`custom:${m}`,t.handleCustomBackgroundColor(m)}return i.watch(l,async m=>{n.value=m,await t.initializeElementStyles()},{immediate:!0}),(m,b)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(i.unref(Di),{as:"div",modelValue:n.value,"onUpdate:modelValue":b[2]||(b[2]=x=>n.value=x)},{default:i.withCtx(()=>[i.createElementVNode("div",oO,[i.createElementVNode("div",{class:i.normalizeClass([r.globalPageLayout?"pbx-flex pbx-flex-col pbx-border-solid pbx-border pbx-border-gray-400":"pbx-flex pbx-gap-2 pbx-items-center"])},[r.globalPageLayout?(i.openBlock(),i.createBlock(i.unref(Gr),{key:0,class:"pbx-flex pbx-flex-row pbx-justify-between pbx-items-center pbx-pl-3 pbx-pr-3 pbx-py-5 pbx-cursor-pointer pbx-duration-200 hover:pbx-bg-myPrimaryLightGrayColor pbx-bg-white hover:pbx-text-black pbx-text-black pbx-font-sans pbx-font-medium pbx-border-0"},{default:i.withCtx(()=>{var x;return[i.createElementVNode("div",iO,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border pbx-border-gray-600 pbx-rounded-sm pbx-bg-none pbx-border-solid",d.value?"":`pbx-bg-${(x=n.value)==null?void 0:x.replace("pbx-bg-","")}`]),style:i.normalizeStyle(d.value?{backgroundColor:d.value}:void 0)},null,6),i.createElementVNode("div",null,i.toDisplayString(i.unref(e)("Background Color")),1)]),r.globalPageLayout?(i.openBlock(),i.createElementBlock("span",nO," chevron_right ")):i.createCommentVNode("",!0)]}),_:1})):i.createCommentVNode("",!0),r.globalPageLayout?(i.openBlock(),i.createElementBlock("button",{key:1,type:"button",class:"pbx-m-2 pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-xl pbx-border-0 pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",title:i.unref(e)("Theme Color Presets"),onClick:b[0]||(b[0]=i.withModifiers(x=>a.value=!0,["stop"]))},[...b[4]||(b[4]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," palette ",-1)])],8,aO)):i.createCommentVNode("",!0),r.globalPageLayout?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(Gr),{key:2,as:"div",class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"},{default:i.withCtx(()=>[i.createElementVNode("div",lO,[i.createElementVNode("div",sO,[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",pO,[...b[5]||(b[5]=[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M4 11l8-8 8 8-8 8-8-8zm8-5.172L17.172 11H6.828L12 5.828z","fill-rule":"evenodd"},null,-1),i.createElementVNode("path",{d:"M3.5 13s-2 2.757-2 4.054c0 1.075.895 1.946 2 1.946s2-.871 2-1.946c0-1.297-2-4.054-2-4.054z"},null,-1)])]))]),i.createCommentVNode("",!0)])])]),_:1}))],2),i.createVNode(i.Transition,{"leave-active-class":"pbx-transition pbx-ease-in pbx-duration-100","leave-from-class":"pbx-opacity-100","leave-to-class":"pbx-opacity-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(Vi),{class:"pbx-headless-dropdown pbx-absolute pbx-min-w-[12rem] pbx-z-40 pbx-mt-1 pbx-max-h-56 pbx-w-full pbx-overflow-auto pbx-rounded-md pbx-bg-gray-50 pbx-py-1 pbx-text-base pbx-shadow-lg pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 focus:pbx-outline-none sm:pbx-text-sm"},{default:i.withCtx(()=>[i.unref(p).length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",dO,i.toDisplayString(i.unref(e)("Theme Color Presets")),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(p),x=>(i.openBlock(),i.createBlock(i.unref(Kr),{as:"template",key:x.id,value:`custom:${x.color}`,onClick:g=>c(x.color)},{default:i.withCtx(({active:g})=>[i.createElementVNode("li",{class:i.normalizeClass([g?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-text-myPrimaryDarkGrayColor","pbx-relative pbx-cursor-default pbx-select-none pbx-py-2 pbx-pl-3 pbx-pr-9"])},[i.createElementVNode("div",cO,[i.createElementVNode("div",{class:"pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border-solid pbx-border pbx-border-gray-100 pbx-rounded-sm",style:i.normalizeStyle({backgroundColor:x.color})},null,4),i.createElementVNode("span",mO,i.toDisplayString(i.unref(e)(x.label)),1)])],2)]),_:2},1032,["value","onClick"]))),128)),b[6]||(b[6]=i.createElementVNode("div",{class:"pbx-my-1 pbx-border-0 pbx-border-t pbx-border-solid pbx-border-gray-200"},null,-1))],64)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(So).backgroundColorVariables,x=>(i.openBlock(),i.createBlock(i.unref(Kr),{as:"template",onClick:b[1]||(b[1]=g=>i.unref(t).handleBackgroundColor(n.value??void 0)),key:x,value:x},{default:i.withCtx(({active:g})=>[i.createElementVNode("li",{class:i.normalizeClass([g?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-text-myPrimaryDarkGrayColor","pbx-relative pbx-cursor-default pbx-select-none pbx-py-2 pbx-pl-3 pbx-pr-9"])},[x==="none"?(i.openBlock(),i.createElementBlock("div",bO,[b[7]||(b[7]=i.createElementVNode("span",{class:"material-symbols-outlined"}," ev_shadow ",-1)),i.createElementVNode("span",xO,i.toDisplayString(i.unref(e)("Transparent")),1)])):i.createCommentVNode("",!0),x!=="none"?(i.openBlock(),i.createElementBlock("div",gO,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border-solid pbx-border pbx-border-gray-100 pbx-rounded-sm",`pbx-bg-${x.replace("pbx-bg-","")}`])},null,2),i.createElementVNode("span",uO,i.toDisplayString(x),1)])):i.createCommentVNode("",!0)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})])]),_:1},8,["modelValue"]),i.createVNode($e,{maxWidth:"3xl",showModalBuilder:a.value,title:i.unref(e)("Theme Color Presets"),onCloseMainModalBuilder:b[3]||(b[3]=x=>a.value=!1)},{default:i.withCtx(()=>[i.createVNode(up)]),_:1},8,["showModalBuilder","title"])],64))}}),hO=["width","height"],hp=i.defineComponent({__name:"SliderIcon",props:{size:{default:16}},setup(r){return(e,t)=>(i.openBlock(),i.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:r.size,height:r.size,viewBox:"0 0 12 12","aria-hidden":"true"},[...t[0]||(t[0]=[i.createStaticVNode('<title>slider</title><g fill="none"><line x1="11.25" y1="8.75" x2="6.25" y2="8.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></line><circle cx="4.25" cy="8.75" r="2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><line x1="2.25" y1="8.75" x2=".75" y2="8.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></line><line x1=".75" y1="3.25" x2="5.75" y2="3.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></line><circle cx="7.75" cy="3.25" r="2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><line x1="9.75" y1="3.25" x2="11.25" y2="3.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></line></g>',2)])],8,hO))}}),fO={class:"pbx-myInputGroup"},yO={class:"pbx-myPrimaryFormOrganizationHeaderDescriptionSection"},wO={class:"pbx-myPrimaryFormOrganizationHeader"},vO={for:"youtube-video",class:"pbx-myPrimaryInputLabel"},kO={key:0,class:"pbx-min-h-[2.5rem] pbx-flex pbx-items-center pbx-justify-start"},SO={class:"pbx-myPrimaryInputError pbx-mt-2 pbx-mb-0 pbx-py-0 pbx-self-start"},CO={class:"pbx-overflow-y-auto"},EO={class:"pbx-select-none"},TO={key:0,class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max"},MO={class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max"},NO={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},PO={key:2,class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max"},LO=["title"],BO=["title"],AO=["title"],DO={class:"pbx-flex pbx-flex-col pbx-gap-3 pbx-pt-1 pbx-pb-2"},VO={class:"pbx-rounded-2xl pbx-border pbx-border-solid pbx-border-gray-100 pbx-bg-gray-50 pbx-px-4 pbx-py-3"},zO={class:"pbx-flex pbx-items-center pbx-justify-between pbx-gap-4"},IO={class:"pbx-flex pbx-flex-col pbx-gap-1"},OO={class:"pbx-text-sm pbx-font-semibold pbx-text-myPrimaryDarkGrayColor"},_O={class:"pbx-text-xs pbx-text-gray-500 pbx-my-0"},HO={class:"pbx-flex pbx-flex-col pbx-gap-3 pbx-pt-1 pbx-pb-2"},RO={class:"pbx-rounded-2xl pbx-border pbx-border-solid pbx-border-gray-100 pbx-overflow-hidden"},jO={class:"pbx-flex pbx-items-center pbx-gap-2"},FO={key:0,class:"pbx-px-4 pbx-py-3 pbx-border-0 pbx-border-t pbx-border-solid pbx-border-gray-100 pbx-bg-white"},qO={class:"pbx-text-xs pbx-text-gray-400 pbx-font-medium pbx-mb-2 pbx-uppercase pbx-tracking-wide"},UO={class:"pbx-flex pbx-gap-2"},WO=["onClick"],GO={class:"pbx-rounded-2xl pbx-border pbx-border-solid pbx-border-gray-100 pbx-bg-gray-50 pbx-px-4 pbx-py-3"},KO={class:"pbx-flex pbx-items-center pbx-gap-2 pbx-mb-2"},JO={class:"pbx-text-xs pbx-text-gray-400 pbx-font-medium pbx-uppercase pbx-tracking-wide"},YO={class:"pbx-flex pbx-gap-2"},XO=["onClick"],QO={key:0,class:"pbx-absolute pbx-top-10 pbx-transform pbx-select-none pbx-bg-white pbx-rounded-2xl pbx-py-2 pbx-px-2 pbx-border-solid pbx-border pbx-border-gray-200 pbx-inset-x-auto pbx-z-40 pbx-w-56"},ZO={class:"pbx-overflow-y-scroll pbx-h-[20rem] pbx-max-h-[20rem] pbx-min-h-[20rem] pbx-pb-4"},$O={class:"pbx-flex pbx-flex-col"},e_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},t_={class:"pbx-myPrimaryParagraph pbx-text-xs"},r_=["disabled"],o_={class:"pbx-text-sm"},i_=["disabled"],n_={class:"pbx-text-sm"},a_={class:"pbx-text-sm"},l_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},s_={class:"pbx-myPrimaryParagraph pbx-text-xs"},p_={class:"pbx-text-sm"},d_={class:"pbx-text-sm"},c_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},m_={class:"pbx-myPrimaryParagraph pbx-text-xs"},b_={class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},x_={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},g_={class:"pbx-text-sm"},u_={class:"pbx-text-sm"},h_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},f_={class:"pbx-myPrimaryParagraph pbx-text-xs"},y_={class:"pbx-text-sm"},w_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},v_={class:"pbx-myPrimaryParagraph pbx-text-xs"},k_={class:"pbx-text-sm"},S_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},C_={class:"pbx-myPrimaryParagraph pbx-text-xs"},E_={class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},T_={class:"pbx-text-sm"},M_=i.defineComponent({__name:"EditGetElement",emits:["open-global-page-settings","open-image-settings"],setup(r,{emit:e}){const{translate:t}=re(),o=ce(),n=e,a=oe,l=i.inject("CustomMediaComponent",null),s=i.computed(()=>a.getElement);i.computed(()=>{var _;return(_=s.value)==null?void 0:_.tagName});const p=i.computed(()=>o.canMoveUp()),d=i.computed(()=>o.canMoveDown()),c=i.computed(()=>!s.value||!xe.value?!1:!!o.findReverseableContainer()),m=i.ref(0),b=i.ref(!1),x=i.computed(()=>!!(s.value instanceof HTMLElement&&s.value.closest("[data-isl]"))),g=i.computed(()=>{var _;return m.value,s.value instanceof HTMLElement?((_=s.value.closest("[data-isl]"))==null?void 0:_.hasAttribute("data-isl-auto"))??!1:!1}),u=i.computed(()=>{if(m.value,!(s.value instanceof HTMLElement))return 3;const _=s.value.closest("[data-isl]");if(!_)return 3;const M=_.querySelector(".pbx-isl-t");return M?M.children.length:3}),h=i.ref(0),f=i.ref(!1),w=i.ref(0),y=i.computed(()=>(w.value,o.isSelectedElementImage())),S=i.computed(()=>a.getImageSettingsPanelOpen),E=()=>{w.value++,n("open-image-settings")},P=i.computed(()=>(h.value,o.isSelectedComponentTopElement())),k=i.computed(()=>(h.value,o.selectedComponentIsFullWidth())),N=()=>{h.value++,f.value=!0},C=async _=>{const M=o.setSelectedComponentFullWidth(_);h.value++,await M,h.value++},A=async()=>{if(!(s.value instanceof HTMLElement))return;const _=s.value.closest("[data-isl]");if(!_)return;if(_.hasAttribute("data-isl-auto"))_.removeAttribute("data-isl-auto");else{const K=_.querySelector(".pbx-isl-t");K&&(K.scrollLeft=0),_.setAttribute("data-isl-auto","")}const M=_.querySelectorAll(".pbx-isl-nums span"),O=_.querySelectorAll(".pbx-isl-dot");M.forEach((K,ee)=>K.setAttribute("onclick",D(ee))),O.forEach((K,ee)=>K.setAttribute("onclick",D(ee))),m.value++,await o.handleAutoSave()},T=i.computed(()=>{if(m.value,!(s.value instanceof HTMLElement))return 3;const _=s.value.closest("[data-isl]");return parseInt((_==null?void 0:_.getAttribute("data-isl-speed"))||"3",10)}),v=async _=>{if(!(s.value instanceof HTMLElement))return;const M=s.value.closest("[data-isl]");if(!M)return;M.setAttribute("data-isl-speed",String(_));const O=M.closest("section"),K=O==null?void 0:O.querySelector("style"),ee=M.querySelector(".pbx-isl-t"),ie=ee?ee.children.length:3;K&&(K.textContent=B(ie,_)),m.value++,await o.handleAutoSave()};function D(_){const M=`var ns=c.querySelectorAll('.pbx-isl-nums span');ns.forEach(function(s,i){s.style.opacity=i===${_}?'1':'0.55';s.style.background=i===${_}?'rgba(255,255,255,0.9)':'rgba(255,255,255,0.25)';s.style.borderRadius='9999px';s.style.padding='0.1rem 0.55rem';s.style.color=i===${_}?'#111':'#fff';s.style.textShadow=i===${_}?'none':'0 1px 4px rgba(0,0,0,0.7)';});`,O=`var ds=c.querySelectorAll('.pbx-isl-dot');ds.forEach(function(dot,i){dot.style.background=i===${_}?'rgba(255,255,255,1)':'rgba(255,255,255,0.55)';});`,K=`var inBuilder=!!c.closest('[data-builder-canvas]');if(c.hasAttribute('data-isl-auto')&&!inBuilder){var sp=parseInt(c.getAttribute('data-isl-speed')||'3',10);var dl=(${_===0?"0":`(-${_}*sp)`})+'s';var els=[t].concat(Array.from(c.querySelectorAll('.pbx-isl-dot,.pbx-isl-nums span')));els.forEach(function(el){el.style.animation='none';});t.offsetHeight;els.forEach(function(el){el.style.animation='';el.style.animationDelay=dl;el.style.opacity='';el.style.background='';});}else{t.scrollTo({left:t.children[${_}].offsetLeft,behavior:'smooth'});}`;return`(function(d,e){e.stopPropagation();var c=d.closest('[data-isl]');var t=c.querySelector('.pbx-isl-t');${M}${O}${K}var img=t.children[${_}].querySelector('img');if(img)img.click();})(this,event)`}function B(_,M=3){const O=_*M,K=100/_,ee=Math.max(K-3,1),ie=_*100,Qe=(100/_).toFixed(3);let Ze=`@keyframes pbx-isl-r{0%,${ee.toFixed(3)}%{transform:translateX(0)}`;for(let q=1;q<_;q++){const Xt=-(100*q/_).toFixed(3),rt=(q*K).toFixed(3),ot=(q*K+ee).toFixed(3);Ze+=`${rt}%,${ot}%{transform:translateX(${Xt}%)}`}Ze+="99%,100%{transform:translateX(0)}}";let Ue="",yt="";for(let q=0;q<_;q++){const Xt=(q*K).toFixed(3),rt=(q*K+ee).toFixed(3),ot=Math.min((q+1)*K,100).toFixed(3),Qt="rgba(255,255,255,0.55)",Zr="rgba(255,255,255,1)";if(q===0)Ue+=`@keyframes pbx-isl-da-${q}{0%,${rt}%{background:${Zr}}${ot}%,100%{background:${Qt}}}`;else{const Fi=(q*K-.001).toFixed(3);Ue+=`@keyframes pbx-isl-da-${q}{0%,${Fi}%{background:${Qt}}${Xt}%,${rt}%{background:${Zr}}${ot}%,100%{background:${Qt}}}`}yt+=`[data-isl][data-isl-auto] .pbx-isl-dot:nth-child(${q+1}){animation:pbx-isl-da-${q} ${O}s infinite}`}let wt="",ge="";for(let q=0;q<_;q++){const Xt=(q*K).toFixed(3),rt=(q*K+ee).toFixed(3),ot=Math.min((q+1)*K,100).toFixed(3),Qt="opacity:0.55;background:rgba(255,255,255,0.25)",Zr="opacity:1;background:rgba(255,255,255,0.9)";if(q===0)wt+=`@keyframes pbx-isl-na-${q}{0%,${rt}%{${Zr}}${ot}%,100%{${Qt}}}`;else{const Fi=(q*K-.001).toFixed(3);wt+=`@keyframes pbx-isl-na-${q}{0%,${Fi}%{${Qt}}${Xt}%,${rt}%{${Zr}}${ot}%,100%{${Qt}}}`}ge+=`[data-isl][data-isl-auto] .pbx-isl-nums span:nth-child(${q+1}){animation:pbx-isl-na-${q} ${O}s infinite}`}let $="";for(let q=0;q<_;q++)q>0&&($+=","),$+=`[data-isl-active="${q}"] .pbx-isl-nums span:nth-child(${q+1})`;return $+="{opacity:1;background:rgba(255,255,255,0.9);color:#111;border-radius:9999px;padding:0.1rem 0.55rem;text-shadow:none}",[".pbx-isl-t{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none}",".pbx-isl-t::-webkit-scrollbar{display:none}",Ze,`[data-isl][data-isl-auto] .pbx-isl-t{overflow:hidden!important;scroll-snap-type:none!important;width:${ie}%!important;animation:pbx-isl-r ${O}s infinite;pointer-events:none}`,`[data-isl][data-isl-auto] .pbx-isl-t>div{min-width:${Qe}%!important}`,".pbx-isl-dot{display:inline-block;width:0.5rem;height:0.5rem;border-radius:50%;background:rgba(255,255,255,0.55);cursor:pointer}",".pbx-isl-nums{display:none;gap:0.75rem;margin-bottom:0.625rem}",".pbx-isl-nums span{font-size:1rem;font-weight:700;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,0.7);cursor:pointer;min-width:1.5rem;text-align:center;background:rgba(255,255,255,0.25);border-radius:9999px;padding:0.1rem 0.55rem;opacity:0.55;display:inline-block;box-sizing:border-box}","[data-pagebuilder-content] .pbx-isl-nums{display:flex}","[data-pagebuilder-content] .pbx-isl-nums span{opacity:0.4;transition:all 0.2s}",$,Ue,yt,wt,ge].join("")}const V=async _=>{var wt;if(!(s.value instanceof HTMLElement))return;const M=s.value.closest("[data-isl]");if(!M)return;const O=M.querySelector(".pbx-isl-t");if(!O)return;const K=O.children.length,ee=M.closest("section"),ie=ee==null?void 0:ee.querySelector("style"),Qe=O.querySelector("img"),Ze=(Qe==null?void 0:Qe.getAttribute("src"))||"";if(_>K)for(let ge=K;ge<_;ge++){const $=document.createElement("div");$.style.minWidth="100%",$.style.scrollSnapAlign="start";const q=document.createElement("img");q.src=Ze,q.style.width="100%",q.style.aspectRatio="16/9",q.style.objectFit="cover",q.style.display="block",q.alt=`Slide ${ge+1}`,$.appendChild(q),O.appendChild($)}else if(_<K)for(let ge=K-1;ge>=_;ge--)(wt=O.children[ge])==null||wt.remove();const Ue=M.querySelector(".pbx-isl-nums"),yt=Ue==null?void 0:Ue.nextElementSibling;if(Ue&&yt){Ue.innerHTML="",yt.innerHTML="";for(let ge=0;ge<_;ge++){const $=document.createElement("span");$.textContent=String(ge+1),$.setAttribute("onclick",D(ge)),ge===0&&($.style.opacity="1",$.style.background="rgba(255,255,255,0.9)",$.style.color="#111",$.style.borderRadius="9999px",$.style.padding="0.1rem 0.55rem",$.style.textShadow="none"),Ue.appendChild($);const q=document.createElement("span");q.className="pbx-isl-dot",ge===0&&(q.style.background="rgba(255,255,255,1)"),q.setAttribute("onclick",D(ge)),yt.appendChild(q)}}ie&&(ie.textContent=B(_,T.value)),m.value++,await o.refreshListeners(),await o.handleAutoSave()},Be=i.computed(()=>{if(!(s.value instanceof HTMLElement))return-1;const _=s.value.closest("[data-isl]");if(!_)return-1;const M=_.querySelector(".pbx-isl-t");if(!M)return-1;for(let O=0;O<M.children.length;O++)if(M.children[O].contains(s.value))return O;return-1});i.watch(Be,_=>{if(!(s.value instanceof HTMLElement))return;const M=s.value.closest("[data-isl]");M&&(_>=0?M.setAttribute("data-isl-active",String(_)):M.removeAttribute("data-isl-active"))});const Mo=i.computed(()=>{const _=a.getShowModalTipTap;return _&&Oi(),_}),xe=i.computed(()=>a.getComponent),ve=i.ref(""),No=i.ref(1),gr=i.ref(""),Po=i.ref(""),Lo=i.ref(""),Kt=i.ref(null),Bo=i.ref(null),Nt=i.ref(null),Jt=i.ref(null),tt=i.ref(null),Oi=function(){o.toggleTipTapModal(!0),ve.value="success",No.value=2,gr.value=t("Manage Content"),Po.value=null,Lo.value=null,Kt.value=null,Bo.value="Save",Nt.value=function(){o.toggleTipTapModal(!1)},tt.value=function(){o.toggleTipTapModal(!0)}},_i=i.computed(()=>a.getBasePrimaryImage),ur=i.ref(!1),Hi=i.ref(""),Ao=i.ref(""),Xe=i.ref(""),Pt=i.ref(null),Cp=i.ref(null),hr=i.ref(null),Ep=function(){ur.value=!0,Hi.value=t("Media Library"),Ao.value=null,Xe.value=t("Close"),Pt.value=t("Select image"),hr.value=function(){ur.value=!1}},Jr=i.ref(null),Yt=i.ref(""),Do=i.ref(!1),Ri=function(){Jr.value=null;const _=/^https?:\/\//,M=i.ref(!0);return M.value=_.test(Yt.value),M.value===!1?(Jr.value="The provided URL is invalid. Please ensure that it begins with 'https://' for proper formatting and security.",!0):!1},Tp=function(){var M;Jr.value=null;const _=s.value&&((M=s.value.firstElementChild)==null?void 0:M.tagName)==="IFRAME"&&s.value.firstElementChild.hasAttribute("src")&&(s.value.firstElementChild.getAttribute("src")??"").trim()!==""?s.value.firstElementChild.src:"";Yt.value=_,Do.value=!0,ve.value="success",No.value=2,gr.value=t("Add video url"),Po.value=null,Lo.value=t("Close"),Kt.value="Save",Bo.value=null,Nt.value=function(){Do.value=!1},Jt.value=function(){var K;if(!Ri()){if(s.value&&s.value.firstElementChild&&s.value.firstElementChild.tagName==="IFRAME"){let ee=Yt.value;try{const ie=new URL(Yt.value);if(ie.hostname.includes("youtube.com")||ie.hostname.includes("youtu.be")){let Qe="";if(ie.hostname.includes("youtu.be")?Qe=ie.pathname.slice(1):ie.pathname.includes("/embed/")?Qe=(K=ie.pathname.split("/embed/")[1])==null?void 0:K.split("?")[0]:ie.pathname.includes("/watch")&&(Qe=ie.searchParams.get("v")??""),Qe){const Ze=new URLSearchParams,Ue=ie.searchParams.get("list");Ue&&Ze.append("list",Ue),Ze.append("enablejsapi","1"),Ze.append("origin",window.location.origin),Ze.append("autoplay","0"),ee=`https://www.youtube.com/embed/${Qe}?${Ze.toString()}`}}}catch(ie){console.warn("URL parsing failed, using fallback method:",ie),ee=Yt.value.replace("watch?v=","embed/")}s.value.firstElementChild.src=ee}Do.value=!1}}},bt=i.ref(!1),Mp=async()=>{a.setToggleGlobalHtmlMode(!1),bt.value=!1,a.setShowModalHTMLEditor(!0)},Wa=()=>{bt.value=!1,n("open-global-page-settings")},xt=i.ref(!1),Vo=i.ref(""),zo=i.ref(1),Yr=i.ref(""),Xr=i.ref(""),Io=i.ref(""),fr=i.ref(null),yr=i.ref(null),Lt=i.ref(null),ji=i.ref(null),Qr=i.ref(null),Ga=function(){xt.value=!0,Vo.value="delete",zo.value=2,Yr.value=t("Remove Component?"),Xr.value=t("Are you sure you want to remove this Component?"),Io.value=t("Close"),fr.value=null,yr.value=t("Delete"),Lt.value=function(){xt.value=!1},Qr.value=async function(){await o.deleteComponentFromDOM(),xt.value=!1}},Oo=function(){var K;const _=s.value;if(!_)return;const M=_.closest("section");let O=!1;if(M){const ee=M.cloneNode(!0),ie=ee.querySelector("[selected]");ie&&(ie.remove(),O=!ee.querySelector("img, video, iframe, input, button, a, h1, h2, h3, h4, h5, h6, p, li, blockquote, pre, code, table")&&!((K=ee.textContent)!=null&&K.trim()))}xt.value=!0,Vo.value="delete",zo.value=2,O?(Yr.value=t("Delete element and component?"),Xr.value=t("Removing this element will leave the component empty, so the entire component will also be removed.")):(Yr.value=t("Delete element?"),Xr.value=t("You are about to remove this element. This action cannot be undone.")),Io.value=t("Close"),fr.value=null,yr.value=t("Delete"),Lt.value=function(){xt.value=!1},Qr.value=async function(){await o.deleteElementFromDOM(),xt.value=!1}},Ka=async function(){await o.duplicateElementInDOM()},_o=i.ref(!1);return(_,M)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",null,[i.createVNode($e,{maxWidth:"3xl",showModalBuilder:_o.value,title:i.unref(t)("Theme Color Presets"),onCloseMainModalBuilder:M[0]||(M[0]=O=>_o.value=!1)},{default:i.withCtx(()=>[i.createVNode(up)]),_:1},8,["showModalBuilder","title"]),i.createVNode(gt,{showDynamicModalBuilder:Do.value,maxWidth:"2xl",type:ve.value,gridColumnAmount:No.value,title:gr.value,description:Po.value,firstButtonText:Lo.value??void 0,secondButtonText:Kt.value??void 0,thirdButtonText:Bo.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:M[2]||(M[2]=()=>{var O;return(O=Nt.value)==null?void 0:O.call(Nt)}),onSecondModalButtonFunctionDynamicModalBuilder:M[3]||(M[3]=()=>{var O;return(O=Jt.value)==null?void 0:O.call(Jt)}),onThirdModalButtonFunctionDynamicModalBuilder:M[4]||(M[4]=()=>{var O;return(O=tt.value)==null?void 0:O.call(tt)})},{default:i.withCtx(()=>[M[25]||(M[25]=i.createElementVNode("header",null,null,-1)),i.createElementVNode("main",null,[i.createElementVNode("div",fO,[i.createElementVNode("div",yO,[i.createElementVNode("div",wO,[i.createElementVNode("label",vO,i.toDisplayString(i.unref(t)("Video url:")),1),i.withDirectives(i.createElementVNode("input",{id:"youtube-video","onUpdate:modelValue":M[1]||(M[1]=O=>Yt.value=O),type:"text",class:"pbx-myPrimaryInput",name:"video"},null,512),[[i.vModelText,Yt.value]]),Jr.value?(i.openBlock(),i.createElementBlock("div",kO,[i.createElementVNode("p",SO,i.toDisplayString(Jr.value),1)])):i.createCommentVNode("",!0)])])])])]),_:1},8,["showDynamicModalBuilder","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode(gt,{simpleModal:!0,showDynamicModalBuilder:Mo.value,maxWidth:"6xl",type:ve.value,gridColumnAmount:No.value,title:gr.value,description:Po.value,firstButtonText:Lo.value??void 0,secondButtonText:Kt.value??void 0,thirdButtonText:Bo.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:M[5]||(M[5]=()=>{var O;return(O=Nt.value)==null?void 0:O.call(Nt)}),onSecondModalButtonFunctionDynamicModalBuilder:M[6]||(M[6]=()=>{var O;return(O=Jt.value)==null?void 0:O.call(Jt)}),onThirdModalButtonFunctionDynamicModalBuilder:M[7]||(M[7]=()=>{var O;return(O=tt.value)==null?void 0:O.call(tt)})},{default:i.withCtx(()=>[M[26]||(M[26]=i.createElementVNode("header",null,null,-1)),i.createElementVNode("main",CO,[i.createVNode(Oz)])]),_:1},8,["showDynamicModalBuilder","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode(gt,{showDynamicModalBuilder:xt.value,type:Vo.value,gridColumnAmount:zo.value,title:Yr.value,description:Xr.value,firstButtonText:Io.value,secondButtonText:fr.value??void 0,thirdButtonText:yr.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:M[8]||(M[8]=()=>{var O;return(O=Lt.value)==null?void 0:O.call(Lt)}),onSecondModalButtonFunctionDynamicModalBuilder:M[9]||(M[9]=()=>{var O;return(O=ji.value)==null?void 0:O.call(ji)}),onThirdModalButtonFunctionDynamicModalBuilder:M[10]||(M[10]=()=>{var O;return(O=Qr.value)==null?void 0:O.call(Qr)})},{default:i.withCtx(()=>[...M[27]||(M[27]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode(LE,{open:ur.value,title:Hi.value,description:Ao.value,firstButtonText:Xe.value,secondButtonText:Pt.value??void 0,thirdButtonText:Cp.value??void 0,customMediaComponent:i.unref(l)??void 0,onFirstMediaButtonFunction:M[11]||(M[11]=()=>{var O;return(O=hr.value)==null?void 0:O.call(hr)})},null,8,["open","title","description","firstButtonText","secondButtonText","thirdButtonText","customMediaComponent"]),i.createElementVNode("div",EO,[i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["pbx-flex pbx-items-center pbx-justify-center pbx-gap-2",{"":s.value}])},[i.unref(o).ElOrFirstChildIsIframe()?(i.openBlock(),i.createElementBlock("div",TO,[i.createElementVNode("div",{onClick:Tp,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"},[...M[29]||(M[29]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," play_circle ",-1)])])])):i.createCommentVNode("",!0),i.unref(o).isSelectedElementValidText()&&!i.unref(o).ElOrFirstChildIsIframe()?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("div",MO,[i.createElementVNode("div",{onClick:Oi,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"},[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",NO,[...M[30]||(M[30]=[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M20.5 6.5L7 20H2v-5L15.5 1.5l5 5zm-7.823.651L4 15.828V18h2.172l8.677-8.677-2.172-2.172zm3.586.758L17.672 6.5 15.5 4.328l-1.409 1.41 2.172 2.17z","fill-rule":"evenodd"},null,-1)])]))])])]),i.createVNode(ZE)],64)):i.createCommentVNode("",!0),s.value&&xe.value&&_i.value&&!i.unref(o).ElOrFirstChildIsIframe()?(i.openBlock(),i.createElementBlock("div",PO,[i.createElementVNode("div",{onClick:Ep,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"},[...M[31]||(M[31]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," add_photo_alternate ",-1)])])])):i.createCommentVNode("",!0),s.value&&y.value?(i.openBlock(),i.createElementBlock("div",{key:3,onClick:E,class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",S.value?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor"]),title:i.unref(t)("Image Settings")},[i.createVNode(hp)],10,LO)):i.createCommentVNode("",!0),s.value&&s.value.nodeType===1&&!_i.value&&!i.unref(o).ElOrFirstChildIsIframe()?(i.openBlock(),i.createBlock($E,{key:4})):i.createCommentVNode("",!0),s.value&&xe.value&&P.value?(i.openBlock(),i.createElementBlock("div",{key:5,onClick:N,class:"pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",title:i.unref(t)("Component Settings")},[i.createVNode(hp)],8,BO)):i.createCommentVNode("",!0),x.value?(i.openBlock(),i.createElementBlock("div",{key:6,onClick:M[12]||(M[12]=O=>b.value=!0),class:i.normalizeClass([g.value?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor","pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"]),title:i.unref(t)("Slider Settings")},[...M[32]||(M[32]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," settings ",-1)])],10,AO)):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(gt,{key:7,showDynamicModalBuilder:f.value,isLoading:!1,type:"success",gridColumnAmount:1,title:i.unref(t)("Component Settings"),description:"",firstButtonText:i.unref(t)("Close"),onFirstModalButtonFunctionDynamicModalBuilder:M[13]||(M[13]=O=>f.value=!1)},{default:i.withCtx(()=>[M[34]||(M[34]=i.createElementVNode("header",null,null,-1)),i.createElementVNode("main",null,[i.createElementVNode("div",DO,[i.createElementVNode("div",VO,[i.createElementVNode("div",zO,[i.createElementVNode("div",IO,[i.createElementVNode("p",OO,i.toDisplayString(i.unref(t)("Full-width component")),1),i.createElementVNode("p",_O,i.toDisplayString(i.unref(t)("Stretch across browser width")),1)]),M[33]||(M[33]=i.createTextVNode(" hii ",-1)),i.createVNode(Ii,{"model-value":k.value,"onUpdate:modelValue":C},null,8,["model-value"])])])])])]),_:1},8,["showDynamicModalBuilder","title","firstButtonText"])):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(gt,{key:8,showDynamicModalBuilder:b.value,isLoading:!1,type:"success",gridColumnAmount:1,title:i.unref(t)("Slider Settings"),description:"",firstButtonText:i.unref(t)("Close"),onFirstModalButtonFunctionDynamicModalBuilder:M[14]||(M[14]=O=>b.value=!1)},{default:i.withCtx(()=>[M[36]||(M[36]=i.createElementVNode("header",null,null,-1)),i.createElementVNode("main",null,[i.createElementVNode("div",HO,[i.createElementVNode("div",RO,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-flex pbx-items-center pbx-justify-between pbx-px-4 pbx-py-3",g.value?"pbx-bg-myPrimaryLinkColor":"pbx-bg-gray-50"])},[i.createElementVNode("div",jO,[i.createElementVNode("span",{class:i.normalizeClass(["material-symbols-outlined pbx-text-xl",g.value?"pbx-text-white":"pbx-text-myPrimaryDarkGrayColor"])},"autoplay",2),i.createElementVNode("span",{class:i.normalizeClass(["pbx-text-sm pbx-font-semibold",g.value?"pbx-text-white":"pbx-text-myPrimaryDarkGrayColor"])},i.toDisplayString(i.unref(t)("Auto Rotate")),3)]),i.createVNode(Ii,{"model-value":g.value,"onUpdate:modelValue":A},null,8,["model-value"])],2),g.value?(i.openBlock(),i.createElementBlock("div",FO,[i.createElementVNode("p",qO,i.toDisplayString(i.unref(t)("Rotation Speed (s)")),1),i.createElementVNode("div",UO,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList([1,2,3,4,5],O=>i.createElementVNode("button",{key:O,onClick:K=>v(O),class:i.normalizeClass([T.value===O?"pbx-bg-myPrimaryLinkColor pbx-text-white pbx-shadow-sm":"pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-gray-200","pbx-h-9 pbx-w-9 pbx-rounded-xl pbx-text-sm pbx-font-semibold pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center pbx-border-0 pbx-transition-colors"]),type:"button"},i.toDisplayString(O),11,WO)),64))])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",GO,[i.createElementVNode("div",KO,[M[35]||(M[35]=i.createElementVNode("span",{class:"material-symbols-outlined pbx-text-xl pbx-text-myPrimaryDarkGrayColor"},"photo_library",-1)),i.createElementVNode("p",JO,i.toDisplayString(i.unref(t)("Number of images")),1)]),i.createElementVNode("div",YO,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList([2,3,4,5,6],O=>i.createElementVNode("button",{key:O,onClick:K=>V(O),class:i.normalizeClass([u.value===O?"pbx-bg-myPrimaryLinkColor pbx-text-white pbx-shadow-sm":"pbx-bg-white pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-gray-200 pbx-border pbx-border-solid pbx-border-gray-200","pbx-h-9 pbx-w-9 pbx-rounded-xl pbx-text-sm pbx-font-semibold pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center pbx-border-0 pbx-transition-colors"]),type:"button"},i.toDisplayString(O),11,XO)),64))])])])])]),_:1},8,["showDynamicModalBuilder","title","firstButtonText"])):i.createCommentVNode("",!0),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:9,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",onClick:M[15]||(M[15]=O=>bt.value=!bt.value)},[...M[37]||(M[37]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," more_horiz ",-1)])])):i.createCommentVNode("",!0),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:10,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",onClick:M[16]||(M[16]=O=>i.unref(o).clearHtmlSelection())},[...M[38]||(M[38]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," close_small",-1)])])):i.createCommentVNode("",!0)],2)])]),i.createVNode(i.Transition,{name:"popup-fade"},{default:i.withCtx(()=>[bt.value?(i.openBlock(),i.createElementBlock("div",QO,[i.createElementVNode("div",ZO,[i.createElementVNode("div",$O,[i.createElementVNode("div",e_,[i.createElementVNode("p",t_,i.toDisplayString(i.unref(t)("Layout & order")),1),M[39]||(M[39]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:0,onClick:M[17]||(M[17]=O=>i.unref(o).reorderComponent(-1)),disabled:!p.value,class:i.normalizeClass(["pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-py-2 pbx-px-2 pbx-rounded-full",[p.value?"pbx-cursor-pointer hover:pbx-bg-gray-50":"pbx-cursor-not-allowed"]])},[i.createElementVNode("div",{class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-border pbx-border-gray-500",[p.value?"hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer":"pbx-cursor-not-allowed pbx-bg-opacity-20 hover:pbx-bg-gray-200"]])},[...M[40]||(M[40]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," move_up ",-1)])],2),i.createElementVNode("div",o_,i.toDisplayString(i.unref(t)("Move up")),1)],10,r_)):i.createCommentVNode("",!0),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:1,onClick:M[18]||(M[18]=O=>i.unref(o).reorderComponent(1)),disabled:!d.value,class:i.normalizeClass(["pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-py-2 pbx-px-2 pbx-rounded-full",[d.value?"pbx-cursor-pointer hover:pbx-bg-gray-50":"pbx-cursor-not-allowed "]])},[i.createElementVNode("div",{class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-border pbx-border-gray-500",[d.value?"hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border":"pbx-cursor-not-allowed pbx-bg-opacity-20 hover:pbx-bg-gray-200"]])},[...M[41]||(M[41]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," move_down ",-1)])],2),i.createElementVNode("div",n_,i.toDisplayString(i.unref(t)("Move down")),1)],10,i_)):i.createCommentVNode("",!0),c.value?(i.openBlock(),i.createElementBlock("div",{key:2,onClick:M[19]||(M[19]=O=>i.unref(o).reverseComponentLayout()),class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-gray-100 pbx-py-2 pbx-px-2 pbx-rounded-full"},[M[42]||(M[42]=i.createElementVNode("div",{class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," swap_horiz ")],-1)),i.createElementVNode("div",a_,i.toDisplayString(i.unref(t)("Reverse layout")),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",l_,[i.createElementVNode("p",s_,i.toDisplayString(i.unref(t)("Element actions")),1),M[43]||(M[43]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),s.value&&xe.value&&s.value.tagName!=="SECTION"?(i.openBlock(),i.createElementBlock("div",{key:3,onClick:M[20]||(M[20]=O=>Ka()),class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-gray-100 pbx-py-2 pbx-px-2 pbx-rounded-full"},[M[44]||(M[44]=i.createElementVNode("div",{class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," content_copy ")],-1)),i.createElementVNode("div",p_,i.toDisplayString(i.unref(t)("Duplicate element")),1)])):i.createCommentVNode("",!0),s.value&&xe.value&&s.value.tagName!=="SECTION"?(i.openBlock(),i.createElementBlock("div",{key:4,onClick:M[21]||(M[21]=O=>Oo()),class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-red-200 pbx-py-2 pbx-px-2 pbx-rounded-full"},[M[45]||(M[45]=i.createElementVNode("div",{class:"ppbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square hover:pbx-bg-myPrimaryErrorColor hover:pbx-text-white pbx-text-myPrimaryErrorColor pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," delete ")],-1)),i.createElementVNode("div",d_,i.toDisplayString(i.unref(t)("Delete element")),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",c_,[i.createElementVNode("p",m_,i.toDisplayString(i.unref(t)("Component actions")),1),M[46]||(M[46]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:5,onClick:M[22]||(M[22]=()=>{bt.value=!bt.value,i.unref(o).duplicateComponent()}),class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-gray-100 pbx-py-2 pbx-px-2 pbx-rounded-full"},[i.createElementVNode("div",b_,[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",x_,[...M[47]||(M[47]=[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M2 16V2h14v4h4v14H6v-4H2zM4 4h10v10H4V4zm4 12v2h10V8h-2v8H8z","fill-rule":"evenodd"},null,-1)])]))])]),i.createElementVNode("div",g_,i.toDisplayString(i.unref(t)("Duplicate component")),1)])):i.createCommentVNode("",!0),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:6,onClick:M[23]||(M[23]=O=>Ga()),class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-red-200 pbx-py-2 pbx-px-2 pbx-rounded-full"},[M[48]||(M[48]=i.createElementVNode("div",{class:"ppbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square hover:pbx-bg-myPrimaryErrorColor hover:pbx-text-white pbx-text-myPrimaryErrorColor pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," delete_forever ")],-1)),i.createElementVNode("div",u_,i.toDisplayString(i.unref(t)("Delete component")),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",h_,[i.createElementVNode("p",f_,i.toDisplayString(i.unref(t)("Theme & colors")),1),M[49]||(M[49]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),i.createElementVNode("div",{class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-py-2 pbx-px-2 pbx-rounded-full pbx-cursor-pointer hover:pbx-bg-gray-50",onClick:M[24]||(M[24]=i.withModifiers(O=>_o.value=!0,["stop"]))},[M[50]||(M[50]=i.createElementVNode("div",{class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," palette ")],-1)),i.createElementVNode("div",y_,i.toDisplayString(i.unref(t)("Theme Color Presets")),1)]),i.createElementVNode("div",w_,[i.createElementVNode("p",v_,i.toDisplayString(i.unref(t)("Advanced tools")),1),M[51]||(M[51]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:7,onClick:Mp,class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-gray-100 pbx-py-2 pbx-px-2 pbx-rounded-full"},[M[52]||(M[52]=i.createElementVNode("div",{class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," deployed_code ")],-1)),i.createElementVNode("div",k_,i.toDisplayString(i.unref(t)("HTML Editor")),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",S_,[i.createElementVNode("p",C_,i.toDisplayString(i.unref(t)("Page settings")),1),M[53]||(M[53]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:8,onClick:Wa,class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-gray-100 pbx-py-2 pbx-px-2 pbx-rounded-full"},[i.createElementVNode("div",E_,[i.createVNode(hp)]),i.createElementVNode("div",T_,i.toDisplayString(i.unref(t)("Global Page Styles")),1)])):i.createCommentVNode("",!0)])])])):i.createCommentVNode("",!0)]),_:1})],64))}}),fp=[{html_code:`
|
|
177
|
+
0 0 0 1px rgba(0, 0, 0, 0.04)`},onClick:k[0]||(k[0]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",{style:i.normalizeStyle([{backgroundColor:N.color},{width:"100%",height:"72px"}])},null,4),i.createElementVNode("div",OI,[i.createElementVNode("p",_I,i.toDisplayString(N.color),1),i.createElementVNode("label",{for:"color-wheel-"+N.id,class:"pbx-myPrimaryButton pbx-flex pbx-items-center pbx-justify-center pbx-gap-2 pbx-w-full pbx-cursor-pointer"},[k[1]||(k[1]=i.createElementVNode("span",{class:"material-symbols-outlined pbx-text-base pbx-leading-none"}," colorize ",-1)),i.createTextVNode(" "+i.toDisplayString(i.unref(e)("Color wheel")),1)],8,HI)]),i.createElementVNode("input",{id:"color-wheel-"+N.id,value:N.color,type:"color",style:{position:"absolute",opacity:"0",width:"1px",height:"1px","pointer-events":"none"},onInput:C=>g(N,C)},null,40,RI)])):i.createCommentVNode("",!0)])])]))),128))]),i.createElementVNode("div",jI,[i.createElementVNode("div",null,[i.createElementVNode("p",FI,i.toDisplayString(i.unref(e)("Reset to provided defaults")),1),i.createElementVNode("p",qI,i.toDisplayString(i.unref(e)("Restore the original colors provided to the page builder")),1)]),i.createElementVNode("button",{type:"button",class:"pbx-mySecondaryButton pbx-flex pbx-items-center pbx-gap-1 pbx-shrink-0",onClick:y},[k[2]||(k[2]=i.createElementVNode("span",{class:"material-symbols-outlined pbx-text-base pbx-leading-none"},"restart_alt",-1)),i.createTextVNode(" "+i.toDisplayString(i.unref(e)("Reset")),1)])])]),i.createVNode(gt,{showDynamicModalBuilder:w.value,type:"delete",gridColumnAmount:2,title:i.unref(e)("Reset to provided defaults"),description:i.unref(e)("This will restore the original colors provided to the page builder. Any changes you have made to colors or enabled states will be lost."),firstButtonText:i.unref(e)("Close"),thirdButtonText:i.unref(e)("Reset"),onFirstModalButtonFunctionDynamicModalBuilder:S,onThirdModalButtonFunctionDynamicModalBuilder:E},{default:i.withCtx(()=>[...k[3]||(k[3]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","title","description","firstButtonText","thirdButtonText"])],64))}}),UI={class:"pbx-relative"},WI={class:"pbx-flex pbx-justify-start pbx-items-center pbx-gap-2"},GI={key:0,class:"material-symbols-outlined"},KI=["title"],JI={class:"pbx-flex pbx-flex-col"},YI={class:"pbx-flex pbx-gap-2 pbx-items-center"},XI={class:"pbx-px-3 pbx-py-2 pbx-text-xs pbx-font-semibold pbx-text-gray-500"},QI={class:"pbx-flex pbx-items-center"},ZI={class:"pbx-ml-3"},$I={key:0,class:"pbx-flex pbx-items-center"},eO={class:"pbx-ml-3"},tO={key:1,class:"pbx-flex pbx-items-center"},rO={class:"pbx-ml-3"},ZE=i.defineComponent({__name:"TextColorEditor",props:{globalPageLayout:{type:Boolean}},setup(r){const{translate:e}=re(),t=ce(),o=oe,n=i.ref(null),a=i.ref(!1),l=i.computed(()=>o.getTextColor),s=i.computed(()=>o.getPageBuilderConfig),{enabledThemeColorPresets:p}=gp(s),d=i.computed(()=>{var m;return(m=n.value)!=null&&m.startsWith("custom:")?n.value.replace("custom:",""):""});function c(m){n.value=`custom:${m}`,t.handleCustomTextColor(m)}return i.watch(l,async m=>{n.value=m,await t.initializeElementStyles()},{immediate:!0}),(m,b)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(i.unref(Di),{as:"div",modelValue:n.value,"onUpdate:modelValue":b[2]||(b[2]=x=>n.value=x)},{default:i.withCtx(()=>[i.createElementVNode("div",UI,[i.createElementVNode("div",{class:i.normalizeClass([r.globalPageLayout?"pbx-flex pbx-flex-col pbx-border-solid pbx-border pbx-border-gray-400":"pbx-flex pbx-gap-2 pbx-items-center"])},[r.globalPageLayout?(i.openBlock(),i.createBlock(i.unref(Gr),{key:0,class:"pbx-flex pbx-flex-row pbx-justify-between pbx-items-center pbx-pl-3 pbx-pr-3 pbx-py-5 pbx-cursor-pointer pbx-duration-200 hover:pbx-bg-myPrimaryLightGrayColor pbx-bg-white hover:pbx-text-black pbx-text-black pbx-font-sans pbx-font-medium pbx-border-0"},{default:i.withCtx(()=>{var x;return[i.createElementVNode("div",WI,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border pbx-border-gray-600 pbx-rounded-sm pbx-bg-none pbx-border-solid",d.value?"":`pbx-bg-${(x=n.value)==null?void 0:x.replace("pbx-text-","")}`]),style:i.normalizeStyle(d.value?{backgroundColor:d.value}:void 0)},null,6),i.createElementVNode("div",null,[i.createElementVNode("div",null,i.toDisplayString(i.unref(e)("Text Color")),1)])]),r.globalPageLayout?(i.openBlock(),i.createElementBlock("span",GI," chevron_right ")):i.createCommentVNode("",!0)]}),_:1})):i.createCommentVNode("",!0),r.globalPageLayout?(i.openBlock(),i.createElementBlock("button",{key:1,type:"button",class:"pbx-m-2 pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-xl pbx-border-0 pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",title:i.unref(e)("Theme Color Presets"),onClick:b[0]||(b[0]=i.withModifiers(x=>a.value=!0,["stop"]))},[...b[4]||(b[4]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," palette ",-1)])],8,KI)):i.createCommentVNode("",!0),r.globalPageLayout?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(Gr),{key:2,as:"div",class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"},{default:i.withCtx(()=>{var x;return[i.createElementVNode("div",JI,[i.createElementVNode("div",YI,[i.createElementVNode("span",{class:i.normalizeClass(["material-symbols-outlined",d.value?"":`pbx-text-${(x=n.value)==null?void 0:x.replace("pbx-text-","")}`]),style:i.normalizeStyle([{"text-shadow":"rgb(0 0 0 / 10%) 1.5px 1.5px 0px"},d.value?{color:d.value}:void 0])}," format_color_text ",6)])])]}),_:1}))],2),i.createVNode(i.Transition,{"leave-active-class":"pbx-transition pbx-ease-in pbx-duration-100","leave-from-class":"pbx-opacity-100","leave-to-class":"pbx-opacity-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(Vi),{class:"pbx-headless-dropdown pbx-absolute pbx-min-w-[12rem] pbx-z-40 pbx-mt-1 pbx-max-h-56 pbx-w-full pbx-overflow-auto pbx-rounded-md pbx-bg-gray-50 pbx-py-1 pbx-text-base pbx-shadow-lg pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 focus:pbx-outline-none sm:pbx-text-sm"},{default:i.withCtx(()=>[i.unref(p).length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",XI,i.toDisplayString(i.unref(e)("Theme Color Presets")),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(p),x=>(i.openBlock(),i.createBlock(i.unref(Kr),{as:"template",key:x.id,value:`custom:${x.color}`,onClick:g=>c(x.color)},{default:i.withCtx(({active:g})=>[i.createElementVNode("li",{class:i.normalizeClass([g?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-text-myPrimaryDarkGrayColor","pbx-relative pbx-cursor-default pbx-select-none pbx-py-2 pbx-pl-3 pbx-pr-9"])},[i.createElementVNode("div",QI,[i.createElementVNode("div",{class:"pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border-solid pbx-border pbx-border-gray-100 pbx-rounded-sm",style:i.normalizeStyle({backgroundColor:x.color})},null,4),i.createElementVNode("span",ZI,i.toDisplayString(i.unref(e)(x.label)),1)])],2)]),_:2},1032,["value","onClick"]))),128)),b[5]||(b[5]=i.createElementVNode("div",{class:"pbx-my-1 pbx-border-0 pbx-border-t pbx-border-solid pbx-border-gray-200"},null,-1))],64)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(So).textColorVariables,x=>(i.openBlock(),i.createBlock(i.unref(Kr),{as:"template",onClick:b[1]||(b[1]=g=>i.unref(t).handleTextColor(n.value??void 0)),key:x,value:x},{default:i.withCtx(({active:g})=>[i.createElementVNode("li",{class:i.normalizeClass([g?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-text-myPrimaryDarkGrayColor","pbx-relative pbx-cursor-default pbx-select-none pbx-py-2 pbx-pl-3 pbx-pr-9"])},[x==="none"?(i.openBlock(),i.createElementBlock("div",$I,[b[6]||(b[6]=i.createElementVNode("span",{class:"material-symbols-outlined"}," invert_colors ",-1)),i.createElementVNode("span",eO,i.toDisplayString(i.unref(e)("Default black")),1)])):i.createCommentVNode("",!0),x!=="none"?(i.openBlock(),i.createElementBlock("div",tO,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border-solid pbx-border pbx-border-gray-100 pbx-rounded-sm",`pbx-bg-${x.replace("pbx-text-","")}`])},null,2),i.createElementVNode("span",rO,i.toDisplayString(x),1)])):i.createCommentVNode("",!0)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})])]),_:1},8,["modelValue"]),i.createVNode($e,{maxWidth:"3xl",showModalBuilder:a.value,title:i.unref(e)("Theme Color Presets"),onCloseMainModalBuilder:b[3]||(b[3]=x=>a.value=!1)},{default:i.withCtx(()=>[i.createVNode(up)]),_:1},8,["showModalBuilder","title"])],64))}}),oO={class:"pbx-relative"},iO={class:"pbx-flex pbx-justify-start pbx-items-center pbx-gap-2"},nO={key:0,class:"material-symbols-outlined"},aO=["title"],lO={class:"pbx-flex pbx-flex-col"},sO={class:"pbx-flex pbx-gap-2 pbx-items-center"},pO={fill:"currentColor",height:"25",viewBox:"0 0 22 22",width:"26",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},dO={class:"pbx-px-3 pbx-py-2 pbx-text-xs pbx-font-semibold pbx-text-gray-500"},cO={class:"pbx-flex pbx-items-center"},mO={class:"pbx-ml-3"},bO={key:0,class:"pbx-flex pbx-items-center"},xO={class:"pbx-ml-3"},gO={key:1,class:"pbx-flex pbx-items-center"},uO={class:"pbx-ml-3"},$E=i.defineComponent({__name:"BackgroundColorEditor",props:{globalPageLayout:{type:Boolean}},setup(r){const{translate:e}=re(),t=ce(),o=oe,n=i.ref(null),a=i.ref(!1),l=i.computed(()=>o.getBackgroundColor),s=i.computed(()=>o.getPageBuilderConfig),{enabledThemeColorPresets:p}=gp(s),d=i.computed(()=>{var m;return(m=n.value)!=null&&m.startsWith("custom:")?n.value.replace("custom:",""):""});function c(m){n.value=`custom:${m}`,t.handleCustomBackgroundColor(m)}return i.watch(l,async m=>{n.value=m,await t.initializeElementStyles()},{immediate:!0}),(m,b)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(i.unref(Di),{as:"div",modelValue:n.value,"onUpdate:modelValue":b[2]||(b[2]=x=>n.value=x)},{default:i.withCtx(()=>[i.createElementVNode("div",oO,[i.createElementVNode("div",{class:i.normalizeClass([r.globalPageLayout?"pbx-flex pbx-flex-col pbx-border-solid pbx-border pbx-border-gray-400":"pbx-flex pbx-gap-2 pbx-items-center"])},[r.globalPageLayout?(i.openBlock(),i.createBlock(i.unref(Gr),{key:0,class:"pbx-flex pbx-flex-row pbx-justify-between pbx-items-center pbx-pl-3 pbx-pr-3 pbx-py-5 pbx-cursor-pointer pbx-duration-200 hover:pbx-bg-myPrimaryLightGrayColor pbx-bg-white hover:pbx-text-black pbx-text-black pbx-font-sans pbx-font-medium pbx-border-0"},{default:i.withCtx(()=>{var x;return[i.createElementVNode("div",iO,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border pbx-border-gray-600 pbx-rounded-sm pbx-bg-none pbx-border-solid",d.value?"":`pbx-bg-${(x=n.value)==null?void 0:x.replace("pbx-bg-","")}`]),style:i.normalizeStyle(d.value?{backgroundColor:d.value}:void 0)},null,6),i.createElementVNode("div",null,i.toDisplayString(i.unref(e)("Background Color")),1)]),r.globalPageLayout?(i.openBlock(),i.createElementBlock("span",nO," chevron_right ")):i.createCommentVNode("",!0)]}),_:1})):i.createCommentVNode("",!0),r.globalPageLayout?(i.openBlock(),i.createElementBlock("button",{key:1,type:"button",class:"pbx-m-2 pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-xl pbx-border-0 pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",title:i.unref(e)("Theme Color Presets"),onClick:b[0]||(b[0]=i.withModifiers(x=>a.value=!0,["stop"]))},[...b[4]||(b[4]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," palette ",-1)])],8,aO)):i.createCommentVNode("",!0),r.globalPageLayout?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(Gr),{key:2,as:"div",class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"},{default:i.withCtx(()=>[i.createElementVNode("div",lO,[i.createElementVNode("div",sO,[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",pO,[...b[5]||(b[5]=[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M4 11l8-8 8 8-8 8-8-8zm8-5.172L17.172 11H6.828L12 5.828z","fill-rule":"evenodd"},null,-1),i.createElementVNode("path",{d:"M3.5 13s-2 2.757-2 4.054c0 1.075.895 1.946 2 1.946s2-.871 2-1.946c0-1.297-2-4.054-2-4.054z"},null,-1)])]))]),i.createCommentVNode("",!0)])])]),_:1}))],2),i.createVNode(i.Transition,{"leave-active-class":"pbx-transition pbx-ease-in pbx-duration-100","leave-from-class":"pbx-opacity-100","leave-to-class":"pbx-opacity-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(Vi),{class:"pbx-headless-dropdown pbx-absolute pbx-min-w-[12rem] pbx-z-40 pbx-mt-1 pbx-max-h-56 pbx-w-full pbx-overflow-auto pbx-rounded-md pbx-bg-gray-50 pbx-py-1 pbx-text-base pbx-shadow-lg pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 focus:pbx-outline-none sm:pbx-text-sm"},{default:i.withCtx(()=>[i.unref(p).length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",dO,i.toDisplayString(i.unref(e)("Theme Color Presets")),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(p),x=>(i.openBlock(),i.createBlock(i.unref(Kr),{as:"template",key:x.id,value:`custom:${x.color}`,onClick:g=>c(x.color)},{default:i.withCtx(({active:g})=>[i.createElementVNode("li",{class:i.normalizeClass([g?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-text-myPrimaryDarkGrayColor","pbx-relative pbx-cursor-default pbx-select-none pbx-py-2 pbx-pl-3 pbx-pr-9"])},[i.createElementVNode("div",cO,[i.createElementVNode("div",{class:"pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border-solid pbx-border pbx-border-gray-100 pbx-rounded-sm",style:i.normalizeStyle({backgroundColor:x.color})},null,4),i.createElementVNode("span",mO,i.toDisplayString(i.unref(e)(x.label)),1)])],2)]),_:2},1032,["value","onClick"]))),128)),b[6]||(b[6]=i.createElementVNode("div",{class:"pbx-my-1 pbx-border-0 pbx-border-t pbx-border-solid pbx-border-gray-200"},null,-1))],64)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(So).backgroundColorVariables,x=>(i.openBlock(),i.createBlock(i.unref(Kr),{as:"template",onClick:b[1]||(b[1]=g=>i.unref(t).handleBackgroundColor(n.value??void 0)),key:x,value:x},{default:i.withCtx(({active:g})=>[i.createElementVNode("li",{class:i.normalizeClass([g?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-text-myPrimaryDarkGrayColor","pbx-relative pbx-cursor-default pbx-select-none pbx-py-2 pbx-pl-3 pbx-pr-9"])},[x==="none"?(i.openBlock(),i.createElementBlock("div",bO,[b[7]||(b[7]=i.createElementVNode("span",{class:"material-symbols-outlined"}," ev_shadow ",-1)),i.createElementVNode("span",xO,i.toDisplayString(i.unref(e)("Transparent")),1)])):i.createCommentVNode("",!0),x!=="none"?(i.openBlock(),i.createElementBlock("div",gO,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-aspect-square pbx-w-6 pbx-h-6 pbx-border-solid pbx-border pbx-border-gray-100 pbx-rounded-sm",`pbx-bg-${x.replace("pbx-bg-","")}`])},null,2),i.createElementVNode("span",uO,i.toDisplayString(x),1)])):i.createCommentVNode("",!0)],2)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})])]),_:1},8,["modelValue"]),i.createVNode($e,{maxWidth:"3xl",showModalBuilder:a.value,title:i.unref(e)("Theme Color Presets"),onCloseMainModalBuilder:b[3]||(b[3]=x=>a.value=!1)},{default:i.withCtx(()=>[i.createVNode(up)]),_:1},8,["showModalBuilder","title"])],64))}}),hO=["width","height"],hp=i.defineComponent({__name:"SliderIcon",props:{size:{default:16}},setup(r){return(e,t)=>(i.openBlock(),i.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:r.size,height:r.size,viewBox:"0 0 12 12","aria-hidden":"true"},[...t[0]||(t[0]=[i.createStaticVNode('<title>slider</title><g fill="none"><line x1="11.25" y1="8.75" x2="6.25" y2="8.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></line><circle cx="4.25" cy="8.75" r="2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><line x1="2.25" y1="8.75" x2=".75" y2="8.75" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></line><line x1=".75" y1="3.25" x2="5.75" y2="3.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></line><circle cx="7.75" cy="3.25" r="2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></circle><line x1="9.75" y1="3.25" x2="11.25" y2="3.25" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"></line></g>',2)])],8,hO))}}),fO={class:"pbx-myInputGroup"},yO={class:"pbx-myPrimaryFormOrganizationHeaderDescriptionSection"},wO={class:"pbx-myPrimaryFormOrganizationHeader"},vO={for:"youtube-video",class:"pbx-myPrimaryInputLabel"},kO={key:0,class:"pbx-min-h-[2.5rem] pbx-flex pbx-items-center pbx-justify-start"},SO={class:"pbx-myPrimaryInputError pbx-mt-2 pbx-mb-0 pbx-py-0 pbx-self-start"},CO={class:"pbx-overflow-y-auto"},EO={class:"pbx-select-none"},TO={key:0,class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max"},MO={class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max"},NO={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},PO={key:2,class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-w-max"},LO=["title"],BO=["title"],AO=["title"],DO={class:"pbx-flex pbx-flex-col pbx-gap-3 pbx-pt-1 pbx-pb-2"},VO={class:"pbx-rounded-2xl pbx-border pbx-border-solid pbx-border-gray-100 pbx-bg-gray-50 pbx-px-4 pbx-py-3"},zO={class:"pbx-flex pbx-items-center pbx-justify-between pbx-gap-4"},IO={class:"pbx-flex pbx-flex-col pbx-gap-1"},OO={class:"pbx-text-sm pbx-font-semibold pbx-text-myPrimaryDarkGrayColor"},_O={class:"pbx-text-xs pbx-text-gray-500 pbx-my-0"},HO={class:"pbx-flex pbx-flex-col pbx-gap-3 pbx-pt-1 pbx-pb-2"},RO={class:"pbx-rounded-2xl pbx-border pbx-border-solid pbx-border-gray-100 pbx-overflow-hidden"},jO={class:"pbx-flex pbx-items-center pbx-gap-2"},FO={key:0,class:"pbx-px-4 pbx-py-3 pbx-border-0 pbx-border-t pbx-border-solid pbx-border-gray-100 pbx-bg-white"},qO={class:"pbx-text-xs pbx-text-gray-400 pbx-font-medium pbx-mb-2 pbx-uppercase pbx-tracking-wide"},UO={class:"pbx-flex pbx-gap-2"},WO=["onClick"],GO={class:"pbx-rounded-2xl pbx-border pbx-border-solid pbx-border-gray-100 pbx-bg-gray-50 pbx-px-4 pbx-py-3"},KO={class:"pbx-flex pbx-items-center pbx-gap-2 pbx-mb-2"},JO={class:"pbx-text-xs pbx-text-gray-400 pbx-font-medium pbx-uppercase pbx-tracking-wide"},YO={class:"pbx-flex pbx-gap-2"},XO=["onClick"],QO={key:0,class:"pbx-absolute pbx-top-10 pbx-transform pbx-select-none pbx-bg-white pbx-rounded-2xl pbx-py-2 pbx-px-2 pbx-border-solid pbx-border pbx-border-gray-200 pbx-inset-x-auto pbx-z-40 pbx-w-56"},ZO={class:"pbx-overflow-y-scroll pbx-h-[20rem] pbx-max-h-[20rem] pbx-min-h-[20rem] pbx-pb-4"},$O={class:"pbx-flex pbx-flex-col"},e_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},t_={class:"pbx-myPrimaryParagraph pbx-text-xs"},r_=["disabled"],o_={class:"pbx-text-sm"},i_=["disabled"],n_={class:"pbx-text-sm"},a_={class:"pbx-text-sm"},l_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},s_={class:"pbx-myPrimaryParagraph pbx-text-xs"},p_={class:"pbx-text-sm"},d_={class:"pbx-text-sm"},c_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},m_={class:"pbx-myPrimaryParagraph pbx-text-xs"},b_={class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},x_={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},g_={class:"pbx-text-sm"},u_={class:"pbx-text-sm"},h_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},f_={class:"pbx-myPrimaryParagraph pbx-text-xs"},y_={class:"pbx-text-sm"},w_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},v_={class:"pbx-myPrimaryParagraph pbx-text-xs"},k_={class:"pbx-text-sm"},S_={class:"pbx-mt-6 pbx-mb-2 pbx-w-full"},C_={class:"pbx-myPrimaryParagraph pbx-text-xs"},E_={class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},T_={class:"pbx-text-sm"},M_=i.defineComponent({__name:"EditGetElement",emits:["open-global-page-settings","open-image-settings"],setup(r,{emit:e}){const{translate:t}=re(),o=ce(),n=e,a=oe,l=i.inject("CustomMediaComponent",null),s=i.computed(()=>a.getElement);i.computed(()=>{var _;return(_=s.value)==null?void 0:_.tagName});const p=i.computed(()=>o.canMoveUp()),d=i.computed(()=>o.canMoveDown()),c=i.computed(()=>!s.value||!xe.value?!1:!!o.findReverseableContainer()),m=i.ref(0),b=i.ref(!1),x=i.computed(()=>!!(s.value instanceof HTMLElement&&s.value.closest("[data-isl]"))),g=i.computed(()=>{var _;return m.value,s.value instanceof HTMLElement?((_=s.value.closest("[data-isl]"))==null?void 0:_.hasAttribute("data-isl-auto"))??!1:!1}),u=i.computed(()=>{if(m.value,!(s.value instanceof HTMLElement))return 3;const _=s.value.closest("[data-isl]");if(!_)return 3;const M=_.querySelector(".pbx-isl-t");return M?M.children.length:3}),h=i.ref(0),f=i.ref(!1),w=i.ref(0),y=i.computed(()=>(w.value,o.isSelectedElementImage())),S=i.computed(()=>a.getImageSettingsPanelOpen),E=()=>{w.value++,n("open-image-settings")},P=i.computed(()=>(h.value,o.isSelectedComponentTopElement())),k=i.computed(()=>(h.value,o.selectedComponentIsFullWidth())),N=()=>{h.value++,f.value=!0},C=async _=>{const M=o.setSelectedComponentFullWidth(_);h.value++,await M,h.value++},A=async()=>{if(!(s.value instanceof HTMLElement))return;const _=s.value.closest("[data-isl]");if(!_)return;if(_.hasAttribute("data-isl-auto"))_.removeAttribute("data-isl-auto");else{const K=_.querySelector(".pbx-isl-t");K&&(K.scrollLeft=0),_.setAttribute("data-isl-auto","")}const M=_.querySelectorAll(".pbx-isl-nums span"),O=_.querySelectorAll(".pbx-isl-dot");M.forEach((K,ee)=>K.setAttribute("onclick",D(ee))),O.forEach((K,ee)=>K.setAttribute("onclick",D(ee))),m.value++,await o.handleAutoSave()},T=i.computed(()=>{if(m.value,!(s.value instanceof HTMLElement))return 3;const _=s.value.closest("[data-isl]");return parseInt((_==null?void 0:_.getAttribute("data-isl-speed"))||"3",10)}),v=async _=>{if(!(s.value instanceof HTMLElement))return;const M=s.value.closest("[data-isl]");if(!M)return;M.setAttribute("data-isl-speed",String(_));const O=M.closest("section"),K=O==null?void 0:O.querySelector("style"),ee=M.querySelector(".pbx-isl-t"),ie=ee?ee.children.length:3;K&&(K.textContent=B(ie,_)),m.value++,await o.handleAutoSave()};function D(_){const M=`var ns=c.querySelectorAll('.pbx-isl-nums span');ns.forEach(function(s,i){s.style.opacity=i===${_}?'1':'0.55';s.style.background=i===${_}?'rgba(255,255,255,0.9)':'rgba(255,255,255,0.25)';s.style.borderRadius='9999px';s.style.padding='0.1rem 0.55rem';s.style.color=i===${_}?'#111':'#fff';s.style.textShadow=i===${_}?'none':'0 1px 4px rgba(0,0,0,0.7)';});`,O=`var ds=c.querySelectorAll('.pbx-isl-dot');ds.forEach(function(dot,i){dot.style.background=i===${_}?'rgba(255,255,255,1)':'rgba(255,255,255,0.55)';});`,K=`var inBuilder=!!c.closest('[data-builder-canvas]');if(c.hasAttribute('data-isl-auto')&&!inBuilder){var sp=parseInt(c.getAttribute('data-isl-speed')||'3',10);var dl=(${_===0?"0":`(-${_}*sp)`})+'s';var els=[t].concat(Array.from(c.querySelectorAll('.pbx-isl-dot,.pbx-isl-nums span')));els.forEach(function(el){el.style.animation='none';});t.offsetHeight;els.forEach(function(el){el.style.animation='';el.style.animationDelay=dl;el.style.opacity='';el.style.background='';});}else{t.scrollTo({left:t.children[${_}].offsetLeft,behavior:'smooth'});}`;return`(function(d,e){e.stopPropagation();var c=d.closest('[data-isl]');var t=c.querySelector('.pbx-isl-t');${M}${O}${K}var img=t.children[${_}].querySelector('img');if(img)img.click();})(this,event)`}function B(_,M=3){const O=_*M,K=100/_,ee=Math.max(K-3,1),ie=_*100,Qe=(100/_).toFixed(3);let Ze=`@keyframes pbx-isl-r{0%,${ee.toFixed(3)}%{transform:translateX(0)}`;for(let q=1;q<_;q++){const Xt=-(100*q/_).toFixed(3),rt=(q*K).toFixed(3),ot=(q*K+ee).toFixed(3);Ze+=`${rt}%,${ot}%{transform:translateX(${Xt}%)}`}Ze+="99%,100%{transform:translateX(0)}}";let Ue="",yt="";for(let q=0;q<_;q++){const Xt=(q*K).toFixed(3),rt=(q*K+ee).toFixed(3),ot=Math.min((q+1)*K,100).toFixed(3),Qt="rgba(255,255,255,0.55)",Zr="rgba(255,255,255,1)";if(q===0)Ue+=`@keyframes pbx-isl-da-${q}{0%,${rt}%{background:${Zr}}${ot}%,100%{background:${Qt}}}`;else{const Fi=(q*K-.001).toFixed(3);Ue+=`@keyframes pbx-isl-da-${q}{0%,${Fi}%{background:${Qt}}${Xt}%,${rt}%{background:${Zr}}${ot}%,100%{background:${Qt}}}`}yt+=`[data-isl][data-isl-auto] .pbx-isl-dot:nth-child(${q+1}){animation:pbx-isl-da-${q} ${O}s infinite}`}let wt="",ge="";for(let q=0;q<_;q++){const Xt=(q*K).toFixed(3),rt=(q*K+ee).toFixed(3),ot=Math.min((q+1)*K,100).toFixed(3),Qt="opacity:0.55;background:rgba(255,255,255,0.25)",Zr="opacity:1;background:rgba(255,255,255,0.9)";if(q===0)wt+=`@keyframes pbx-isl-na-${q}{0%,${rt}%{${Zr}}${ot}%,100%{${Qt}}}`;else{const Fi=(q*K-.001).toFixed(3);wt+=`@keyframes pbx-isl-na-${q}{0%,${Fi}%{${Qt}}${Xt}%,${rt}%{${Zr}}${ot}%,100%{${Qt}}}`}ge+=`[data-isl][data-isl-auto] .pbx-isl-nums span:nth-child(${q+1}){animation:pbx-isl-na-${q} ${O}s infinite}`}let $="";for(let q=0;q<_;q++)q>0&&($+=","),$+=`[data-isl-active="${q}"] .pbx-isl-nums span:nth-child(${q+1})`;return $+="{opacity:1;background:rgba(255,255,255,0.9);color:#111;border-radius:9999px;padding:0.1rem 0.55rem;text-shadow:none}",[".pbx-isl-t{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none}",".pbx-isl-t::-webkit-scrollbar{display:none}",Ze,`[data-isl][data-isl-auto] .pbx-isl-t{overflow:hidden!important;scroll-snap-type:none!important;width:${ie}%!important;animation:pbx-isl-r ${O}s infinite;pointer-events:none}`,`[data-isl][data-isl-auto] .pbx-isl-t>div{min-width:${Qe}%!important}`,".pbx-isl-dot{display:inline-block;width:0.5rem;height:0.5rem;border-radius:50%;background:rgba(255,255,255,0.55);cursor:pointer}",".pbx-isl-nums{display:none;gap:0.75rem;margin-bottom:0.625rem}",".pbx-isl-nums span{font-size:1rem;font-weight:700;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,0.7);cursor:pointer;min-width:1.5rem;text-align:center;background:rgba(255,255,255,0.25);border-radius:9999px;padding:0.1rem 0.55rem;opacity:0.55;display:inline-block;box-sizing:border-box}","[data-pagebuilder-content] .pbx-isl-nums{display:flex}","[data-pagebuilder-content] .pbx-isl-nums span{opacity:0.4;transition:all 0.2s}",$,Ue,yt,wt,ge].join("")}const V=async _=>{var wt;if(!(s.value instanceof HTMLElement))return;const M=s.value.closest("[data-isl]");if(!M)return;const O=M.querySelector(".pbx-isl-t");if(!O)return;const K=O.children.length,ee=M.closest("section"),ie=ee==null?void 0:ee.querySelector("style"),Qe=O.querySelector("img"),Ze=(Qe==null?void 0:Qe.getAttribute("src"))||"";if(_>K)for(let ge=K;ge<_;ge++){const $=document.createElement("div");$.style.minWidth="100%",$.style.scrollSnapAlign="start";const q=document.createElement("img");q.src=Ze,q.style.width="100%",q.style.aspectRatio="16/9",q.style.objectFit="cover",q.style.display="block",q.alt=`Slide ${ge+1}`,$.appendChild(q),O.appendChild($)}else if(_<K)for(let ge=K-1;ge>=_;ge--)(wt=O.children[ge])==null||wt.remove();const Ue=M.querySelector(".pbx-isl-nums"),yt=Ue==null?void 0:Ue.nextElementSibling;if(Ue&&yt){Ue.innerHTML="",yt.innerHTML="";for(let ge=0;ge<_;ge++){const $=document.createElement("span");$.textContent=String(ge+1),$.setAttribute("onclick",D(ge)),ge===0&&($.style.opacity="1",$.style.background="rgba(255,255,255,0.9)",$.style.color="#111",$.style.borderRadius="9999px",$.style.padding="0.1rem 0.55rem",$.style.textShadow="none"),Ue.appendChild($);const q=document.createElement("span");q.className="pbx-isl-dot",ge===0&&(q.style.background="rgba(255,255,255,1)"),q.setAttribute("onclick",D(ge)),yt.appendChild(q)}}ie&&(ie.textContent=B(_,T.value)),m.value++,await o.refreshListeners(),await o.handleAutoSave()},Be=i.computed(()=>{if(!(s.value instanceof HTMLElement))return-1;const _=s.value.closest("[data-isl]");if(!_)return-1;const M=_.querySelector(".pbx-isl-t");if(!M)return-1;for(let O=0;O<M.children.length;O++)if(M.children[O].contains(s.value))return O;return-1});i.watch(Be,_=>{if(!(s.value instanceof HTMLElement))return;const M=s.value.closest("[data-isl]");M&&(_>=0?M.setAttribute("data-isl-active",String(_)):M.removeAttribute("data-isl-active"))});const Mo=i.computed(()=>{const _=a.getShowModalTipTap;return _&&Oi(),_}),xe=i.computed(()=>a.getComponent),ve=i.ref(""),No=i.ref(1),gr=i.ref(""),Po=i.ref(""),Lo=i.ref(""),Kt=i.ref(null),Bo=i.ref(null),Nt=i.ref(null),Jt=i.ref(null),tt=i.ref(null),Oi=function(){o.toggleTipTapModal(!0),ve.value="success",No.value=2,gr.value=t("Manage Content"),Po.value=null,Lo.value=null,Kt.value=null,Bo.value="Save",Nt.value=function(){o.toggleTipTapModal(!1)},tt.value=function(){o.toggleTipTapModal(!0)}},_i=i.computed(()=>a.getBasePrimaryImage),ur=i.ref(!1),Hi=i.ref(""),Ao=i.ref(""),Xe=i.ref(""),Pt=i.ref(null),Cp=i.ref(null),hr=i.ref(null),Ep=function(){ur.value=!0,Hi.value=t("Media Library"),Ao.value=null,Xe.value=t("Close"),Pt.value=t("Select image"),hr.value=function(){ur.value=!1}},Jr=i.ref(null),Yt=i.ref(""),Do=i.ref(!1),Ri=function(){Jr.value=null;const _=/^https?:\/\//,M=i.ref(!0);return M.value=_.test(Yt.value),M.value===!1?(Jr.value="The provided URL is invalid. Please ensure that it begins with 'https://' for proper formatting and security.",!0):!1},Tp=function(){var M;Jr.value=null;const _=s.value&&((M=s.value.firstElementChild)==null?void 0:M.tagName)==="IFRAME"&&s.value.firstElementChild.hasAttribute("src")&&(s.value.firstElementChild.getAttribute("src")??"").trim()!==""?s.value.firstElementChild.src:"";Yt.value=_,Do.value=!0,ve.value="success",No.value=2,gr.value=t("Add video url"),Po.value=null,Lo.value=t("Close"),Kt.value="Save",Bo.value=null,Nt.value=function(){Do.value=!1},Jt.value=function(){var K;if(!Ri()){if(s.value&&s.value.firstElementChild&&s.value.firstElementChild.tagName==="IFRAME"){let ee=Yt.value;try{const ie=new URL(Yt.value);if(ie.hostname.includes("youtube.com")||ie.hostname.includes("youtu.be")){let Qe="";if(ie.hostname.includes("youtu.be")?Qe=ie.pathname.slice(1):ie.pathname.includes("/embed/")?Qe=(K=ie.pathname.split("/embed/")[1])==null?void 0:K.split("?")[0]:ie.pathname.includes("/watch")&&(Qe=ie.searchParams.get("v")??""),Qe){const Ze=new URLSearchParams,Ue=ie.searchParams.get("list");Ue&&Ze.append("list",Ue),Ze.append("enablejsapi","1"),Ze.append("origin",window.location.origin),Ze.append("autoplay","0"),ee=`https://www.youtube.com/embed/${Qe}?${Ze.toString()}`}}}catch(ie){console.warn("URL parsing failed, using fallback method:",ie),ee=Yt.value.replace("watch?v=","embed/")}s.value.firstElementChild.src=ee}Do.value=!1}}},bt=i.ref(!1),Mp=async()=>{a.setToggleGlobalHtmlMode(!1),bt.value=!1,a.setShowModalHTMLEditor(!0)},Wa=()=>{bt.value=!1,n("open-global-page-settings")},xt=i.ref(!1),Vo=i.ref(""),zo=i.ref(1),Yr=i.ref(""),Xr=i.ref(""),Io=i.ref(""),fr=i.ref(null),yr=i.ref(null),Lt=i.ref(null),ji=i.ref(null),Qr=i.ref(null),Ga=function(){xt.value=!0,Vo.value="delete",zo.value=2,Yr.value=t("Remove Component?"),Xr.value=t("Are you sure you want to remove this Component?"),Io.value=t("Close"),fr.value=null,yr.value=t("Delete"),Lt.value=function(){xt.value=!1},Qr.value=async function(){await o.deleteComponentFromDOM(),xt.value=!1}},Oo=function(){var K;const _=s.value;if(!_)return;const M=_.closest("section");let O=!1;if(M){const ee=M.cloneNode(!0),ie=ee.querySelector("[selected]");ie&&(ie.remove(),O=!ee.querySelector("img, video, iframe, input, button, a, h1, h2, h3, h4, h5, h6, p, li, blockquote, pre, code, table")&&!((K=ee.textContent)!=null&&K.trim()))}xt.value=!0,Vo.value="delete",zo.value=2,O?(Yr.value=t("Delete element and component?"),Xr.value=t("Removing this element will leave the component empty, so the entire component will also be removed.")):(Yr.value=t("Delete element?"),Xr.value=t("You are about to remove this element. This action cannot be undone.")),Io.value=t("Close"),fr.value=null,yr.value=t("Delete"),Lt.value=function(){xt.value=!1},Qr.value=async function(){await o.deleteElementFromDOM(),xt.value=!1}},Ka=async function(){await o.duplicateElementInDOM()},_o=i.ref(!1);return(_,M)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",null,[i.createVNode($e,{maxWidth:"3xl",showModalBuilder:_o.value,title:i.unref(t)("Theme Color Presets"),onCloseMainModalBuilder:M[0]||(M[0]=O=>_o.value=!1)},{default:i.withCtx(()=>[i.createVNode(up)]),_:1},8,["showModalBuilder","title"]),i.createVNode(gt,{showDynamicModalBuilder:Do.value,maxWidth:"2xl",type:ve.value,gridColumnAmount:No.value,title:gr.value,description:Po.value,firstButtonText:Lo.value??void 0,secondButtonText:Kt.value??void 0,thirdButtonText:Bo.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:M[2]||(M[2]=()=>{var O;return(O=Nt.value)==null?void 0:O.call(Nt)}),onSecondModalButtonFunctionDynamicModalBuilder:M[3]||(M[3]=()=>{var O;return(O=Jt.value)==null?void 0:O.call(Jt)}),onThirdModalButtonFunctionDynamicModalBuilder:M[4]||(M[4]=()=>{var O;return(O=tt.value)==null?void 0:O.call(tt)})},{default:i.withCtx(()=>[M[25]||(M[25]=i.createElementVNode("header",null,null,-1)),i.createElementVNode("main",null,[i.createElementVNode("div",fO,[i.createElementVNode("div",yO,[i.createElementVNode("div",wO,[i.createElementVNode("label",vO,i.toDisplayString(i.unref(t)("Video url:")),1),i.withDirectives(i.createElementVNode("input",{id:"youtube-video","onUpdate:modelValue":M[1]||(M[1]=O=>Yt.value=O),type:"text",class:"pbx-myPrimaryInput",name:"video"},null,512),[[i.vModelText,Yt.value]]),Jr.value?(i.openBlock(),i.createElementBlock("div",kO,[i.createElementVNode("p",SO,i.toDisplayString(Jr.value),1)])):i.createCommentVNode("",!0)])])])])]),_:1},8,["showDynamicModalBuilder","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode(gt,{simpleModal:!0,showDynamicModalBuilder:Mo.value,maxWidth:"6xl",type:ve.value,gridColumnAmount:No.value,title:gr.value,description:Po.value,firstButtonText:Lo.value??void 0,secondButtonText:Kt.value??void 0,thirdButtonText:Bo.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:M[5]||(M[5]=()=>{var O;return(O=Nt.value)==null?void 0:O.call(Nt)}),onSecondModalButtonFunctionDynamicModalBuilder:M[6]||(M[6]=()=>{var O;return(O=Jt.value)==null?void 0:O.call(Jt)}),onThirdModalButtonFunctionDynamicModalBuilder:M[7]||(M[7]=()=>{var O;return(O=tt.value)==null?void 0:O.call(tt)})},{default:i.withCtx(()=>[M[26]||(M[26]=i.createElementVNode("header",null,null,-1)),i.createElementVNode("main",CO,[i.createVNode(Oz)])]),_:1},8,["showDynamicModalBuilder","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode(gt,{showDynamicModalBuilder:xt.value,type:Vo.value,gridColumnAmount:zo.value,title:Yr.value,description:Xr.value,firstButtonText:Io.value,secondButtonText:fr.value??void 0,thirdButtonText:yr.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:M[8]||(M[8]=()=>{var O;return(O=Lt.value)==null?void 0:O.call(Lt)}),onSecondModalButtonFunctionDynamicModalBuilder:M[9]||(M[9]=()=>{var O;return(O=ji.value)==null?void 0:O.call(ji)}),onThirdModalButtonFunctionDynamicModalBuilder:M[10]||(M[10]=()=>{var O;return(O=Qr.value)==null?void 0:O.call(Qr)})},{default:i.withCtx(()=>[...M[27]||(M[27]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode(LE,{open:ur.value,title:Hi.value,description:Ao.value,firstButtonText:Xe.value,secondButtonText:Pt.value??void 0,thirdButtonText:Cp.value??void 0,customMediaComponent:i.unref(l)??void 0,onFirstMediaButtonFunction:M[11]||(M[11]=()=>{var O;return(O=hr.value)==null?void 0:O.call(hr)})},null,8,["open","title","description","firstButtonText","secondButtonText","thirdButtonText","customMediaComponent"]),i.createElementVNode("div",EO,[i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["pbx-flex pbx-items-center pbx-justify-center pbx-gap-2",{"":s.value}])},[i.unref(o).ElOrFirstChildIsIframe()?(i.openBlock(),i.createElementBlock("div",TO,[i.createElementVNode("div",{onClick:Tp,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"},[...M[29]||(M[29]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," play_circle ",-1)])])])):i.createCommentVNode("",!0),i.unref(o).isSelectedElementValidText()&&!i.unref(o).ElOrFirstChildIsIframe()?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("div",MO,[i.createElementVNode("div",{onClick:Oi,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"},[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",NO,[...M[30]||(M[30]=[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M20.5 6.5L7 20H2v-5L15.5 1.5l5 5zm-7.823.651L4 15.828V18h2.172l8.677-8.677-2.172-2.172zm3.586.758L17.672 6.5 15.5 4.328l-1.409 1.41 2.172 2.17z","fill-rule":"evenodd"},null,-1)])]))])])]),i.createVNode(ZE)],64)):i.createCommentVNode("",!0),s.value&&xe.value&&_i.value&&!i.unref(o).ElOrFirstChildIsIframe()?(i.openBlock(),i.createElementBlock("div",PO,[i.createElementVNode("div",{onClick:Ep,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"},[...M[31]||(M[31]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," add_photo_alternate ",-1)])])])):i.createCommentVNode("",!0),s.value&&y.value?(i.openBlock(),i.createElementBlock("div",{key:3,onClick:E,class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",S.value?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor"]),title:i.unref(t)("Image Settings")},[i.createVNode(hp)],10,LO)):i.createCommentVNode("",!0),s.value&&s.value.nodeType===1&&!_i.value&&!i.unref(o).ElOrFirstChildIsIframe()?(i.openBlock(),i.createBlock($E,{key:4})):i.createCommentVNode("",!0),s.value&&xe.value&&P.value?(i.openBlock(),i.createElementBlock("div",{key:5,onClick:N,class:"pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",title:i.unref(t)("Component Settings")},[i.createVNode(hp)],8,BO)):i.createCommentVNode("",!0),x.value?(i.openBlock(),i.createElementBlock("div",{key:6,onClick:M[12]||(M[12]=O=>b.value=!0),class:i.normalizeClass([g.value?"pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor","pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white"]),title:i.unref(t)("Slider Settings")},[...M[32]||(M[32]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," settings ",-1)])],10,AO)):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(gt,{key:7,showDynamicModalBuilder:f.value,isLoading:!1,type:"success",gridColumnAmount:1,title:i.unref(t)("Component Settings"),description:"",firstButtonText:i.unref(t)("Close"),onFirstModalButtonFunctionDynamicModalBuilder:M[13]||(M[13]=O=>f.value=!1)},{default:i.withCtx(()=>[M[33]||(M[33]=i.createElementVNode("header",null,null,-1)),i.createElementVNode("main",null,[i.createElementVNode("div",DO,[i.createElementVNode("div",VO,[i.createElementVNode("div",zO,[i.createElementVNode("div",IO,[i.createElementVNode("p",OO,i.toDisplayString(i.unref(t)("Full-width component")),1),i.createElementVNode("p",_O,i.toDisplayString(i.unref(t)("Stretch across browser width")),1)]),i.createVNode(Ii,{"model-value":k.value,"onUpdate:modelValue":C},null,8,["model-value"])])])])])]),_:1},8,["showDynamicModalBuilder","title","firstButtonText"])):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(gt,{key:8,showDynamicModalBuilder:b.value,isLoading:!1,type:"success",gridColumnAmount:1,title:i.unref(t)("Slider Settings"),description:"",firstButtonText:i.unref(t)("Close"),onFirstModalButtonFunctionDynamicModalBuilder:M[14]||(M[14]=O=>b.value=!1)},{default:i.withCtx(()=>[M[35]||(M[35]=i.createElementVNode("header",null,null,-1)),i.createElementVNode("main",null,[i.createElementVNode("div",HO,[i.createElementVNode("div",RO,[i.createElementVNode("div",{class:i.normalizeClass(["pbx-flex pbx-items-center pbx-justify-between pbx-px-4 pbx-py-3",g.value?"pbx-bg-myPrimaryLinkColor":"pbx-bg-gray-50"])},[i.createElementVNode("div",jO,[i.createElementVNode("span",{class:i.normalizeClass(["material-symbols-outlined pbx-text-xl",g.value?"pbx-text-white":"pbx-text-myPrimaryDarkGrayColor"])},"autoplay",2),i.createElementVNode("span",{class:i.normalizeClass(["pbx-text-sm pbx-font-semibold",g.value?"pbx-text-white":"pbx-text-myPrimaryDarkGrayColor"])},i.toDisplayString(i.unref(t)("Auto Rotate")),3)]),i.createVNode(Ii,{"model-value":g.value,"onUpdate:modelValue":A},null,8,["model-value"])],2),g.value?(i.openBlock(),i.createElementBlock("div",FO,[i.createElementVNode("p",qO,i.toDisplayString(i.unref(t)("Rotation Speed (s)")),1),i.createElementVNode("div",UO,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList([1,2,3,4,5],O=>i.createElementVNode("button",{key:O,onClick:K=>v(O),class:i.normalizeClass([T.value===O?"pbx-bg-myPrimaryLinkColor pbx-text-white pbx-shadow-sm":"pbx-bg-gray-100 pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-gray-200","pbx-h-9 pbx-w-9 pbx-rounded-xl pbx-text-sm pbx-font-semibold pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center pbx-border-0 pbx-transition-colors"]),type:"button"},i.toDisplayString(O),11,WO)),64))])])):i.createCommentVNode("",!0)]),i.createElementVNode("div",GO,[i.createElementVNode("div",KO,[M[34]||(M[34]=i.createElementVNode("span",{class:"material-symbols-outlined pbx-text-xl pbx-text-myPrimaryDarkGrayColor"},"photo_library",-1)),i.createElementVNode("p",JO,i.toDisplayString(i.unref(t)("Number of images")),1)]),i.createElementVNode("div",YO,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList([2,3,4,5,6],O=>i.createElementVNode("button",{key:O,onClick:K=>V(O),class:i.normalizeClass([u.value===O?"pbx-bg-myPrimaryLinkColor pbx-text-white pbx-shadow-sm":"pbx-bg-white pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-gray-200 pbx-border pbx-border-solid pbx-border-gray-200","pbx-h-9 pbx-w-9 pbx-rounded-xl pbx-text-sm pbx-font-semibold pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center pbx-border-0 pbx-transition-colors"]),type:"button"},i.toDisplayString(O),11,XO)),64))])])])])]),_:1},8,["showDynamicModalBuilder","title","firstButtonText"])):i.createCommentVNode("",!0),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:9,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",onClick:M[15]||(M[15]=O=>bt.value=!bt.value)},[...M[36]||(M[36]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," more_horiz ",-1)])])):i.createCommentVNode("",!0),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:10,class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-bg-gray-100 pbx-rounded-xl hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white",onClick:M[16]||(M[16]=O=>i.unref(o).clearHtmlSelection())},[...M[37]||(M[37]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," close_small",-1)])])):i.createCommentVNode("",!0)],2)])]),i.createVNode(i.Transition,{name:"popup-fade"},{default:i.withCtx(()=>[bt.value?(i.openBlock(),i.createElementBlock("div",QO,[i.createElementVNode("div",ZO,[i.createElementVNode("div",$O,[i.createElementVNode("div",e_,[i.createElementVNode("p",t_,i.toDisplayString(i.unref(t)("Layout & order")),1),M[38]||(M[38]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:0,onClick:M[17]||(M[17]=O=>i.unref(o).reorderComponent(-1)),disabled:!p.value,class:i.normalizeClass(["pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-py-2 pbx-px-2 pbx-rounded-full",[p.value?"pbx-cursor-pointer hover:pbx-bg-gray-50":"pbx-cursor-not-allowed"]])},[i.createElementVNode("div",{class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-border pbx-border-gray-500",[p.value?"hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer":"pbx-cursor-not-allowed pbx-bg-opacity-20 hover:pbx-bg-gray-200"]])},[...M[39]||(M[39]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," move_up ",-1)])],2),i.createElementVNode("div",o_,i.toDisplayString(i.unref(t)("Move up")),1)],10,r_)):i.createCommentVNode("",!0),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:1,onClick:M[18]||(M[18]=O=>i.unref(o).reorderComponent(1)),disabled:!d.value,class:i.normalizeClass(["pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-py-2 pbx-px-2 pbx-rounded-full",[d.value?"pbx-cursor-pointer hover:pbx-bg-gray-50":"pbx-cursor-not-allowed "]])},[i.createElementVNode("div",{class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor pbx-border pbx-border-gray-500",[d.value?"hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border":"pbx-cursor-not-allowed pbx-bg-opacity-20 hover:pbx-bg-gray-200"]])},[...M[40]||(M[40]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," move_down ",-1)])],2),i.createElementVNode("div",n_,i.toDisplayString(i.unref(t)("Move down")),1)],10,i_)):i.createCommentVNode("",!0),c.value?(i.openBlock(),i.createElementBlock("div",{key:2,onClick:M[19]||(M[19]=O=>i.unref(o).reverseComponentLayout()),class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-gray-100 pbx-py-2 pbx-px-2 pbx-rounded-full"},[M[41]||(M[41]=i.createElementVNode("div",{class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," swap_horiz ")],-1)),i.createElementVNode("div",a_,i.toDisplayString(i.unref(t)("Reverse layout")),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",l_,[i.createElementVNode("p",s_,i.toDisplayString(i.unref(t)("Element actions")),1),M[42]||(M[42]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),s.value&&xe.value&&s.value.tagName!=="SECTION"?(i.openBlock(),i.createElementBlock("div",{key:3,onClick:M[20]||(M[20]=O=>Ka()),class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-gray-100 pbx-py-2 pbx-px-2 pbx-rounded-full"},[M[43]||(M[43]=i.createElementVNode("div",{class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," content_copy ")],-1)),i.createElementVNode("div",p_,i.toDisplayString(i.unref(t)("Duplicate element")),1)])):i.createCommentVNode("",!0),s.value&&xe.value&&s.value.tagName!=="SECTION"?(i.openBlock(),i.createElementBlock("div",{key:4,onClick:M[21]||(M[21]=O=>Oo()),class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-red-200 pbx-py-2 pbx-px-2 pbx-rounded-full"},[M[44]||(M[44]=i.createElementVNode("div",{class:"ppbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square hover:pbx-bg-myPrimaryErrorColor hover:pbx-text-white pbx-text-myPrimaryErrorColor pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," delete ")],-1)),i.createElementVNode("div",d_,i.toDisplayString(i.unref(t)("Delete element")),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",c_,[i.createElementVNode("p",m_,i.toDisplayString(i.unref(t)("Component actions")),1),M[45]||(M[45]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:5,onClick:M[22]||(M[22]=()=>{bt.value=!bt.value,i.unref(o).duplicateComponent()}),class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-gray-100 pbx-py-2 pbx-px-2 pbx-rounded-full"},[i.createElementVNode("div",b_,[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",x_,[...M[46]||(M[46]=[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M2 16V2h14v4h4v14H6v-4H2zM4 4h10v10H4V4zm4 12v2h10V8h-2v8H8z","fill-rule":"evenodd"},null,-1)])]))])]),i.createElementVNode("div",g_,i.toDisplayString(i.unref(t)("Duplicate component")),1)])):i.createCommentVNode("",!0),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:6,onClick:M[23]||(M[23]=O=>Ga()),class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-red-200 pbx-py-2 pbx-px-2 pbx-rounded-full"},[M[47]||(M[47]=i.createElementVNode("div",{class:"ppbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square hover:pbx-bg-myPrimaryErrorColor hover:pbx-text-white pbx-text-myPrimaryErrorColor pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," delete_forever ")],-1)),i.createElementVNode("div",u_,i.toDisplayString(i.unref(t)("Delete component")),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",h_,[i.createElementVNode("p",f_,i.toDisplayString(i.unref(t)("Theme & colors")),1),M[48]||(M[48]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),i.createElementVNode("div",{class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-py-2 pbx-px-2 pbx-rounded-full pbx-cursor-pointer hover:pbx-bg-gray-50",onClick:M[24]||(M[24]=i.withModifiers(O=>_o.value=!0,["stop"]))},[M[49]||(M[49]=i.createElementVNode("div",{class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center hover:pbx-bg-gray-100 pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," palette ")],-1)),i.createElementVNode("div",y_,i.toDisplayString(i.unref(t)("Theme Color Presets")),1)]),i.createElementVNode("div",w_,[i.createElementVNode("p",v_,i.toDisplayString(i.unref(t)("Advanced tools")),1),M[50]||(M[50]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:7,onClick:Mp,class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-gray-100 pbx-py-2 pbx-px-2 pbx-rounded-full"},[M[51]||(M[51]=i.createElementVNode("div",{class:"pbx-h-10 pbx-w-10 pbx-rounded-sm pbx-flex pbx-items-center pbx-justify-center pbx-aspect-square pbx-text-myPrimaryDarkGrayColor hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-cursor-pointer pbx-border pbx-border-gray-500"},[i.createElementVNode("span",{class:"material-symbols-outlined"}," deployed_code ")],-1)),i.createElementVNode("div",k_,i.toDisplayString(i.unref(t)("HTML Editor")),1)])):i.createCommentVNode("",!0),i.createElementVNode("div",S_,[i.createElementVNode("p",C_,i.toDisplayString(i.unref(t)("Page settings")),1),M[52]||(M[52]=i.createElementVNode("div",{class:"pbx-border-t pbx-border-gray-300 pbx-w-full"},null,-1))]),s.value&&xe.value?(i.openBlock(),i.createElementBlock("div",{key:8,onClick:Wa,class:"pbx-flex pbx-items-center pbx-justify-start pbx-gap-2 pbx-cursor-pointer hover:pbx-bg-gray-100 pbx-py-2 pbx-px-2 pbx-rounded-full"},[i.createElementVNode("div",E_,[i.createVNode(hp)]),i.createElementVNode("div",T_,i.toDisplayString(i.unref(t)("Global Page Styles")),1)])):i.createCommentVNode("",!0)])])])):i.createCommentVNode("",!0)]),_:1})],64))}}),fp=[{html_code:`
|
|
178
178
|
<section>
|
|
179
179
|
<div class="pbx-py-4 pbx-px-4">
|
|
180
180
|
<div class="pbx-mx-auto pbx-max-w-7xl">
|
|
@@ -389,9 +389,9 @@ ${t}
|
|
|
389
389
|
</html>
|
|
390
390
|
`,k=document.createElement("a");k.setAttribute("href","data:text/html;charset=utf-8,"+encodeURIComponent(P)),k.setAttribute("download",f),k.style.display="none",document.body.appendChild(k),k.click(),document.body.removeChild(k)},g=function(){const f=document.getElementById("pagebuilder");if(!f)return;let w=sT(f);const y=document.createElement("div");y.innerHTML=w,y.querySelectorAll("[hovered], [selected]").forEach(S=>{S.removeAttribute("hovered"),S.removeAttribute("selected")}),w=y.innerHTML,x("downloaded_html.html",w)},u=i.ref("globalPageStyles");function h(f){u.value=f}return(f,w)=>{var y,S,E,P,k,N,C,A,T,v;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",null,[i.createElementVNode("div",AF,[i.createElementVNode("div",DF,[i.createElementVNode("button",{onClick:w[0]||(w[0]=D=>h("globalPageStyles")),class:i.normalizeClass(["pbx-mySecondaryButton pbx-text-xs pbx-px-4",u.value==="globalPageStyles"?"pbx-bg-myPrimaryLinkColor pbx-text-white hover:pbx-text-white hover:pbx-bg-myPrimaryLinkColor":"hover:pbx-text-black"])},[w[6]||(w[6]=i.createStaticVNode('<span><svg fill="currentColor" height="22" viewBox="0 0 22 22" width="22" xmlns="http://www.w3.org/2000/svg" class="css-l0u10b"><g clip-path="url(#prefix__clip0_1645_485)"><path clip-rule="evenodd" d="M19.871 1.81a2.768 2.768 0 00-3.914 0l-3.543 3.544-2.5-2.5L0 12.768l8.914 8.914 9.914-9.914-2.5-2.5 3.543-3.543a2.768 2.768 0 000-3.914zm-2.5 1.415a.768.768 0 011.086 1.086L13.5 9.268l2.5 2.5-1.086 1.086-6.086-6.086 1.086-1.086 2.5 2.5 4.957-4.957zM7.414 8.182l-4.586 4.586 1.086 1.086 3.293-3.293 1.414 1.414-3.293 3.293 1.086 1.086 3.293-3.293 1.414 1.414-3.293 3.293 1.086 1.086 4.586-4.586-6.086-6.086z" fill-rule="evenodd"></path></g><defs><clipPath id="prefix__clip0_1645_485"><path d="M0 0h22v22H0z" fill="#fff"></path></clipPath></defs></svg></span>',1)),i.createElementVNode("span",null,i.toDisplayString(i.unref(e)("Global Page Styles")),1)],2),i.createElementVNode("button",{onClick:w[1]||(w[1]=D=>h("download")),class:i.normalizeClass(["pbx-mySecondaryButton pbx-text-xs pbx-px-4",u.value==="download"?"pbx-bg-myPrimaryLinkColor pbx-text-white hover:pbx-text-white hover:pbx-bg-myPrimaryLinkColor":"hover:pbx-text-black"])},[w[7]||(w[7]=i.createElementVNode("span",{class:"material-symbols-outlined"}," download_2 ",-1)),i.createElementVNode("span",null,i.toDisplayString(i.unref(e)("Download HTML")),1)],2)]),i.createElementVNode("div",null,[i.createElementVNode("button",{onClick:w[2]||(w[2]=D=>h("viewHTMLConfig")),class:i.normalizeClass(["pbx-mySecondaryButton pbx-text-xs pbx-px-4",u.value==="viewHTMLConfig"?"pbx-bg-myPrimaryLinkColor pbx-text-white hover:pbx-text-white hover:pbx-bg-myPrimaryLinkColor":"hover:pbx-text-black"])},[w[8]||(w[8]=i.createElementVNode("span",{class:"material-symbols-outlined"}," deployed_code ",-1)),i.createElementVNode("span",null,i.toDisplayString(i.unref(e)("Selected HTML")),1)],2)])]),r.isLoading?(i.openBlock(),i.createElementBlock("div",VF,[...w[9]||(w[9]=[i.createElementVNode("div",{class:"pbx-flex pbx-items-top pbx-justify-center pbx-mt-4 pbx-min-h-screen"},[i.createElementVNode("div",{class:"pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"},[i.createElementVNode("span",{class:"!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"},"Loading...")])],-1)])])):i.createCommentVNode("",!0),r.isLoading?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",zF,[u.value==="download"?(i.openBlock(),i.createElementBlock("div",IF,[Array.isArray(d.value)&&d.value.length>=1?(i.openBlock(),i.createElementBlock("div",OF,[i.createElementVNode("p",_F,i.toDisplayString(i.unref(e)("Export the entire page as a standalone HTML file. This includes all sections, content, and applied styles, making it ready for use or integration elsewhere.")),1),i.createElementVNode("div",HF,[i.createElementVNode("button",{onClick:g,type:"button",class:"pbx-myPrimaryButton"},[w[10]||(w[10]=i.createElementVNode("span",{class:"material-symbols-outlined"}," download_2 ",-1)),i.createElementVNode("span",null,i.toDisplayString(i.unref(e)("Download HTML file")),1)])])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),u.value==="globalPageStyles"?(i.openBlock(),i.createElementBlock("div",RF,[i.createElementVNode("div",null,[i.createElementVNode("p",jF,i.toDisplayString(i.unref(e)("Apply styles that affect the entire page. These settings include global font family, text color, background color, and other universal styles that apply to all sections.")),1),i.createElementVNode("div",FF,[i.createElementVNode("div",qF,[i.createElementVNode("div",UF,[i.createElementVNode("p",WF,i.toDisplayString(i.unref(e)("Full-width page")),1),i.createElementVNode("p",GF,i.toDisplayString(i.unref(e)("Stretch all sections across browser width")),1)]),i.createVNode(Ii,{"model-value":l.value,"onUpdate:modelValue":s},null,8,["model-value"])])]),i.createElementVNode("div",KF,[i.createElementVNode("article",JF,[w[11]||(w[11]=i.createElementVNode("p",{class:"pbx-myPrimaryParagraph pbx-italic pbx-pb-2 lg:pbx-mt-6 pbx-mt-8"}," Typography ",-1)),i.createVNode(NF)]),i.createElementVNode("article",YF,[w[12]||(w[12]=i.createElementVNode("p",{class:"pbx-myPrimaryParagraph pbx-italic pbx-pb-2 lg:pbx-mt-6 pbx-mt-8"}," Text color ",-1)),i.createVNode(ZE,{globalPageLayout:!0})]),i.createElementVNode("article",XF,[w[13]||(w[13]=i.createElementVNode("p",{class:"pbx-myPrimaryParagraph pbx-italic pbx-pb-2 lg:pbx-mt-6 pbx-mt-8"}," Background color ",-1)),i.createVNode($E,{globalPageLayout:!0})]),i.createElementVNode("article",QF,[w[14]||(w[14]=i.createElementVNode("p",{class:"pbx-myPrimaryParagraph pbx-italic pbx-pb-2 lg:pbx-mt-6 pbx-mt-8"}," Padding ",-1)),i.createVNode(iT)]),i.createElementVNode("article",ZF,[w[15]||(w[15]=i.createElementVNode("p",{class:"pbx-myPrimaryParagraph pbx-italic pbx-pb-2 lg:pbx-mt-6 pbx-mt-8"}," Margin ",-1)),i.createVNode(nT)]),i.createElementVNode("article",$F,[w[16]||(w[16]=i.createElementVNode("p",{class:"pbx-myPrimaryParagraph pbx-italic pbx-pb-2 lg:pbx-mt-6 pbx-mt-8"}," Border radius ",-1)),i.createVNode(aT)]),i.createElementVNode("article",eq,[w[17]||(w[17]=i.createElementVNode("p",{class:"pbx-myPrimaryParagraph pbx-italic pbx-pb-2 lg:pbx-mt-6 pbx-mt-8"}," Border style ",-1)),i.createVNode(lT)]),i.createElementVNode("article",tq,[w[18]||(w[18]=i.createElementVNode("p",{class:"pbx-myPrimaryParagraph pbx-italic pbx-pb-2 lg:pbx-mt-6 pbx-mt-8"},"CSS",-1)),i.createVNode(rT)]),i.createElementVNode("article",rq,[w[19]||(w[19]=i.createElementVNode("p",{class:"pbx-myPrimaryParagraph pbx-italic pbx-pb-2 lg:pbx-mt-6 pbx-mt-8"}," Inline style ",-1)),i.createVNode(oT)]),i.createElementVNode("article",oq,[w[20]||(w[20]=i.createElementVNode("p",{class:"pbx-myPrimaryParagraph pbx-italic pbx-pb-2 lg:pbx-mt-6 pbx-mt-8"}," HTML editor ",-1)),i.createVNode(BF)])])])])):i.createCommentVNode("",!0),u.value==="viewHTMLConfig"?(i.openBlock(),i.createElementBlock("div",iq,[i.createElementVNode("p",nq,i.toDisplayString(i.unref(e)("Overview of Selected Element, Component, and Components. This section provides real-time updates based on your HTML selection.")),1),i.createElementVNode("div",aq,[i.createElementVNode("div",lq,[i.createElementVNode("div",null,[i.createElementVNode("h4",sq,i.toDisplayString(i.unref(e)("Types")),1),i.createElementVNode("div",pq,[i.createElementVNode("div",dq,[i.createElementVNode("div",cq,[i.createElementVNode("div",mq,i.toDisplayString(i.unref(e)("Types")),1)])]),i.createElementVNode("div",bq,[i.createElementVNode("p",xq,[i.createElementVNode("span",null,i.toDisplayString(i.unref(e)("Element type:")),1),i.createElementVNode("span",null,i.toDisplayString(typeof n.value),1)]),i.createElementVNode("p",gq,[i.createElementVNode("span",null,i.toDisplayString(i.unref(e)("Component type:")),1),i.createTextVNode(" "+i.toDisplayString(typeof p.value),1)]),i.createElementVNode("p",uq,[i.createElementVNode("span",null,i.toDisplayString(i.unref(e)("Components:")),1),i.createElementVNode("span",null,i.toDisplayString(Array.isArray(d.value)===!0?i.unref(e)("array"):typeof d.value),1)])])])]),i.createElementVNode("div",null,[i.createElementVNode("h4",hq,i.toDisplayString(i.unref(e)("Content")),1),i.createElementVNode("div",fq,[i.createElementVNode("div",yq,[i.createElementVNode("div",wq,[i.createElementVNode("div",{onClick:w[3]||(w[3]=D=>m("element")),class:i.normalizeClass(["pbx-px-4 pbx-py-4 pbx-cursor-pointer",[c.value==="element"?"pbx-text-gray-100":""]])},i.toDisplayString(i.unref(e)("Element")),3),i.createElementVNode("div",{onClick:w[4]||(w[4]=D=>m("component")),class:i.normalizeClass(["pbx-px-4 pbx-py-4 pbx-cursor-pointer",[c.value==="component"?"pbx-text-gray-100":""]])},i.toDisplayString(i.unref(e)("Component")),3),i.createElementVNode("div",{onClick:w[5]||(w[5]=D=>m("components")),class:i.normalizeClass(["pbx-px-4 pbx-py-4 pbx-cursor-pointer",[c.value==="components"?"pbx-text-gray-100":""]])},i.toDisplayString(i.unref(e)("Components added"))+" "+i.toDisplayString(Array.isArray(d.value)&&d.value.length),3)])]),i.createElementVNode("div",vq,[c.value==="element"?(i.openBlock(),i.createElementBlock("div",kq,[p.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Sq,[i.createElementVNode("p",Cq,i.toDisplayString(p.value===null?i.unref(e)("No Element selected"):typeof p.value),1)])),n.value?(i.openBlock(),i.createElementBlock("div",Eq,[i.createElementVNode("div",Tq,[i.createElementVNode("div",Mq,[i.createElementVNode("table",Nq,[i.createElementVNode("thead",Pq,[i.createElementVNode("tr",null,[i.createElementVNode("th",Lq,i.toDisplayString(i.unref(e)("Selected HTML:")),1)])]),i.createElementVNode("tbody",Bq,[i.createElementVNode("tr",null,[i.createElementVNode("td",Aq,i.toDisplayString((y=n.value)==null?void 0:y.outerHTML),1)])])])]),i.createElementVNode("div",Dq,[i.createElementVNode("table",Vq,[i.createElementVNode("thead",zq,[i.createElementVNode("tr",null,[i.createElementVNode("th",Iq,i.toDisplayString(i.unref(e)("Element src:")),1)])]),i.createElementVNode("tbody",Oq,[i.createElementVNode("tr",null,[i.createElementVNode("td",_q,i.toDisplayString((S=n.value)!=null&&S.src?(E=n.value)==null?void 0:E.src:typeof((P=n.value)==null?void 0:P.src)),1)])])])])]),i.createElementVNode("div",Hq,[i.createElementVNode("table",Rq,[i.createElementVNode("thead",jq,[i.createElementVNode("tr",null,[i.createElementVNode("th",Fq,i.toDisplayString(i.unref(e)("Element classes:")),1)])]),i.createElementVNode("tbody",qq,[i.createElementVNode("tr",null,[i.createElementVNode("td",Uq,i.toDisplayString((k=n.value)!=null&&k.classList?(N=n.value)==null?void 0:N.classList:typeof((C=n.value)==null?void 0:C.classList)),1)])])])])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.value==="component"?(i.openBlock(),i.createElementBlock("div",Wq,[p.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Gq,[i.createElementVNode("p",Kq,i.toDisplayString(p.value===null?i.unref(e)("No Component selected"):typeof p.value),1)])),p.value?(i.openBlock(),i.createElementBlock("div",Jq,[i.createElementVNode("div",Yq,[i.createElementVNode("div",Xq,[i.createElementVNode("table",Qq,[i.createElementVNode("thead",Zq,[i.createElementVNode("tr",null,[i.createElementVNode("th",$q,i.toDisplayString(i.unref(e)("ID:")),1)])]),i.createElementVNode("tbody",eU,[i.createElementVNode("tr",null,[i.createElementVNode("td",tU,i.toDisplayString((A=p.value)==null?void 0:A.id),1)])])])]),i.createElementVNode("div",rU,[i.createElementVNode("table",oU,[i.createElementVNode("thead",iU,[i.createElementVNode("tr",null,[i.createElementVNode("th",nU,i.toDisplayString(i.unref(e)("Title:")),1)])]),i.createElementVNode("tbody",aU,[i.createElementVNode("tr",null,[i.createElementVNode("td",lU,i.toDisplayString((T=p.value)==null?void 0:T.title),1)])])])])]),i.createElementVNode("div",sU,[i.createElementVNode("table",pU,[i.createElementVNode("thead",dU,[i.createElementVNode("tr",null,[i.createElementVNode("th",cU,i.toDisplayString(i.unref(e)("HTML Code:")),1)])]),i.createElementVNode("tbody",mU,[i.createElementVNode("tr",null,[i.createElementVNode("td",bU,[i.createElementVNode("pre",xU,[w[21]||(w[21]=i.createTextVNode(" ",-1)),i.createElementVNode("code",{class:"pbx-font-sans pbx-bg-gray-800 pbx-p-4 pbx-rounded-md pbx-block pbx-w-full",innerHTML:b((v=p.value)==null?void 0:v.html_code)},null,8,gU),w[22]||(w[22]=i.createTextVNode(`
|
|
391
391
|
`,-1))])])])])])])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.value==="components"?(i.openBlock(),i.createElementBlock("div",uU,[Array.isArray(d.value)&&d.value.length===0?(i.openBlock(),i.createElementBlock("div",hU,[i.createElementVNode("p",fU,i.toDisplayString(i.unref(e)("No Components added yet")),1)])):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createElementBlock("div",yU,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,D=>(i.openBlock(),i.createElementBlock("div",{key:D.id??D.title,class:"pbx-overflow-hidden pbx-border-solid pbx-border pbx-border-gray-100 pbx-mb-6"},[i.createElementVNode("div",wU,[i.createElementVNode("div",vU,[i.createElementVNode("table",kU,[i.createElementVNode("thead",SU,[i.createElementVNode("tr",null,[i.createElementVNode("th",CU,i.toDisplayString(i.unref(e)("ID:")),1)])]),i.createElementVNode("tbody",EU,[i.createElementVNode("tr",null,[i.createElementVNode("td",TU,i.toDisplayString(D.id),1)])])])]),i.createElementVNode("div",MU,[i.createElementVNode("table",NU,[i.createElementVNode("thead",PU,[i.createElementVNode("tr",null,[i.createElementVNode("th",LU,i.toDisplayString(i.unref(e)("Title:")),1)])]),i.createElementVNode("tbody",BU,[i.createElementVNode("tr",null,[i.createElementVNode("td",AU,i.toDisplayString(D.title),1)])])])])]),i.createElementVNode("div",DU,[i.createElementVNode("table",VU,[i.createElementVNode("thead",zU,[i.createElementVNode("tr",null,[i.createElementVNode("th",IU,i.toDisplayString(i.unref(e)("HTML Code:")),1)])]),i.createElementVNode("tbody",OU,[i.createElementVNode("tr",null,[i.createElementVNode("td",_U,[i.createElementVNode("pre",HU,[w[23]||(w[23]=i.createTextVNode(" ",-1)),i.createElementVNode("code",{class:"pbx-font-sans pbx-w-full",innerHTML:b(D.html_code)},null,8,RU),w[24]||(w[24]=i.createTextVNode(`
|
|
392
|
-
`,-1))])])])])])])]))),128))])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])])])])])):i.createCommentVNode("",!0)]))])])}}}),jU={class:"pbx-flex pbx-h-full pbx-flex-col"},FU={class:"pbx-flex pbx-flex-row pbx-justify-between pbx-pt-7 pbx-pr-4 pbx-pl-4 pbx-items-center pbx-mb-3"},qU={class:"pbx-font-medium pbx-text-sm"},UU={class:"pbx-lowercase"},WU={class:"pbx-mb-1"},GU={class:"pbx-my-1"},KU={class:"pbx-my-1"},JU={class:"pbx-my-1"},YU={class:"pbx-my-1"},XU={class:"pbx-my-1"},QU={class:"pbx-my-1"},ZU={class:"pbx-my-1"},$U={class:"pbx-font-medium pbx-my-0 pbx-py-0"},eW=i.defineComponent({__name:"RightSidebarEditor",emits:["closeEditor"],setup(r){const{translate:e}=re(),t=ce(),o=oe,n=i.computed(()=>o.getElement),a=i.computed(()=>{var x;return(x=n.value)==null?void 0:x.tagName}),l=i.ref(null);let s=0;i.watch(()=>o.getElement,()=>{i.nextTick(()=>{l.value&&(l.value.scrollTop=s)})});function p(){l.value&&(s=l.value.scrollTop)}const d=i.ref(!1),c=i.ref(!1),m=async function(){d.value=!0,c.value=!0,await se(200),o.setToggleGlobalHtmlMode(!0),await t.globalPageStyles(),c.value=!1},b=async function(){c.value=!0,await se(200),await t.handleManualSave(),t.stopGlobalStylesSync();const x=document.querySelector("[data-pagebuilder-content]");x&&x.removeAttribute("data-global-selected"),d.value=!1,c.value=!1};return(x,g)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",jU,[i.createElementVNode("div",FU,[i.createElementVNode("button",{type:"button",onClick:g[0]||(g[0]=u=>x.$emit("closeEditor")),class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},[...g[1]||(g[1]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," close ",-1)])]),i.createElementVNode("p",qU,[i.createTextVNode(i.toDisplayString(i.unref(e)("Editing"))+" ",1),i.createElementVNode("span",UU,"<"+i.toDisplayString(a.value)+">",1)])]),i.createElementVNode("div",{ref_key:"scrollContainer",ref:l,onScroll:p,class:"pbx-pl-3 pbx-pr-3 pbx-mb-4 pbx-overflow-y-scroll"},[i.withDirectives(i.createElementVNode("div",null,[i.createElementVNode("article",WU,[i.createVNode(tR)]),i.createElementVNode("article",GU,[i.createVNode(kR)]),i.createElementVNode("article",KU,[i.createVNode(iT)]),i.createElementVNode("article",JU,[i.createVNode(nT)]),i.createElementVNode("article",YU,[i.createVNode(aT)]),i.createElementVNode("article",XU,[i.createVNode(lT)]),i.createElementVNode("article",QU,[i.createVNode(rT)]),i.createElementVNode("article",ZU,[i.createVNode(oT)]),g[2]||(g[2]=i.createElementVNode("div",{class:"pbx-w-full pbx-border-t pbx-border-solid pbx-border-gray-200 pbx-my-6"},null,-1))],512),[[i.vShow,n.value&&i.unref(t).isEditableElement(n.value)]]),i.createElementVNode("button",{onClick:m,type:"button",class:"pbx-my-1 pbx-border pbx-border-gray-900 pbx-flex pbx-flex-row pbx-justify-between pbx-items-center pbx-pl-3 pbx-pr-3 pbx-py-5 pbx-cursor-pointer pbx-duration-200 pbx-bg-black pbx-text-white hover:pbx-bg-myPrimaryLightGrayColor hover:pbx-text-black pbx-select-none pbx-w-full"},[i.createElementVNode("p",$U,i.toDisplayString(i.unref(e)("Global Page Styles")),1)])],544)]),i.createVNode($e,{maxWidth:"5xl",showModalBuilder:d.value,title:i.unref(e)("Selected HTML"),onCloseMainModalBuilder:b,minHeight:"",maxHeight:""},{default:i.withCtx(()=>[i.createVNode(pT,{isLoading:c.value},null,8,["isLoading"])]),_:1},8,["showModalBuilder","title"])],64))}}),tW={class:"pbx-flex pbx-items-center pbx-justify-center pbx-ml-2"},rW={class:"pbx-mr-2"},oW={key:0,class:"pbx-flex pbx-items-center pbx-myPrimaryTag pbx-whitespace-nowrap pbx-py-0 pbx-gap-2"},iW={class:"pbx-text-white pbx-rounded-full pbx-bg-myPrimaryBrandColor pbx-flex pbx-justify-center pbx-items-center pbx-text-xs pbx-d pbx-min-d pbx-max-d lg:pbx-w-8 lg:pbx-h-8 lg:pbx-min-w-8 lg:pbx-max-w-8 pbx-w-8 pbx-h-8 pbx-min-w-8 pbx-max-w-8 pbx-font-normal"},nW={key:1,class:"pbx-flex pbx-items-center lg:pbx-myPrimaryTag pbx-whitespace-nowrap pbx-py-0 pbx-gap-4 pbx-w-max pbx-h-12 pbx-ml-2"},aW={class:"pbx-text-white pbx-flex-shrink-0 pbx-d pbx-w-10 pbx-h-10 pbx-rounded-full pbx-flex pbx-justify-center pbx-items-center pbx-text-xs pbx-rounded-l-full"},lW=["src"],sW=i.defineComponent({__name:"ToolbarOption",setup(r){const e=oe,t=i.computed(()=>e.getPageBuilderConfig);return(o,n)=>{var a;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",tW,[i.createElementVNode("div",rW,[t.value&&t.value.userForPageBuilder&&t.value.userForPageBuilder.name&&(!t.value.userForPageBuilder.image||typeof t.value.userForPageBuilder.image=="string"&&((a=t.value.userForPageBuilder.image)==null?void 0:a.length)<2)?(i.openBlock(),i.createElementBlock("div",oW,[i.createElementVNode("div",iW,i.toDisplayString(typeof t.value.userForPageBuilder.name=="string"&&t.value.userForPageBuilder.name[0]),1)])):i.createCommentVNode("",!0),t.value&&t.value.userForPageBuilder&&t.value.userForPageBuilder.name&&t.value.userForPageBuilder.image&&typeof t.value.userForPageBuilder.image=="string"&&t.value.userForPageBuilder.image.length>2?(i.openBlock(),i.createElementBlock("div",nW,[i.createElementVNode("div",aW,[i.createElementVNode("img",{alt:"Avatar",src:`${t.value.userForPageBuilder.image}`,class:"pbx-block pbx-inset-0 pbx-object-top pbx-d pbx-min-d pbx-max-d lg:pbx-w-8 lg:pbx-h-8 lg:pbx-min-w-8 lg:pbx-max-w-8 pbx-w-8 pbx-h-8 pbx-min-w-8 pbx-max-w-8 pbx-object-cover pbx-rounded-full"},null,8,lW)])])):i.createCommentVNode("",!0)])])])}}});let kp=null;function pW(){return(r,e=300)=>{kp&&clearTimeout(kp),kp=setTimeout(r,e)}}const dW={};function cW(r,e){return i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[e[0]||(e[0]=i.createElementVNode("div",{class:"pbx-bg-white pbx-flex pbx-justify-center pbx-items-center min-pbx-h-screen pbx-h-screen pbx-w-screen pbx-fixed pbx-inset-0 pbx-z-[10000]"},[i.createElementVNode("div",{class:"pbx-absolute pbx-top-1/3"},[i.createElementVNode("div",{class:"pbx-flex pbx-items-center pbx-justify-center pbx-mt-4"},[i.createElementVNode("div",{class:"pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"},[i.createElementVNode("span",{class:"!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"},"Loading...")])])])],-1))])}const dT=Oa(dW,[["render",cW]]),mW={class:"pbx-text-sm pbx-font-semibold pbx-text-myPrimaryDarkGrayColor pbx-mb-2"},bW={class:"pbx-flex pbx-gap-2"},xW={class:"pbx-text-xs pbx-text-gray-500 pbx-mt-2 pbx-mb-0"},gW={class:"pbx-text-sm pbx-font-semibold pbx-text-myPrimaryDarkGrayColor pbx-mb-2"},uW={class:"pbx-flex pbx-items-center pbx-justify-center"},hW={class:"pbx-inline-grid pbx-gap-1 pbx-py-8 pbx-px-2 pbx-rounded-xl pbx-border pbx-border-solid pbx-border-gray-200 pbx-bg-gray-50 pbx-w-full pbx-justify-center",style:{"grid-template-columns":"repeat(3, 2.5rem)"}},fW=["title","onClick"],yW={class:"pbx-text-sm pbx-font-semibold pbx-text-myPrimaryDarkGrayColor pbx-mb-2"},wW={class:"pbx-grid pbx-grid-cols-2 pbx-gap-2"},vW=["onClick"],kW={for:"image-alt-text",class:"pbx-text-sm pbx-font-semibold pbx-text-myPrimaryDarkGrayColor pbx-mb-2 pbx-block"},SW={class:"pbx-flex pbx-justify-between pbx-items-center pbx-gap-4 pbx-border pbx-border-gray-200 pbx-py-4 pbx-px-3 pbx-rounded-lg"},CW=["placeholder","onKeydown"],EW=["disabled","title"],TW={key:0,class:"material-symbols-outlined pbx-text-xl"},MW={key:1,class:"material-symbols-outlined pbx-animate-spin"},NW={class:"pbx-text-xs pbx-text-gray-500 pbx-mt-2 pbx-mb-0"},PW=i.defineComponent({__name:"ImageSettingsModal",props:{show:{type:Boolean}},setup(r){const e=r,{translate:t}=re(),o=ce(),n=oe,a=i.ref(0),l=i.ref(""),s=i.ref(""),p=i.ref(!1),d=[["pbx-object-top-left","pbx-object-top","pbx-object-top-right"],["pbx-object-left","pbx-object-center","pbx-object-right"],["pbx-object-bottom-left","pbx-object-bottom","pbx-object-bottom-right"]],c=i.computed(()=>{a.value;const E=n.getImageObjectFit;return!E||E==="none"?null:E}),m=i.computed(()=>{a.value;const E=n.getImageObjectPosition;return!E||E==="none"?"pbx-object-center":E}),b=i.computed(()=>{a.value;const E=n.getImageAspectRatio;return!E||E==="none"?"none":E}),x=i.computed(()=>l.value.trim()!==s.value.trim());function g(){const E=o.getSelectedImageAltText();l.value=E,s.value=E}i.watch(()=>e.show,async E=>{E&&(g(),await o.initializeElementStyles(),g(),a.value++)},{immediate:!0});async function u(){a.value++,await o.handleAutoSave()}async function h(E){o.handleImageObjectFit(E),await u()}async function f(E){o.handleImageObjectPosition(E),await u()}async function w(E){o.handleImageAspectRatio(E),await u()}async function y(){if(!(!x.value||p.value)){p.value=!0,await se(400);try{await o.handleImageAltText(l.value),s.value=l.value.trim(),a.value++}finally{p.value=!1}}}const S=[{id:"none",labelKey:"Auto"},{id:"pbx-aspect-square",labelKey:"Square"},{id:"pbx-aspect-video",labelKey:"Landscape 16:9"},{id:"pbx-aspect-[9/16]",labelKey:"Portrait 9:16"}];return(E,P)=>(i.openBlock(),i.createElementBlock("div",{class:"pbx-flex pbx-flex-col pbx-gap-4 pbx-pt-1 pbx-pb-2",onMousedown:P[3]||(P[3]=i.withModifiers(()=>{},["stop"])),onClick:P[4]||(P[4]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",null,[i.createElementVNode("p",mW,i.toDisplayString(i.unref(t)("Image fit")),1),i.createElementVNode("div",bW,[i.createElementVNode("button",{type:"button",class:i.normalizeClass(["pbx-flex-1 pbx-rounded-xl pbx-border pbx-border-solid pbx-px-4 pbx-py-3 pbx-text-sm pbx-font-medium pbx-cursor-pointer pbx-transition-colors",c.value==="pbx-object-cover"?"pbx-border-myPrimaryLinkColor pbx-bg-green-50 pbx-text-myPrimaryLinkColor":"pbx-border-gray-200 pbx-bg-white pbx-text-gray-700 hover:pbx-border-gray-300"]),onClick:P[0]||(P[0]=k=>h("pbx-object-cover"))},i.toDisplayString(i.unref(t)("Cover")),3),i.createElementVNode("button",{type:"button",class:i.normalizeClass(["pbx-flex-1 pbx-rounded-xl pbx-border pbx-border-solid pbx-px-4 pbx-py-3 pbx-text-sm pbx-font-medium pbx-cursor-pointer pbx-transition-colors",c.value==="pbx-object-contain"?"pbx-border-myPrimaryLinkColor pbx-bg-green-50 pbx-text-myPrimaryLinkColor":"pbx-border-gray-200 pbx-bg-white pbx-text-gray-700 hover:pbx-border-gray-300"]),onClick:P[1]||(P[1]=k=>h("pbx-object-contain"))},i.toDisplayString(i.unref(t)("Contain")),3)]),i.createElementVNode("p",xW,i.toDisplayString(i.unref(t)("Cover fills the frame and may crop. Contain shows the full image.")),1)]),i.createElementVNode("div",null,[i.createElementVNode("p",gW,i.toDisplayString(i.unref(t)("Crop focus")),1),i.createElementVNode("div",uW,[i.createElementVNode("div",hW,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.flat(),k=>(i.openBlock(),i.createElementBlock("button",{key:k,type:"button",class:i.normalizeClass(["pbx-w-10 pbx-h-10 pbx-rounded-lg pbx-border pbx-border-solid pbx-flex pbx-items-center pbx-justify-center pbx-cursor-pointer pbx-text-xs pbx-transition-colors",m.value===k?"pbx-border-myPrimaryLinkColor pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-border-gray-200 pbx-bg-white pbx-text-gray-500 hover:pbx-border-gray-300"]),title:k.replace("pbx-object-",""),onClick:N=>f(k)},[...P[5]||(P[5]=[i.createElementVNode("span",{class:"material-symbols-outlined pbx-text-base"},"crop_free",-1)])],10,fW))),128))])])]),i.createElementVNode("div",null,[i.createElementVNode("p",yW,i.toDisplayString(i.unref(t)("Shape")),1),i.createElementVNode("div",wW,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(S,k=>i.createElementVNode("button",{key:k.id,type:"button",class:i.normalizeClass(["pbx-rounded-xl pbx-border pbx-border-solid pbx-px-3 pbx-py-2.5 pbx-text-sm pbx-font-medium pbx-cursor-pointer pbx-transition-colors",b.value===k.id?"pbx-border-myPrimaryLinkColor pbx-bg-green-50 pbx-text-myPrimaryLinkColor":"pbx-border-gray-200 pbx-bg-white pbx-text-gray-700 hover:pbx-border-gray-300"]),onClick:N=>w(k.id)},i.toDisplayString(i.unref(t)(k.labelKey)),11,vW)),64))])]),i.createElementVNode("div",null,[i.createElementVNode("label",kW,i.toDisplayString(i.unref(t)("Alt text")),1),i.createElementVNode("div",SW,[i.withDirectives(i.createElementVNode("input",{id:"image-alt-text","onUpdate:modelValue":P[2]||(P[2]=k=>l.value=k),type:"text",class:"pbx-myPrimaryInput pbx-flex-1 pbx-min-w-0",placeholder:i.unref(t)("Describe this image for accessibility"),onKeydown:i.withKeys(i.withModifiers(y,["prevent"]),["enter"])},null,40,CW),[[i.vModelText,l.value]]),i.createElementVNode("button",{type:"button",class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-shrink-0 pbx-rounded-xl pbx-border pbx-border-solid pbx-flex pbx-items-center pbx-justify-center pbx-cursor-pointer pbx-transition-colors",x.value?"pbx-border-myPrimaryLinkColor pbx-bg-myPrimaryLinkColor pbx-text-white hover:pbx-opacity-90":"pbx-border-gray-200 pbx-bg-gray-100 pbx-text-gray-400 pbx-cursor-not-allowed"]),disabled:!x.value||p.value,title:i.unref(t)("Save"),onClick:y},[p.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",TW,"check")),p.value?(i.openBlock(),i.createElementBlock("span",MW,"refresh")):i.createCommentVNode("",!0)],10,EW)]),i.createElementVNode("p",NW,i.toDisplayString(i.unref(t)("Helps screen readers and SEO understand the image content.")),1)])],32))}}),LW={class:"pbx-text-xs pbx-text-gray-600 pbx-mx-2 pbx-py-3 pbx-px-2 pbx-border-solid pbx-border pbx-border-gray-200 pbx-rounded-full"},BW=i.defineComponent({__name:"UndoRedo",emits:["toolbar-hide-request"],setup(r,{emit:e}){const t=ce(),o=e,n=oe,a=i.computed(()=>n.getIsLoadingGlobal),l=i.computed(()=>n.getHistoryIndex),s=i.computed(()=>n.getHistoryLength),p=i.computed(()=>l.value>0),d=i.computed(()=>l.value<s.value-1),c=async function(){p.value&&(o("toolbar-hide-request"),await t.undo(),await t.clearHtmlSelection())},m=async function(){d.value&&(o("toolbar-hide-request"),await t.redo(),await t.clearHtmlSelection())};return(b,x)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[a.value?(i.openBlock(),i.createBlock(dT,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("div",{onClick:x[0]||(x[0]=async()=>{await i.unref(t).clearHtmlSelection()}),class:"pbx-flex-1 pbx-flex pbx-justify-center pbx-items-center pbx-py-2 pbx-w-full gap-1"},[i.createElementVNode("div",{onClick:c,type:"button",class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square pbx-text-black hover:pbx-text-white",[p.value?"pbx-cursor-pointer hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0":"pbx-cursor-not-allowed pbx-bg-opacity-20 hover:pbx-bg-gray-200"]])},[...x[1]||(x[1]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," undo ",-1)])],2),i.createElementVNode("div",LW,i.toDisplayString(l.value+1)+"/"+i.toDisplayString(s.value),1),i.createElementVNode("div",{onClick:m,class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square pbx-text-black hover:pbx-text-white",[d.value?"pbx-cursor-pointer hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0":"pbx-cursor-not-allowed pbx-bg-opacity-20 hover:pbx-bg-gray-200"]])},[...x[2]||(x[2]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," redo ",-1)])],2)])],64))}}),AW=["width","height"],DW=i.defineComponent({__name:"LayersIcon",props:{size:{default:24}},setup(r){return(e,t)=>(i.openBlock(),i.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:r.size,height:r.size,viewBox:"0 0 24 24","aria-hidden":"true"},[...t[0]||(t[0]=[i.createStaticVNode('<title>layers</title><g fill="none"><path d="M9.12015 8.16C10.1529 7.38542 10.6693 6.99813 11.2364 6.84884C11.737 6.71706 12.2632 6.71705 12.7638 6.84883C13.331 6.99812 13.8474 7.38541 14.8801 8.15999L20.5868 12.44C21.7448 13.3085 22.3238 13.7427 22.5308 14.275C22.7122 14.7413 22.7122 15.2586 22.5308 15.7249C22.3238 16.2573 21.7448 16.6915 20.5868 17.56L14.8801 21.84C13.8474 22.6146 13.331 23.0019 12.7638 23.1512C12.2632 23.2829 11.737 23.2829 11.2364 23.1512C10.6693 23.0019 10.1529 22.6146 9.12014 21.84L3.41349 17.56C2.25552 16.6915 1.67654 16.2573 1.4695 15.7249C1.28816 15.2586 1.28816 14.7413 1.46951 14.275C1.67655 13.7427 2.25553 13.3085 3.41349 12.44L9.12015 8.16Z" fill="url(#layers-icon-gradient-0)" data-glass="origin" mask="url(#layers-icon-mask)"></path><path d="M9.12015 8.16C10.1529 7.38542 10.6693 6.99813 11.2364 6.84884C11.737 6.71706 12.2632 6.71705 12.7638 6.84883C13.331 6.99812 13.8474 7.38541 14.8801 8.15999L20.5868 12.44C21.7448 13.3085 22.3238 13.7427 22.5308 14.275C22.7122 14.7413 22.7122 15.2586 22.5308 15.7249C22.3238 16.2573 21.7448 16.6915 20.5868 17.56L14.8801 21.84C13.8474 22.6146 13.331 23.0019 12.7638 23.1512C12.2632 23.2829 11.737 23.2829 11.2364 23.1512C10.6693 23.0019 10.1529 22.6146 9.12014 21.84L3.41349 17.56C2.25552 16.6915 1.67654 16.2573 1.4695 15.7249C1.28816 15.2586 1.28816 14.7413 1.46951 14.275C1.67655 13.7427 2.25553 13.3085 3.41349 12.44L9.12015 8.16Z" fill="url(#layers-icon-gradient-0)" data-glass="clone" filter="url(#layers-icon-filter)" clip-path="url(#layers-icon-clip)"></path><path d="M9.12015 2.15999C10.1529 1.38542 10.6693 0.998128 11.2364 0.848835C11.737 0.717055 12.2632 0.717055 12.7638 0.848834C13.331 0.998124 13.8474 1.38541 14.8801 2.15999L20.5868 6.43998C21.7448 7.30845 22.3238 7.74269 22.5308 8.27503C22.7122 8.74132 22.7122 9.25864 22.5308 9.72492C22.3238 10.2573 21.7448 10.6915 20.5868 11.56L14.8801 15.84C13.8474 16.6146 13.331 17.0019 12.7638 17.1512C12.2632 17.2829 11.737 17.2829 11.2364 17.1512C10.6693 17.0019 10.1529 16.6146 9.12014 15.84L3.41349 11.56C2.25552 10.6915 1.67654 10.2573 1.4695 9.72492C1.28816 9.25864 1.28816 8.74132 1.46951 8.27504C1.67655 7.74269 2.25553 7.30846 3.41349 6.43998L9.12015 2.15999Z" fill="url(#layers-icon-gradient-1)" data-glass="blur"></path><path d="M11.237 0.848781C11.7375 0.717108 12.2639 0.717038 12.7644 0.848781C13.3314 0.998119 13.8479 1.38584 14.8806 2.1603L20.5866 6.44056C21.7446 7.30903 22.3239 7.74317 22.5309 8.27552C22.7121 8.74164 22.7121 9.25861 22.5309 9.72473C22.3239 10.2571 21.7446 10.6912 20.5866 11.5597L14.8806 15.8399L14.194 16.3507C13.5865 16.7934 13.1897 17.0395 12.7644 17.1515L12.5749 17.1944C12.1953 17.2685 11.805 17.2685 11.4255 17.1944L11.237 17.1515C10.8117 17.0395 10.4147 16.7933 9.80733 16.3507L9.12081 15.8399L3.4138 11.5597C2.25593 10.6913 1.67649 10.2571 1.46947 9.72473C1.31093 9.31688 1.29097 8.86987 1.4099 8.45227L1.46947 8.27552C1.62471 7.87635 1.98934 7.53197 2.65013 7.01868L3.4138 6.44056L9.12081 2.1603C10.0243 1.48266 10.5323 1.10089 11.0251 0.916164L11.237 0.848781ZM12.5729 1.57436C12.1975 1.47557 11.8029 1.47554 11.4274 1.57436C11.0366 1.67728 10.6561 1.94538 9.57003 2.75991L3.86399 7.04017C3.27389 7.48274 2.87129 7.78513 2.58665 8.04114C2.30554 8.29399 2.20972 8.44147 2.16868 8.547C2.05534 8.83843 2.05534 9.16182 2.16868 9.45325C2.20973 9.55878 2.30557 9.70629 2.58665 9.95911C2.87129 10.2151 3.27391 10.5175 3.86399 10.9601L9.57003 15.2403C10.6561 16.0549 11.0366 16.323 11.4274 16.4259C11.8029 16.5247 12.1975 16.5247 12.5729 16.4259C12.9638 16.323 13.3443 16.0549 14.4304 15.2403L20.1374 10.9601C20.7272 10.5177 21.1292 10.215 21.4137 9.95911C21.6947 9.70637 21.7906 9.55877 21.8317 9.45325C21.945 9.16182 21.945 8.83843 21.8317 8.547C21.7906 8.44148 21.6948 8.2939 21.4137 8.04114C21.1292 7.7852 20.7272 7.48254 20.1374 7.04017L14.4304 2.75991C13.3443 1.94534 12.9638 1.67725 12.5729 1.57436Z" fill="url(#layers-icon-gradient-2)"></path><defs><linearGradient id="layers-icon-gradient-0" x1="12" y1="6.75" x2="12" y2="23.25" gradientUnits="userSpaceOnUse"><stop stop-color="#575757"></stop><stop offset="1" stop-color="#151515"></stop></linearGradient><linearGradient id="layers-icon-gradient-1" x1="12" y1=".75" x2="12" y2="17.25" gradientUnits="userSpaceOnUse"><stop stop-color="#E3E3E5" stop-opacity=".6"></stop><stop offset="1" stop-color="#BBBBC0" stop-opacity=".6"></stop></linearGradient><linearGradient id="layers-icon-gradient-2" x1="12" y1=".75" x2="12" y2="10.305" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"></stop><stop offset="1" stop-color="#fff" stop-opacity="0"></stop></linearGradient><filter id="layers-icon-filter" x="-100%" y="-100%" width="400%" height="400%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse"><feGaussianBlur stdDeviation="2" x="0%" y="0%" width="100%" height="100%" in="SourceGraphic" edgeMode="none" result="blur"></feGaussianBlur></filter><clipPath id="layers-icon-clip"><path d="M9.12015 2.15999C10.1529 1.38542 10.6693 0.998128 11.2364 0.848835C11.737 0.717055 12.2632 0.717055 12.7638 0.848834C13.331 0.998124 13.8474 1.38541 14.8801 2.15999L20.5868 6.43998C21.7448 7.30845 22.3238 7.74269 22.5308 8.27503C22.7122 8.74132 22.7122 9.25864 22.5308 9.72492C22.3238 10.2573 21.7448 10.6915 20.5868 11.56L14.8801 15.84C13.8474 16.6146 13.331 17.0019 12.7638 17.1512C12.2632 17.2829 11.737 17.2829 11.2364 17.1512C10.6693 17.0019 10.1529 16.6146 9.12014 15.84L3.41349 11.56C2.25552 10.6915 1.67654 10.2573 1.4695 9.72492C1.28816 9.25864 1.28816 8.74132 1.46951 8.27504C1.67655 7.74269 2.25553 7.30846 3.41349 6.43998L9.12015 2.15999Z" fill="url(#layers-icon-gradient-1)"></path></clipPath><mask id="layers-icon-mask"><rect width="100%" height="100%" fill="#FFF"></rect><path d="M9.12015 2.15999C10.1529 1.38542 10.6693 0.998128 11.2364 0.848835C11.737 0.717055 12.2632 0.717055 12.7638 0.848834C13.331 0.998124 13.8474 1.38541 14.8801 2.15999L20.5868 6.43998C21.7448 7.30845 22.3238 7.74269 22.5308 8.27503C22.7122 8.74132 22.7122 9.25864 22.5308 9.72492C22.3238 10.2573 21.7448 10.6915 20.5868 11.56L14.8801 15.84C13.8474 16.6146 13.331 17.0019 12.7638 17.1512C12.2632 17.2829 11.737 17.2829 11.2364 17.1512C10.6693 17.0019 10.1529 16.6146 9.12014 15.84L3.41349 11.56C2.25552 10.6915 1.67654 10.2573 1.4695 9.72492C1.28816 9.25864 1.28816 8.74132 1.46951 8.27504C1.67655 7.74269 2.25553 7.30846 3.41349 6.43998L9.12015 2.15999Z" fill="#000"></path></mask></defs></g>',2)])],8,AW))}}),VW={class:"lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-mx-auto pbx-flex pbx-flex-col pbx-font-sans pbx-text-black pbx-border-solid pbx-border pbx-border-gray-400 pbx-inset-x-0 pbx-z-10 pbx-bg-white pbx-overflow-x-auto pbx-h-full"},zW={id:"pagebuilder-navbar",class:"lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[64rem] pbx-max-w-[64rem] pbx-w-[64rem] pbx-flex-1 pbx-bg-myPrimaryLightGrayColor pbx-flex pbx-items-center pbx-justify-between pbx-border-0 pbx-border-solid pbx-border-b pbx-border-gray-200 pbx-mb-2 pbx-font-sans pbx-min-h-20"},IW=["src"],OW={class:"pbx-flex pbx-items-center pbx-justify-center"},_W=["disabled"],HW={key:0,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},RW={key:1,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},jW=["disabled"],FW={key:0,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},qW={key:1,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},UW={class:"lg:pbx-block pbx-hidden"},WW={class:"lg:pbx-hidden pbx-block"},GW={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2 pbx-border-gray-200"},KW={class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},JW={class:"pbx-cursor-pointer lg:pbx-block lg:pbx-pr-4 pbx-hidden"},YW={class:"pbx-flex pbx-items-center pbx-justify-center pbx-mr-2"},XW={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2"},QW={class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},ZW={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},$W={class:"lg:pbx-flex pbx-hidden pbx-items-center pbx-justify-center"},eG={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2"},tG={class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},rG={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},oG={class:"pbx-flex-1 pbx-flex gap-2 pbx-items-center pbx-justify-end"},iG={key:0,class:"pbx-flex-1 pbx-ml-2"},nG={key:0,class:"pbx-flex-1 pbx-flex pbx-justify-end pbx-items-center pbx-ml-2 lg:pbx-mr-4 pbx-mr-2"},aG=["value"],lG=["value"],sG={key:2,class:"pbx-flex-1 pbx-ml-2 pbx-mr-2"},pG={id:"pagebuilder-main",class:"lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[64rem] pbx-max-w-[64rem] pbx-w-[64rem] pbx-flex-1 pbx-relative pbx-h-full pbx-flex pbx-pb-2 pbx-gap-2"},dG={class:"pbx-mx-2 pbx-flex pbx-flex-col pbx-myPrimaryGap pbx-items-stretch"},cG={id:"pbxEditToolbar",class:"pbx-z-30 pbx-flex pbx-gap-2 pbx-justify-center pbx-items-center pbx-rounded-sm pbx-px-2 pbx-h-0 pbx-min-w-52 pbx-relative"},mG={key:0,id:"nolocalstorage"},bG={class:"pbx-flex pbx-justify-center pbx-w-full pbx-absolute pbx-items-center"},xG={class:"pbx-flex pbx-items-center pbx-gap-2"},gG={class:"pbx-font-medium pbx-break-words lg:pbx-text-lg md:pbx-text-lg pbx-text-base pbx-font-sans"},uG={key:1,id:"nolocalstorage"},hG={class:"pbx-flex pbx-justify-end pbx-w-full pbx-h-0 pbx-items-center pbx-rounded-r-full pbx-z-10"},fG={class:"pbx-flex pbx-items-center pbx-gap-1"},yG={class:"lg:pbx-block pbx-hidden"},wG=["innerHTML","onMouseup"],vG={key:1,id:"nolocalstorage"},kG={class:"pbx-flex pbx-justify-end pbx-w-full pbx-h-0 pbx-items-center pbx-rounded-r-full pbx-z-10"},SG=["onClick"],CG={class:"pbx-flex pbx-items-center pbx-gap-1"},EG={class:"lg:pbx-block pbx-hidden"},TG={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},MG={class:"pbx-flex pbx-justify-end pbx-min-h-6"},NG={key:0,class:"pbx-myPrimaryParagraphError"},PG={class:"pbx-border-0 pbx-border-solid pbx-border-t pbx-border-gray-200 pbx-flex pbx-items-center pbx-justify-end"},LG={class:"pbx-py-4 pbx-flex sm:pbx-justify-end pbx-justify-center"},BG={class:"sm:pbx-grid-cols-2 sm:pbx-items-end sm:pbx-justify-end pbx-flex pbx-flex-row pbx-myPrimaryGap pbx-w-full"},AG={key:1,class:"pbx-flex pbx-items-center pbx-my-2 pbx-justify-end"},DG={class:"pbx-flex pbx-justify-end pbx-min-h-6"},VG={key:0,class:"pbx-myPrimaryParagraphError"},zG={class:"pbx-border-0 pbx-border-solid pbx-border-t pbx-border-gray-200 pbx-flex pbx-items-center pbx-justify-end"},IG={class:"pbx-py-4 pbx-flex sm:pbx-justify-end pbx-justify-center"},OG={class:"sm:pbx-grid-cols-2 sm:pbx-items-end sm:pbx-justify-end pbx-flex pbx-flex-row pbx-myPrimaryGap pbx-w-full"},_G={key:1,class:"pbx-flex pbx-items-center pbx-my-2 pbx-justify-end"},HG=i.defineComponent({__name:"PageBuilder",props:{CustomMediaLibraryComponent:{type:Object,default:null},CustomBuilderComponents:{type:Object,default:null},showCloseButton:{type:Boolean,default:!1},showPublishButton:{type:Boolean,default:!1}},emits:["handleClosePageBuilder","handlePublishPageBuilder"],setup(r,{emit:e}){const t=ce(),o=r,{translate:n,loadTranslations:a}=re(),l=cl,s=oe;i.provide("pageBuilderStateStore",s),i.provide("internalPinia",l),i.provide("CustomMediaComponent",o.CustomMediaLibraryComponent),i.provide("CustomBuilderComponents",o.CustomBuilderComponents);const p=e,d=i.ref(1),c=i.ref(""),m=i.ref(!1),b=i.ref(""),x=i.ref(""),g=i.ref(""),u=i.ref(null),h=i.ref(null),f=i.ref(null),w=i.ref(null),y=i.ref(null),S=async function(){c.value="warning",m.value=!0,b.value=n("Continue Your Work?"),x.value=n("Are you sure you want to close the Page Builder? All unsaved changes will be lost."),g.value=null,u.value=n("Close Page Builder"),h.value=null,f.value=async function(){m.value=!1},w.value=function(){E()},y.value=async function(){}},E=function(){m.value=!1,p("handleClosePageBuilder")},P=async function(){s.setIsLoadingGlobal(!0),await t.handleManualSave(),s.setIsLoadingGlobal(!1),p("handlePublishPageBuilder")},k=()=>{tt.value=!1};i.provide("closeAddComponentModal",k);const N=i.ref("en");let C=!0;const A=i.ref(!1);i.watch(N,async R=>{if(R&&!C){A.value=!0,await se(200),await a(R),t.changeLanguage(R);const L=JSON.parse(localStorage.getItem("userSettingsPageBuilder")??"{}")||{};L.lang=R,localStorage.setItem("userSettingsPageBuilder",JSON.stringify(L)),A.value=!1}});const T=i.computed(()=>s.getBuilderStarted),v=i.computed(()=>s.getPageBuilderConfig),D=i.computed(()=>{var L,Bt;const R=(Bt=(L=v.value)==null?void 0:L.userSettings)==null?void 0:Bt.fontFamily;return R?R.startsWith("pbx-font-")?R:`pbx-font-${R}`:"pbx-font-sans"}),B=i.computed(()=>s.getCurrentLanguage);i.watch(B,R=>{R&&R!==N.value&&(N.value=R)});const V=i.computed(()=>s.getMenuRight),Be=i.ref(!1),Mo=i.ref(""),xe=i.ref(""),ve=function(){t.previewCurrentDesign()},No=function(){Mo.value=n("Preview"),ve(),Be.value=!0},gr=i.ref(!1),Po=function(){t.previewCurrentDesign()},Lo=function(){xe.value=n("Mobile"),Po(),gr.value=!0},Kt=i.ref(!1),Bo=function(){Kt.value=!1},Nt=function(){Be.value=!1},Jt=function(){gr.value=!1},tt=i.ref(!1),Oi=i.ref(""),_i=i.ref(""),ur=i.ref(null),Hi=async function(){await t.clearHtmlSelection(),Oi.value=n("Add Components to Page"),_i.value=n("Close"),tt.value=!0,ur.value=function(){tt.value=!1}},Ao=function(R){s.setAddComponentAddIndex(R),s.setComponentArrayAddMethod("insert"),Hi()},Xe=i.computed(()=>s.getElement),Pt=i.computed(()=>s.getComponents),Cp=i.computed(()=>s.getHasLocalDraftForUpdate),hr=i.computed(()=>s.getToggleGlobalHtmlMode);i.watch(Cp,R=>{R&&ji()});const Ep=i.computed(()=>!Xe.value||!(Xe.value instanceof HTMLElement)?null:{src:Xe.value.getAttribute("src"),href:Xe.value.getAttribute("href"),style:Xe.value.getAttribute("style"),class:Xe.value.getAttribute("class"),dataImage:Xe.value.getAttribute("data-image")}),Jr=pW();i.watch(Ep,async(R,L)=>{((R==null?void 0:R.src)!==(L==null?void 0:L.src)||(R==null?void 0:R.href)!==(L==null?void 0:L.href)||(R==null?void 0:R.style)!==(L==null?void 0:L.style)||(R==null?void 0:R.class)!==(L==null?void 0:L.class)||(R==null?void 0:R.dataImage)!==(L==null?void 0:L.dataImage))&&Jr(async()=>{await t.initializeElementStyles()},200)});const Yt=function(R){s.setComponent(R)},Do=i.computed(()=>s.getIsLoadingGlobal),Ri=i.computed(()=>s.getIsSaving),Tp=i.computed(()=>s.getIsLoadingResumeEditing),bt=i.computed(()=>s.getIsRestoring),Mp=i.ref(1),Wa=i.ref(""),xt=i.ref(!1),Vo=i.ref(""),zo=i.ref(""),Yr=i.ref(""),Xr=i.ref(null),Io=i.ref(null),fr=i.ref(null),yr=i.ref(null),Lt=i.ref(null),ji=async function(){Wa.value="warning",xt.value=!0,Vo.value=n("Continue Your Work?"),zo.value=n("We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?"),Yr.value=n("Use Saved Version"),Xr.value=null,Io.value=n("Continue Where I Left Off"),fr.value=async function(){s.setHasLocalDraftForUpdate(!1),xt.value=!1},yr.value=function(){},Lt.value=async function(){await t.resumeEditingFromDraft(),s.setHasLocalDraftForUpdate(!1),xt.value=!1}},Qr=i.ref(1),Ga=i.ref(""),Oo=i.ref(!1),Ka=i.ref(""),_o=i.ref(""),_=i.ref(""),M=i.ref(null),O=i.ref(null),K=i.ref(null),ee=i.ref(null),ie=i.ref(null),Qe=async function(){await t.clearHtmlSelection(),Ga.value="success",Oo.value=!0,Ka.value=n("Do you want to reset this page?"),_o.value=n("Are you sure you want to reset this page? This will overwrite your current changes."),_.value=n("Close"),M.value=null,O.value=n("Reset changes"),K.value=function(){Oo.value=!1},ee.value=async function(){},ie.value=async function(){await t.restoreOriginalContent(),Oo.value=!1}},Ze=i.computed(()=>s.getShowModalHTMLEditor),Ue=i.computed(()=>!Xe.value||!(Xe.value instanceof HTMLElement)?"":Xe.value.outerHTML),yt=i.ref(""),wt=i.ref("");i.watch(Ze,async R=>{if(R){if(!hr.value){yt.value=Ue.value;return}wt.value=await t.generateHtmlFromComponents()}});const ge=()=>{s.setShowModalHTMLEditor(!1)},$=i.ref(!1),q=i.ref(null),Xt=i.ref(!1),rt=i.ref(!1),ot=i.ref(!1),Qt=async()=>{Xt.value=!0,rt.value=!0,Lp(),await se(200),s.setToggleGlobalHtmlMode(!0),await t.globalPageStyles(),Lp(),rt.value=!1},Zr=async()=>{rt.value=!0,await se(200),await t.handleManualSave(),t.stopGlobalStylesSync();const R=document.querySelector("[data-pagebuilder-content]");R&&R.removeAttribute("data-global-selected"),Xt.value=!1,rt.value=!1},Fi=()=>{if(ot.value){xT();return}t.setImageSettingsModalOpen(!0),ot.value=!0},xT=()=>{ot.value=!1,t.setImageSettingsModalOpen(!1)},WG=async()=>{q.value=null,$.value=!0,await se(300);const R=await t.applyModifiedHTML(yt.value);if(R){q.value=R,$.value=!1;return}s.setShowModalHTMLEditor(!1),$.value=!1},GG=async()=>{q.value=null,$.value=!0,q.value=null,await se(300);const R=await t.applyModifiedComponents(wt.value);if(R){q.value=R,$.value=!1;return}s.setShowModalHTMLEditor(!1),$.value=!1},Np=function(){T.value||(Kt.value=!0)},Pp=i.ref(null),Lp=function(){const R=document.querySelector("#pbxEditToolbar");R&&(R.classList.remove("is-visible"),R.removeAttribute("style"))};function Ja(){const R=Pp.value,L=R&&R.querySelector("#pbxEditToolbar");if(!R||!L)return;const Bt=R.querySelector("[selected]");if(Bt&&typeof Bt.getBoundingClientRect=="function"){const wr=(Bt.closest("[data-pb-no-select]")||Bt).getBoundingClientRect(),Ui=R.getBoundingClientRect();let Ho=wr.left-Ui.left+wr.width/2-L.offsetWidth/2;const gT=20;Ho=Math.max(gT,Math.min(Ho,R.offsetWidth-L.offsetWidth-gT));const KG=wr.top-Ui.top+R.scrollTop-L.offsetHeight-20,JG=Math.max(0,KG);L.style.position="absolute",L.style.left=`${Ho}px`,L.style.top=`${JG}px`,L.classList.add("is-visible")}else L.classList.remove("is-visible"),L.removeAttribute("style")}const Bp=JSON.parse(localStorage.getItem("userSettingsPageBuilder")??"null");return i.onMounted(async()=>{await t.completeBuilderInitialization(void 0),Bp&&Bp.lang&&(N.value=Bp.lang),await a(N.value),C=!1,Ja();const R=Pp.value;if(!R)return;new MutationObserver(Ja).observe(R,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["selected"]}),window.addEventListener("scroll",Ja),window.addEventListener("resize",Ja),await se(1e4),Np(),await se(1e4),Np(),await se(1e4),Np()}),(R,L)=>{var Bt;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",VW,[Do.value&&!Kt.value||A.value?(i.openBlock(),i.createBlock(dT,{key:0})):i.createCommentVNode("",!0),i.createVNode($e,{title:"The builder hasn’t started yet",showModalBuilder:Kt.value,onCloseMainModalBuilder:Bo,type:"delete",maxWidth:"2xl",noBackgroundOpacity:!0},{default:i.withCtx(()=>[...L[33]||(L[33]=[i.createTextVNode(" The builder hasn’t started yet. If this screen doesn’t go away soon, it may just need a little setup in the background. You can safely contact support and ask them to initialize the builder by running the startBuilder method for this resource. ",-1)])]),_:1},8,["showModalBuilder"]),tt.value?(i.openBlock(),i.createBlock(NH,{key:1,show:tt.value,firstButtonText:_i.value,title:Oi.value,CustomBuilderComponents:o.CustomBuilderComponents,onFirstModalButtonSearchComponentsFunction:L[0]||(L[0]=()=>{var U;return(U=ur.value)==null?void 0:U.call(ur)})},null,8,["show","firstButtonText","title","CustomBuilderComponents"])):i.createCommentVNode("",!0),i.createVNode(gt,{showDynamicModalBuilder:m.value,isLoading:!1,type:c.value,gridColumnAmount:d.value,title:b.value,description:x.value,firstButtonText:g.value??void 0,secondButtonText:u.value??void 0,thirdButtonText:h.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:L[1]||(L[1]=()=>{var U;return(U=f.value)==null?void 0:U.call(f)}),onSecondModalButtonFunctionDynamicModalBuilder:L[2]||(L[2]=()=>{var U;return(U=w.value)==null?void 0:U.call(w)}),onThirdModalButtonFunctionDynamicModalBuilder:L[3]||(L[3]=()=>{var U;return(U=y.value)==null?void 0:U.call(y)})},{default:i.withCtx(()=>[...L[34]||(L[34]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode($e,{title:Mo.value,showModalBuilder:Be.value,onCloseMainModalBuilder:Nt,maxWidth:"screen"},{default:i.withCtx(()=>[i.createVNode(tl)]),_:1},8,["title","showModalBuilder"]),i.createVNode($e,{title:xe.value,showModalBuilder:gr.value,onCloseMainModalBuilder:Jt,maxWidth:"lg"},{default:i.withCtx(()=>[i.createVNode(tl,{mobile:!0})]),_:1},8,["title","showModalBuilder"]),i.createVNode(gt,{showDynamicModalBuilder:xt.value,isLoading:Tp.value,type:Wa.value,gridColumnAmount:Mp.value,title:Vo.value,description:zo.value,firstButtonText:Yr.value,secondButtonText:Xr.value??void 0,thirdButtonText:Io.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:L[4]||(L[4]=()=>{var U;return(U=fr.value)==null?void 0:U.call(fr)}),onSecondModalButtonFunctionDynamicModalBuilder:L[5]||(L[5]=()=>{var U;return(U=yr.value)==null?void 0:U.call(yr)}),onThirdModalButtonFunctionDynamicModalBuilder:L[6]||(L[6]=()=>{var U;return(U=Lt.value)==null?void 0:U.call(Lt)})},{default:i.withCtx(()=>[...L[35]||(L[35]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","isLoading","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode(gt,{showDynamicModalBuilder:Oo.value,isLoading:bt.value,type:Ga.value,gridColumnAmount:Qr.value,title:Ka.value,description:_o.value,firstButtonText:_.value,secondButtonText:M.value??void 0,thirdButtonText:O.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:L[7]||(L[7]=()=>{var U;return(U=K.value)==null?void 0:U.call(K)}),onSecondModalButtonFunctionDynamicModalBuilder:L[8]||(L[8]=()=>{var U;return(U=ee.value)==null?void 0:U.call(ee)}),onThirdModalButtonFunctionDynamicModalBuilder:L[9]||(L[9]=()=>{var U;return(U=ie.value)==null?void 0:U.call(ie)})},{default:i.withCtx(()=>[...L[36]||(L[36]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","isLoading","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createElementVNode("div",zW,[v.value&&v.value.pageBuilderLogo&&v.value.pageBuilderLogo.src?(i.openBlock(),i.createElementBlock("div",{key:0,onClick:L[10]||(L[10]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-flex pbx-justify-start pbx-py-2 lg:pbx-ml-4 pbx-ml-2"},[i.createElementVNode("img",{class:"pbx-h-6",src:v.value.pageBuilderLogo.src,alt:"Logo"},null,8,IW)])):i.createCommentVNode("",!0),i.createVNode(BW,{onToolbarHideRequest:Lp}),i.createElementVNode("div",{onClick:L[13]||(L[13]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-flex-1 pbx-flex pbx-justify-center pbx-items-center pbx-py-2 pbx-w-full"},[i.createElementVNode("div",OW,[i.createElementVNode("button",{class:"pbx-mySecondaryButton pbx-h-6 pbx-flex pbx-gap-2 pbx-mr-2",onClick:L[11]||(L[11]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection(),await i.unref(t).handleManualSave()},["stop"])),type:"button",disabled:Ri.value},[Ri.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",HW,[...L[37]||(L[37]=[i.createElementVNode("span",{class:"material-symbols-outlined"},"save",-1)])])),Ri.value?(i.openBlock(),i.createElementBlock("div",RW,[...L[38]||(L[38]=[i.createElementVNode("span",{class:"pbx-relative pbx-flex pbx-size-3"},[i.createElementVNode("span",{class:"pbx-absolute pbx-inline-flex pbx-h-full pbx-w-full pbx-animate-ping pbx-rounded-full pbx-bg-gray-400 pbx-opacity-75"}),i.createElementVNode("span",{class:"pbx-relative pbx-inline-flex pbx-size-3 pbx-rounded-full pbx-bg-green-200"})],-1)])])):i.createCommentVNode("",!0),i.createElementVNode("div",null,i.toDisplayString(i.unref(n)("Save")),1)],8,_W),v.value&&v.value.updateOrCreate&&v.value.updateOrCreate.formType==="update"?(i.openBlock(),i.createElementBlock("button",{key:0,class:"pbx-mySecondaryButton pbx-h-6 pbx-flex pbx-gap-2 lg:pbx-mr-2 pbx-mr-2",onClick:L[12]||(L[12]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection(),await Qe()},["stop"])),type:"button",disabled:bt.value},[bt.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",FW,[...L[39]||(L[39]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," settings_backup_restore ",-1)])])),bt.value?(i.openBlock(),i.createElementBlock("div",qW,[...L[40]||(L[40]=[i.createElementVNode("span",{class:"pbx-relative pbx-flex pbx-size-3"},[i.createElementVNode("span",{class:"pbx-absolute pbx-inline-flex pbx-h-full pbx-w-full pbx-animate-ping pbx-rounded-full pbx-bg-gray-400 pbx-opacity-75"}),i.createElementVNode("span",{class:"pbx-relative pbx-inline-flex pbx-size-3 pbx-rounded-full pbx-bg-green-200"})],-1)])])):i.createCommentVNode("",!0),i.createElementVNode("div",UW,[i.createElementVNode("span",null,i.toDisplayString(i.unref(n)("Reset Page")),1)]),i.createElementVNode("div",WW,[i.createElementVNode("span",null,i.toDisplayString(i.unref(n)("Reset")),1)])],8,jW)):i.createCommentVNode("",!0)])]),i.createElementVNode("div",{onClick:L[18]||(L[18]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-flex-1 pbx-flex pbx-justify-center pbx-items-center pbx-py-2 pbx-w-full"},[i.createElementVNode("div",{onClick:L[17]||(L[17]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-flex pbx-items-center pbx-justify-center"},[i.createElementVNode("div",{class:"pbx-mr-2",onClick:L[14]||(L[14]=()=>{i.unref(s).setComponentArrayAddMethod("unshift"),Hi()})},[i.createElementVNode("div",GW,[i.createElementVNode("span",KW,[i.createVNode(DW)]),i.createElementVNode("span",JW,i.toDisplayString(i.unref(n)("Add")),1)])]),i.createElementVNode("div",YW,[i.createElementVNode("div",{onClick:L[15]||(L[15]=async()=>{i.unref(s).setMenuRight(!1),i.unref(s).setElement(null),await i.unref(t).clearHtmlSelection(),No()})},[i.createElementVNode("div",XW,[i.createElementVNode("span",QW,[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",ZW,[...L[41]||(L[41]=[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M2 3h18v13h-8v2h3v2H7v-2h3v-2H2V3zm2 2v9h14V5H4z","fill-rule":"evenodd"},null,-1)])]))])])])])]),i.createElementVNode("div",$W,[i.createElementVNode("div",{onClick:L[16]||(L[16]=async()=>{i.unref(s).setMenuRight(!1),i.unref(s).setElement(null),await i.unref(t).clearHtmlSelection(),Lo()})},[i.createElementVNode("div",eG,[i.createElementVNode("span",tG,[(i.openBlock(),i.createElementBlock("svg",rG,[...L[42]||(L[42]=[i.createElementVNode("path",{d:"M14 16H8v2h6v-2z"},null,-1),i.createElementVNode("path",{d:"M14 1H8a3 3 0 00-3 3v14a3 3 0 003 3h6a3 3 0 003-3V4a3 3 0 00-3-3zM7 4a1 1 0 011-1h6a1 1 0 011 1v14a1 1 0 01-1 1H8a1 1 0 01-1-1V4z"},null,-1)])]))])])])])])]),i.createElementVNode("div",oG,[i.createElementVNode("div",{onClick:L[19]||(L[19]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:i.normalizeClass(["pbx-flex pbx-items-center pbx-py-2 pbx-w-full",[r.showCloseButton?"pbx-justify-between":"pbx-justify-end"]])},[i.createVNode(sW)],2),r.showPublishButton?(i.openBlock(),i.createElementBlock("div",iG,[i.createElementVNode("button",{class:"pbx-myPrimaryButton",onClick:L[20]||(L[20]=async()=>{P()})},i.toDisplayString(i.unref(n)("Publish")),1)])):i.createCommentVNode("",!0),i.unref(t)&&v.value&&v.value.userSettings&&v.value.userSettings.language&&!((Bt=v.value.userSettings.language)!=null&&Bt.disableLanguageDropDown)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[v.value&&v.value.userSettings&&v.value.userSettings.language?(i.openBlock(),i.createElementBlock("div",nG,[i.withDirectives(i.createElementVNode("select",{id:"pbx-lang",class:"pbx-myPrimarySelect pbx-min-w-20","onUpdate:modelValue":L[21]||(L[21]=U=>N.value=U)},[Array.isArray(v.value.userSettings.language.enable)&&v.value.userSettings.language.enable.length>=1?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(i.unref(t).availableLanguage().filter(U=>{var qi,wr,Ui,Ho;return((Ho=(Ui=(wr=(qi=v.value)==null?void 0:qi.userSettings)==null?void 0:wr.language)==null?void 0:Ui.enable)==null?void 0:Ho.includes(U))??!1}),U=>(i.openBlock(),i.createElementBlock("option",{key:U,value:U},i.toDisplayString(U),9,aG))),128)):i.createCommentVNode("",!0),!v.value.userSettings.language.enable||Array.isArray(v.value.userSettings.language.enable)&&v.value.userSettings.language.enable.length===0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(i.unref(t).availableLanguage(),U=>(i.openBlock(),i.createElementBlock("option",{key:U,value:U},i.toDisplayString(U),9,lG))),128)):i.createCommentVNode("",!0)],512),[[i.vModelSelect,N.value]])])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),r.showCloseButton?(i.openBlock(),i.createElementBlock("div",sG,[i.createElementVNode("button",{class:"pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white hover:pbx-fill-white focus-visible:pbx-ring-0",onClick:L[22]||(L[22]=async()=>{S(),await i.unref(t).clearHtmlSelection()})},[...L[43]||(L[43]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," close ",-1)])])])):i.createCommentVNode("",!0)])]),i.createElementVNode("div",pG,[i.createElementVNode("div",{onClick:L[24]||(L[24]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),id:"pagebuilder-left-menu",class:"pbx-w-16 pbx-pt-7 pbx-pb-2 pbx-bg-myPrimaryLightGrayColor pbx-rounded-r-2xl pbx-shadow-sm"},[i.createElementVNode("div",dG,[i.createElementVNode("div",{onClick:L[23]||(L[23]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"]))},[i.createVNode(AN)])])]),i.createElementVNode("main",{ref_key:"pbxBuilderWrapper",ref:Pp,id:"page-builder-wrapper",class:i.normalizeClass(["pbx-transition-all pbx-duration-300 pbx-font-sans pbx-p-1 pbx-flex pbx-flex-col pbx-grow pbx-rounded-tr-2xl pbx-rounded-tl-2xl pbx-border-solid pbx-border pbx-border-gray-200 pbx-items-stretch pbx-text-black pbx-h-[100vh] pbx-overflow-y-scroll pbx-relative pbx-pt-16",[(V.value,"pbx-w-full")]])},[i.createElementVNode("div",cG,[Xe.value?(i.openBlock(),i.createBlock(M_,{key:0,onOpenGlobalPageSettings:Qt,onOpenImageSettings:Fi})):i.createCommentVNode("",!0)]),i.createElementVNode("div",{id:"pagebuilder","data-builder-canvas":"",class:i.normalizeClass([D.value,"pbx-text-black"])},[Array.isArray(Pt.value)&&Pt.value.length===0?(i.openBlock(),i.createElementBlock("div",mG,[i.createElementVNode("div",bG,[i.createElementVNode("div",{onClick:L[25]||(L[25]=U=>Ao(0)),class:"pbx-py-4 pbx-px-4 pbx-my-4 pbx-rounded-full pbx-bg-gray-100 pbx-text-gray-600 pbx-flex pbx-items-center pbx-justify-center hover:pbx-text-white hover:pbx-bg-gray-900 pbx-cursor-pointer"},[i.createElementVNode("div",xG,[i.createElementVNode("span",gG,i.toDisplayString(i.unref(n)("Add new Components")),1)])])])])):i.createCommentVNode("",!0),Array.isArray(Pt.value)&&Pt.value.length!=0?(i.openBlock(),i.createElementBlock("div",uG,[i.createElementVNode("div",hG,[i.createElementVNode("div",{onClick:L[26]||(L[26]=U=>Ao(0)),id:"addsection",class:"pbx-font-sans pbx-h-10 pbx-rounded-l-full pbx-bg-gray-100 pbx-text-gray-600 pbx-z-50 pbx-pl-2 pbx-pr-2 pbx-flex pbx-items-center pbx-justify-center hover:pbx-text-white hover:pbx-bg-gray-900 pbx-cursor-pointer"},[i.createElementVNode("div",fG,[L[44]||(L[44]=i.createElementVNode("span",{class:"material-symbols-outlined"}," add ",-1)),i.createElementVNode("span",yG,i.toDisplayString(i.unref(n)("Add")),1)])])])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Pt.value,(U,qi)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:U.id},[U.html_code?(i.openBlock(),i.createElementBlock("div",{key:0,"data-pagebuilder-content":"",innerHTML:U.html_code,onMouseup:wr=>Yt(U)},null,40,wG)):i.createCommentVNode("",!0),Array.isArray(Pt.value)&&Pt.value.length!=0?(i.openBlock(),i.createElementBlock("div",vG,[i.createElementVNode("div",kG,[i.createElementVNode("div",{onClick:wr=>Ao(qi+1),id:"addsection",class:"pbx-font-sans pbx-h-10 pbx-rounded-l-full pbx-bg-gray-100 pbx-text-gray-600 pbx-z-50 pbx-pl-2 pbx-pr-2 pbx-flex pbx-items-center pbx-justify-center hover:pbx-text-white hover:pbx-bg-gray-900 pbx-cursor-pointer"},[i.createElementVNode("div",CG,[L[45]||(L[45]=i.createElementVNode("span",{class:"material-symbols-outlined"}," add ",-1)),i.createElementVNode("span",EG,i.toDisplayString(i.unref(n)("Add")),1)])],8,SG)])])):i.createCommentVNode("",!0)],64))),128))],2)],2),i.createVNode(i.Transition,{name:"slide-right",appear:"",mode:"out-in"},{default:i.withCtx(()=>[V.value?(i.openBlock(),i.createElementBlock("aside",{key:0,"aria-label":"menu",id:"pagebuilder-right-menu",class:i.normalizeClass(["pbx-z-20 pbx-flex-shrink-0 pbx-overflow-hidden pbx-border-0 pbx-border-solid pbx-border-l-0 pbx-border-l-gray-600 pbx-rounded-l-2xl pbx-h-[100vh]",[V.value?"pbx-w-96 pbx-bg-myPrimaryLightGrayColor pbx-items-stretch":"bpx-w-0 pbx-mr-0"]])},[i.createVNode(eW,{onCloseEditor:L[27]||(L[27]=U=>i.unref(s).setMenuRight(!1))})],2)):(i.openBlock(),i.createElementBlock("div",{key:1,onClick:L[30]||(L[30]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-w-18 pbx-bg-myPrimaryLightGrayColor pbx-pt-5 pbx-z-20 pbx-flex-shrink-0 pbx-overflow-hidden pbx-border-0 pbx-border-solid pbx-border-l-0 pbx-border-l-gray-600 pbx-rounded-l-2xl pbx-h-[100vh] pbx-pl-2 pbx-pr-2"},[i.createElementVNode("div",{onClick:L[29]||(L[29]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-flex pbx-flex-col pbx-items-center pbx-justify-center pbx-gap-2"},[V.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:0,onClick:L[28]||(L[28]=U=>i.unref(s).setMenuRight(!0)),type:"button",class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",TG,[...L[46]||(L[46]=[i.createElementVNode("g",{"clip-path":"url(#prefix__clip0_1645_485)"},[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M19.871 1.81a2.768 2.768 0 00-3.914 0l-3.543 3.544-2.5-2.5L0 12.768l8.914 8.914 9.914-9.914-2.5-2.5 3.543-3.543a2.768 2.768 0 000-3.914zm-2.5 1.415a.768.768 0 011.086 1.086L13.5 9.268l2.5 2.5-1.086 1.086-6.086-6.086 1.086-1.086 2.5 2.5 4.957-4.957zM7.414 8.182l-4.586 4.586 1.086 1.086 3.293-3.293 1.414 1.414-3.293 3.293 1.086 1.086 3.293-3.293 1.414 1.414-3.293 3.293 1.086 1.086 4.586-4.586-6.086-6.086z","fill-rule":"evenodd"})],-1),i.createElementVNode("defs",null,[i.createElementVNode("clipPath",{id:"prefix__clip0_1645_485"},[i.createElementVNode("path",{d:"M0 0h22v22H0z",fill:"#fff"})])],-1)])]))])]))])]))]),_:1})])]),i.createVNode($e,{maxWidth:"5xl",showModalBuilder:Xt.value,title:i.unref(n)("Global Page Styles"),onCloseMainModalBuilder:Zr,minHeight:"",maxHeight:""},{default:i.withCtx(()=>[i.createVNode(pT,{isLoading:rt.value},null,8,["isLoading"])]),_:1},8,["showModalBuilder","title"]),i.createVNode(Q3,{title:i.unref(n)("Image Settings"),showSidebarPanel:ot.value,position:"left",closeOnOverlayClick:!1,onCloseSidebarPanel:xT},{default:i.withCtx(()=>[i.createVNode(PW,{show:ot.value},null,8,["show"])]),_:1},8,["title","showSidebarPanel"]),i.createVNode($e,{maxWidth:"7xl",showModalBuilder:Ze.value,title:i.unref(n)("HTML Editor"),onCloseMainModalBuilder:ge},{default:i.withCtx(()=>[hr.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.withDirectives(i.createElementVNode("textarea",{id:"html-editor","onUpdate:modelValue":L[31]||(L[31]=U=>yt.value=U),class:"pbx-h-full pbx-font-sans pbx-bg-gray-900 pbx-text-white pbx-w-full",style:{overflow:"auto","min-height":"400px"}},null,512),[[i.vModelText,yt.value]]),i.createElementVNode("div",MG,[q.value?(i.openBlock(),i.createElementBlock("p",NG," Error: "+i.toDisplayString(q.value),1)):i.createCommentVNode("",!0)]),i.createElementVNode("div",PG,[i.createElementVNode("div",LG,[i.createElementVNode("div",BG,[$.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("button",{onClick:ge,type:"button",class:"pbx-mySecondaryButton"},i.toDisplayString(i.unref(n)("Close")),1),i.createElementVNode("button",{onClick:WG,type:"button",class:"pbx-myPrimaryButton"},i.toDisplayString(i.unref(n)("Save")),1)],64)),$.value?(i.openBlock(),i.createElementBlock("div",AG,[...L[47]||(L[47]=[i.createElementVNode("div",{class:"pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"},[i.createElementVNode("span",{class:"!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"},"Loading...")],-1)])])):i.createCommentVNode("",!0)])])])],64)),hr.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.withDirectives(i.createElementVNode("textarea",{id:"html-editor","onUpdate:modelValue":L[32]||(L[32]=U=>wt.value=U),class:"pbx-h-full pbx-font-sans pbx-bg-gray-900 pbx-text-white pbx-w-full",style:{overflow:"auto","min-height":"400px"}},null,512),[[i.vModelText,wt.value]]),i.createElementVNode("div",DG,[q.value?(i.openBlock(),i.createElementBlock("p",VG," Error: "+i.toDisplayString(q.value),1)):i.createCommentVNode("",!0)]),i.createElementVNode("div",zG,[i.createElementVNode("div",IG,[i.createElementVNode("div",OG,[$.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("button",{onClick:ge,type:"button",class:"pbx-mySecondaryButton"},i.toDisplayString(i.unref(n)("Close")),1),i.createElementVNode("button",{onClick:GG,type:"button",class:"pbx-myPrimaryButton"},i.toDisplayString(i.unref(n)("Save")),1)],64)),$.value?(i.openBlock(),i.createElementBlock("div",_G,[...L[48]||(L[48]=[i.createElementVNode("div",{class:"pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"},[i.createElementVNode("span",{class:"!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"},"Loading...")],-1)])])):i.createCommentVNode("",!0)])])])],64)):i.createCommentVNode("",!0)]),_:1},8,["showModalBuilder","title"])],64)}}});class To{static getHistory(e){const t=e+this.HISTORY_KEY_SUFFIX,o=localStorage.getItem(t);return o?JSON.parse(o):[]}static addToHistory(e,t){const o=e+this.HISTORY_KEY_SUFFIX;let n=this.getHistory(e);n.push(t),n.length>this.MAX_HISTORY_SIZE&&(n=n.slice(n.length-this.MAX_HISTORY_SIZE)),localStorage.setItem(o,JSON.stringify(n))}static clearHistory(e){const t=e+this.HISTORY_KEY_SUFFIX;localStorage.removeItem(t)}}Q(To,"HISTORY_KEY_SUFFIX","-history"),Q(To,"MAX_HISTORY_SIZE",10);const Sp={objectFit:["none","pbx-object-cover","pbx-object-contain"],objectPosition:["none","pbx-object-top-left","pbx-object-top","pbx-object-top-right","pbx-object-left","pbx-object-center","pbx-object-right","pbx-object-bottom-left","pbx-object-bottom","pbx-object-bottom-right"],aspectRatio:["none","pbx-aspect-square","pbx-aspect-video","pbx-aspect-[9/16]"]};let qa;const RG=new Uint8Array(16);function jG(){if(!qa&&(qa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qa(RG)}const Le=[];for(let r=0;r<256;++r)Le.push((r+256).toString(16).slice(1));function FG(r,e=0){return Le[r[e+0]]+Le[r[e+1]]+Le[r[e+2]]+Le[r[e+3]]+"-"+Le[r[e+4]]+Le[r[e+5]]+"-"+Le[r[e+6]]+Le[r[e+7]]+"-"+Le[r[e+8]]+Le[r[e+9]]+"-"+Le[r[e+10]]+Le[r[e+11]]+Le[r[e+12]]+Le[r[e+13]]+Le[r[e+14]]+Le[r[e+15]]}const cT={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function mT(r,e,t){if(cT.randomUUID&&!r)return cT.randomUUID();r=r||{};const o=r.random||(r.rng||jG)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,FG(o)}const qG=["en","zh-Hans","fr","ja","ru","es","pt","de","ar","hi","da","it"],Ua="pbx-full-width-component";class bT{constructor(e){Q(this,"fontSizeRegex",/^(sm:|md:|lg:|xl:|2xl:)?pbx-text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);Q(this,"pageBuilderStateStore");Q(this,"getLocalStorageItemName");Q(this,"getApplyImageToSelection");Q(this,"getHyberlinkEnable");Q(this,"getComponents");Q(this,"getComponent");Q(this,"getElement");Q(this,"getComponentArrayAddMethod");Q(this,"NoneListernesTags");Q(this,"hasStartedEditing",!1);Q(this,"originalComponents");Q(this,"savedMountComponents",null);Q(this,"pendingMountComponents",null);Q(this,"globalStylesObserver",null);Q(this,"_pendingPageSettings",null);Q(this,"_lastKnownPageSettings",null);Q(this,"isPageBuilderMissingOnStart",!1);Q(this,"elementsWithListeners",new WeakMap);Q(this,"translate");Q(this,"handleMouseOver",(e,t)=>{e.preventDefault(),e.stopPropagation();const o=document.querySelector("#pagebuilder");if(!o)return;const n=o.querySelector("[hovered]");n&&n.removeAttribute("hovered"),t.hasAttribute("selected")||t.setAttribute("hovered","")});Q(this,"handleMouseLeave",e=>{e.preventDefault(),e.stopPropagation();const t=document.querySelector("#pagebuilder");if(!t)return;const o=t.querySelector("[hovered]");o&&o.removeAttribute("hovered")});Q(this,"addListenersToEditableElements",async()=>{const e=document.querySelector("#pagebuilder");e&&(await i.nextTick(),e.querySelectorAll("section *").forEach(t=>{if(this.isEditableElement(t)){const o=t;if(this.elementsWithListeners.has(o)){const s=this.elementsWithListeners.get(o);s&&(o.removeEventListener("click",s.click),o.removeEventListener("mouseover",s.mouseover),o.removeEventListener("mouseleave",s.mouseleave))}const n=s=>this.handleElementClick(s,o),a=s=>this.handleMouseOver(s,o),l=s=>this.handleMouseLeave(s);o.addEventListener("click",n),o.addEventListener("mouseover",a),o.addEventListener("mouseleave",l),this.elementsWithListeners.set(o,{click:n,mouseover:a,mouseleave:l})}}))});Q(this,"handleElementClick",async(e,t)=>{if(this.pageBuilderStateStore.getImageSettingsPanelOpen)return;e.preventDefault(),e.stopPropagation();const o=document.querySelector("#pagebuilder");if(!o)return;this.pageBuilderStateStore.setMenuRight(!0);const n=o.querySelector("[selected]");n&&n.removeAttribute("selected"),t.removeAttribute("hovered"),t.setAttribute("selected",""),this.pageBuilderStateStore.setElement(t),await this.handleAutoSave()});Q(this,"handleAutoSave",async()=>{this.startEditing();const e=this.pageBuilderStateStore.getPageBuilderConfig;if(e&&e.userSettings&&typeof e.userSettings.autoSave=="boolean"&&e.userSettings.autoSave!==!1){if(this.pageBuilderStateStore.getIsSaving)return;try{this.pageBuilderStateStore.setIsSaving(!0),this.saveDomComponentsToLocalStorage(),await se(400)}catch(t){console.error("Error trying auto save.",t)}finally{this.pageBuilderStateStore.setIsSaving(!1)}}if(e&&!e.userSettings)try{this.pageBuilderStateStore.setIsSaving(!0),this.saveDomComponentsToLocalStorage(),await se(400)}catch(t){console.error("Error trying saving.",t)}finally{this.pageBuilderStateStore.setIsSaving(!1)}});Q(this,"handleManualSave",async e=>{this.pageBuilderStateStore.setIsSaving(!0),e||this.clearHtmlSelection(),this.startEditing(),this.saveDomComponentsToLocalStorage(),await se(300),this.pageBuilderStateStore.setIsSaving(!1)});Q(this,"ensureTextAreaHasContent",()=>{if(!this.getElement.value||typeof this.getElement.value.innerHTML!="string")return;const e=this.getElement.value,t=e.tagName;["DIV"].includes(t)&&e.tagName.toLowerCase()!=="img"&&e.textContent&&Number(e.textContent.length)===0?(e.classList.add("h-6"),e.classList.add("bg-red-50")):(e.classList.remove("h-6"),e.classList.remove("bg-red-50"))});Q(this,"handleTextInput",async e=>{var t;typeof((t=this.getElement.value)==null?void 0:t.innerHTML)=="string"&&(typeof this.getElement.value.innerHTML=="string"&&(await i.nextTick(),this.getElement.value.textContent=e,this.pageBuilderStateStore.setTextAreaVueModel(this.getElement.value.innerHTML),this.getElement.value.innerHTML=e),this.ensureTextAreaHasContent())});this.hasStartedEditing=!1,this.pageBuilderStateStore=e;const{translate:t}=re();this.translate=t,this.getApplyImageToSelection=i.computed(()=>this.pageBuilderStateStore.getApplyImageToSelection),this.getLocalStorageItemName=i.computed(()=>this.pageBuilderStateStore.getLocalStorageItemName),this.getHyberlinkEnable=i.computed(()=>this.pageBuilderStateStore.getHyberlinkEnable),this.getComponents=i.computed(()=>this.pageBuilderStateStore.getComponents),this.getComponent=i.computed(()=>this.pageBuilderStateStore.getComponent),this.getElement=i.computed(()=>this.pageBuilderStateStore.getElement),this.getComponentArrayAddMethod=i.computed(()=>this.pageBuilderStateStore.getComponentArrayAddMethod),this.NoneListernesTags=["P","H1","H2","H3","H4","H5","H6","IFRAME","UL","OL","LI","EM","STRONG","B","A","SPAN","BLOCKQUOTE","BR","PRE","CODE","MARK","DEL","INS","U","FIGURE","FIGCAPTION"]}availableLanguage(){return qG}changeLanguage(e){this.pageBuilderStateStore.setCurrentLanguage(e)}async clearHtmlSelection(){this.pageBuilderStateStore.getImageSettingsPanelOpen||(this.pageBuilderStateStore.setComponent(null),this.pageBuilderStateStore.setElement(null),await this.removeHoveredAndSelected())}ensureUpdateOrCreateConfig(e){if(!e.updateOrCreate||e.updateOrCreate&&er(e.updateOrCreate)){const t={...e,updateOrCreate:{formType:"create",formName:"post"}};this.pageBuilderStateStore.setPageBuilderConfig(t);return}if(e.updateOrCreate&&typeof e.updateOrCreate.formType=="string"&&(e.updateOrCreate.formType==="create"||e.updateOrCreate.formType==="update")&&typeof e.updateOrCreate.formName!="string"||typeof e.updateOrCreate.formName=="string"&&e.updateOrCreate.formName.length===0){const t={...e,updateOrCreate:{formType:e.updateOrCreate.formType,formName:"post"}};this.pageBuilderStateStore.setPageBuilderConfig(t)}if(e.updateOrCreate&&typeof e.updateOrCreate.formType!="string"||typeof e.updateOrCreate.formType=="string"&&e.updateOrCreate.formType!=="create"&&e.updateOrCreate.formType!=="update"&&typeof e.updateOrCreate.formName=="string"&&e.updateOrCreate.formName.length!==0){const t={...e,updateOrCreate:{formType:"create",formName:e.updateOrCreate.formName}};this.pageBuilderStateStore.setPageBuilderConfig(t);return}if(e.updateOrCreate&&typeof e.updateOrCreate.formType=="string"&&e.updateOrCreate.formType!=="create"&&e.updateOrCreate.formType!=="update"&&typeof e.formName!="string"){const t={...e,updateOrCreate:{formType:"create",formName:"post"}};this.pageBuilderStateStore.setPageBuilderConfig(t)}}validateUserProvidedComponents(e){const t=this.pageBuilderStateStore.getPageBuilderConfig&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate.formType;if(Array.isArray(e)&&e.length>=1&&t==="create"&&e)return{error:!0,warning:"You cannot set formType to create in your configuration while also passing a components data array to the Page Builder. Please set formType to update.",status:"validation_failed"};if(!Array.isArray(e))return{error:!0,reason:"Components data must be an array."};const o=e[0];if(o&&"html_code"in o&&typeof o.html_code!="string")return{error:!0,reason:"The 'html_code' property in the first object must be a string."};if(Array.isArray(e)&&e.length>=1&&(!o||!("html_code"in o)))return{error:!0,reason:"The first object in the array must include an 'html_code' key."}}ensureLanguage(e){const o=["en","zh-Hans","fr","ja","ru","es","pt","de","ar","hi","da"];let n=!1;const a=e.userSettings,l=a&&a.language;if((!a||er(a)||!l||er(l))&&(n=!0),n){const s=a?{...a}:{};s.language={default:"en",enable:o};const p={...e,userSettings:s};this.pageBuilderStateStore.setPageBuilderConfig(p);return}if(l&&Array.isArray(l.enable)&&l.default&&!l.enable.includes(l.default)){const s=[...l.enable,l.default],p={...e,userSettings:{...a,language:{...l,enable:s}}};this.pageBuilderStateStore.setPageBuilderConfig(p)}}validateConfig(e){var n;const t={updateOrCreate:{formType:"create",formName:"post"}};if(!e||e&&Object.keys(e).length===0&&e.constructor===Object){this.pageBuilderStateStore.setPageBuilderConfig(t);return}e&&Object.keys(e).length!==0&&e.constructor===Object&&(this.ensureUpdateOrCreateConfig(e),(!e.resourceData||typeof e.resourceData.title!="string"||!e.resourceData.title.trim())&&(!e.resourceData||typeof e.resourceData!="object"?e.resourceData={title:"Default Post"}:e.resourceData.title="Default Post"));let o=e;if(!o.userSettings||typeof o.userSettings!="object"||!("autoSave"in o.userSettings)){const a=o.userSettings?{...o.userSettings}:{};a.autoSave=((n=o.userSettings)==null?void 0:n.autoSave)!==!1;const l={...o,userSettings:a};this.pageBuilderStateStore.setPageBuilderConfig(l),o=l}this.ensureLanguage(o)}saveUserSettingsStorage(e){localStorage.setItem("userSettingsPageBuilder",JSON.stringify({userSettings:{lang:e}}))}async startBuilder(e,t){var a,l;this.pageBuilderStateStore.setBuilderStarted(!0);const o=document.querySelector("#pagebuilder");let n;try{this.originalComponents=t,this.pageBuilderStateStore.setPageBuilderConfig(e);const s=JSON.parse(localStorage.getItem("userSettingsPageBuilder")??"null");!(s!=null&&s.lang)&&((l=(a=e.userSettings)==null?void 0:a.language)!=null&&l.default)&&this.changeLanguage(e.userSettings.language.default),this.validateConfig(e),n=this.validateUserProvidedComponents(t),this.updateLocalStorageItemName(),this.initializeHistory(),t&&(this.savedMountComponents=t),o||(this.isPageBuilderMissingOnStart=!0),t&&!o&&(this.pendingMountComponents=t),o&&this.completeBuilderInitialization(t);const p={message:"Page builder started successfully."};return n&&(p.validation=n),Array.isArray(t)&&t.length>=0&&(p.passedComponentsArray=t),p}catch(s){return console.error("Not able to start the Page Builder",s),{error:!0,reason:"Failed to start the Page Builder due to an unexpected error."}}}async completeBuilderInitialization(e){this.pageBuilderStateStore.setIsLoadingGlobal(!0),await se(400),this.deleteAllComponentsFromDOM();const t=this.pageBuilderStateStore.getPageBuilderConfig,o=t&&t.updateOrCreate&&t.updateOrCreate.formType,n=this.getSavedPageHtml();if(await this.clearHtmlSelection(),o==="update"||o==="create"){if(!this.pendingMountComponents){if(!e&&this.isPageBuilderMissingOnStart&&n){await this.completeMountProcess(n);return}if(e&&!n){const a=this.renderComponentsToHtml(e);await this.completeMountProcess(a,!0),this.saveDomComponentsToLocalStorage();return}if(e&&n){const a=this.renderComponentsToHtml(e);await this.completeMountProcess(a,!0),await se(500),this.pageBuilderStateStore.setHasLocalDraftForUpdate(!0);return}if(!e&&n&&!this.savedMountComponents){await this.completeMountProcess(n);return}if(!e&&this.savedMountComponents&&n){const a=this.renderComponentsToHtml(this.savedMountComponents);await this.completeMountProcess(a);return}if(!e&&!n&&this.isPageBuilderMissingOnStart){const a=this.renderComponentsToHtml([]);await this.completeMountProcess(a);return}if(!this.isPageBuilderMissingOnStart&&!n&&!e){const a=this.renderComponentsToHtml([]);await this.completeMountProcess(a);return}}if(this.pendingMountComponents){if(n&&this.isPageBuilderMissingOnStart){const a=this.renderComponentsToHtml(this.pendingMountComponents);await this.completeMountProcess(a,!0),await se(500),this.pageBuilderStateStore.setHasLocalDraftForUpdate(!0),this.pendingMountComponents=null;return}if(!n&&e&&this.isPageBuilderMissingOnStart){const a=this.renderComponentsToHtml(this.pendingMountComponents);await this.completeMountProcess(a,!0),this.saveDomComponentsToLocalStorage();return}if(!e&&!n&&this.isPageBuilderMissingOnStart){const a=this.renderComponentsToHtml(this.pendingMountComponents);await this.completeMountProcess(a,!0),this.saveDomComponentsToLocalStorage();return}}}}renderComponentsToHtml(e){return!e||Array.isArray(e)&&e.length===0?'<div id="pagebuilder" class="pbx-text-black pbx-font-sans"></div>':e.map(o=>o.html_code).join(`
|
|
392
|
+
`,-1))])])])])])])]))),128))])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])])])])])):i.createCommentVNode("",!0)]))])])}}}),jU={class:"pbx-flex pbx-h-full pbx-flex-col"},FU={class:"pbx-flex pbx-flex-row pbx-justify-between pbx-pt-7 pbx-pr-4 pbx-pl-4 pbx-items-center pbx-mb-3"},qU={class:"pbx-font-medium pbx-text-sm"},UU={class:"pbx-lowercase"},WU={class:"pbx-mb-1"},GU={class:"pbx-my-1"},KU={class:"pbx-my-1"},JU={class:"pbx-my-1"},YU={class:"pbx-my-1"},XU={class:"pbx-my-1"},QU={class:"pbx-my-1"},ZU={class:"pbx-my-1"},$U={class:"pbx-font-medium pbx-my-0 pbx-py-0"},eW=i.defineComponent({__name:"RightSidebarEditor",emits:["closeEditor"],setup(r){const{translate:e}=re(),t=ce(),o=oe,n=i.computed(()=>o.getElement),a=i.computed(()=>{var x;return(x=n.value)==null?void 0:x.tagName}),l=i.ref(null);let s=0;i.watch(()=>o.getElement,()=>{i.nextTick(()=>{l.value&&(l.value.scrollTop=s)})});function p(){l.value&&(s=l.value.scrollTop)}const d=i.ref(!1),c=i.ref(!1),m=async function(){d.value=!0,c.value=!0,await se(200),o.setToggleGlobalHtmlMode(!0),await t.globalPageStyles(),c.value=!1},b=async function(){c.value=!0,await se(200),await t.handleManualSave(),t.stopGlobalStylesSync();const x=document.querySelector("[data-pagebuilder-content]");x&&x.removeAttribute("data-global-selected"),d.value=!1,c.value=!1};return(x,g)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",jU,[i.createElementVNode("div",FU,[i.createElementVNode("button",{type:"button",onClick:g[0]||(g[0]=u=>x.$emit("closeEditor")),class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},[...g[1]||(g[1]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," close ",-1)])]),i.createElementVNode("p",qU,[i.createTextVNode(i.toDisplayString(i.unref(e)("Editing"))+" ",1),i.createElementVNode("span",UU,"<"+i.toDisplayString(a.value)+">",1)])]),i.createElementVNode("div",{ref_key:"scrollContainer",ref:l,onScroll:p,class:"pbx-pl-3 pbx-pr-3 pbx-mb-4 pbx-overflow-y-scroll"},[i.withDirectives(i.createElementVNode("div",null,[i.createElementVNode("article",WU,[i.createVNode(tR)]),i.createElementVNode("article",GU,[i.createVNode(kR)]),i.createElementVNode("article",KU,[i.createVNode(iT)]),i.createElementVNode("article",JU,[i.createVNode(nT)]),i.createElementVNode("article",YU,[i.createVNode(aT)]),i.createElementVNode("article",XU,[i.createVNode(lT)]),i.createElementVNode("article",QU,[i.createVNode(rT)]),i.createElementVNode("article",ZU,[i.createVNode(oT)]),g[2]||(g[2]=i.createElementVNode("div",{class:"pbx-w-full pbx-border-t pbx-border-solid pbx-border-gray-200 pbx-my-6"},null,-1))],512),[[i.vShow,n.value&&i.unref(t).isEditableElement(n.value)]]),i.createElementVNode("button",{onClick:m,type:"button",class:"pbx-my-1 pbx-border pbx-border-gray-900 pbx-flex pbx-flex-row pbx-justify-between pbx-items-center pbx-pl-3 pbx-pr-3 pbx-py-5 pbx-cursor-pointer pbx-duration-200 pbx-bg-black pbx-text-white hover:pbx-bg-myPrimaryLightGrayColor hover:pbx-text-black pbx-select-none pbx-w-full"},[i.createElementVNode("p",$U,i.toDisplayString(i.unref(e)("Global Page Styles")),1)])],544)]),i.createVNode($e,{maxWidth:"5xl",showModalBuilder:d.value,title:i.unref(e)("Selected HTML"),onCloseMainModalBuilder:b,minHeight:"",maxHeight:""},{default:i.withCtx(()=>[i.createVNode(pT,{isLoading:c.value},null,8,["isLoading"])]),_:1},8,["showModalBuilder","title"])],64))}}),tW={class:"pbx-flex pbx-items-center pbx-justify-center pbx-ml-2"},rW={class:"pbx-mr-2"},oW={key:0,class:"pbx-flex pbx-items-center pbx-myPrimaryTag pbx-whitespace-nowrap pbx-py-0 pbx-gap-2"},iW={class:"pbx-text-white pbx-rounded-full pbx-bg-myPrimaryBrandColor pbx-flex pbx-justify-center pbx-items-center pbx-text-xs pbx-d pbx-min-d pbx-max-d lg:pbx-w-8 lg:pbx-h-8 lg:pbx-min-w-8 lg:pbx-max-w-8 pbx-w-8 pbx-h-8 pbx-min-w-8 pbx-max-w-8 pbx-font-normal"},nW={key:1,class:"pbx-flex pbx-items-center lg:pbx-myPrimaryTag pbx-whitespace-nowrap pbx-py-0 pbx-gap-4 pbx-w-max pbx-h-12 pbx-ml-2"},aW={class:"pbx-text-white pbx-flex-shrink-0 pbx-d pbx-w-10 pbx-h-10 pbx-rounded-full pbx-flex pbx-justify-center pbx-items-center pbx-text-xs pbx-rounded-l-full"},lW=["src"],sW=i.defineComponent({__name:"ToolbarOption",setup(r){const e=oe,t=i.computed(()=>e.getPageBuilderConfig);return(o,n)=>{var a;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",tW,[i.createElementVNode("div",rW,[t.value&&t.value.userForPageBuilder&&t.value.userForPageBuilder.name&&(!t.value.userForPageBuilder.image||typeof t.value.userForPageBuilder.image=="string"&&((a=t.value.userForPageBuilder.image)==null?void 0:a.length)<2)?(i.openBlock(),i.createElementBlock("div",oW,[i.createElementVNode("div",iW,i.toDisplayString(typeof t.value.userForPageBuilder.name=="string"&&t.value.userForPageBuilder.name[0]),1)])):i.createCommentVNode("",!0),t.value&&t.value.userForPageBuilder&&t.value.userForPageBuilder.name&&t.value.userForPageBuilder.image&&typeof t.value.userForPageBuilder.image=="string"&&t.value.userForPageBuilder.image.length>2?(i.openBlock(),i.createElementBlock("div",nW,[i.createElementVNode("div",aW,[i.createElementVNode("img",{alt:"Avatar",src:`${t.value.userForPageBuilder.image}`,class:"pbx-block pbx-inset-0 pbx-object-top pbx-d pbx-min-d pbx-max-d lg:pbx-w-8 lg:pbx-h-8 lg:pbx-min-w-8 lg:pbx-max-w-8 pbx-w-8 pbx-h-8 pbx-min-w-8 pbx-max-w-8 pbx-object-cover pbx-rounded-full"},null,8,lW)])])):i.createCommentVNode("",!0)])])])}}});let kp=null;function pW(){return(r,e=300)=>{kp&&clearTimeout(kp),kp=setTimeout(r,e)}}const dW={};function cW(r,e){return i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[e[0]||(e[0]=i.createElementVNode("div",{class:"pbx-bg-white pbx-flex pbx-justify-center pbx-items-center min-pbx-h-screen pbx-h-screen pbx-w-screen pbx-fixed pbx-inset-0 pbx-z-[10000]"},[i.createElementVNode("div",{class:"pbx-absolute pbx-top-1/3"},[i.createElementVNode("div",{class:"pbx-flex pbx-items-center pbx-justify-center pbx-mt-4"},[i.createElementVNode("div",{class:"pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"},[i.createElementVNode("span",{class:"!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"},"Loading...")])])])],-1))])}const dT=Oa(dW,[["render",cW]]),mW={class:"pbx-text-sm pbx-font-semibold pbx-text-myPrimaryDarkGrayColor pbx-mb-2"},bW={class:"pbx-flex pbx-gap-2"},xW={class:"pbx-text-xs pbx-text-gray-500 pbx-mt-2 pbx-mb-0"},gW={class:"pbx-text-sm pbx-font-semibold pbx-text-myPrimaryDarkGrayColor pbx-mb-2"},uW={class:"pbx-flex pbx-items-center pbx-justify-center"},hW={class:"pbx-inline-grid pbx-gap-1 pbx-py-8 pbx-px-2 pbx-rounded-xl pbx-border pbx-border-solid pbx-border-gray-200 pbx-bg-gray-50 pbx-w-full pbx-justify-center",style:{"grid-template-columns":"repeat(3, 2.5rem)"}},fW=["title","onClick"],yW={class:"pbx-text-sm pbx-font-semibold pbx-text-myPrimaryDarkGrayColor pbx-mb-2"},wW={class:"pbx-grid pbx-grid-cols-2 pbx-gap-2"},vW=["onClick"],kW={for:"image-alt-text",class:"pbx-text-sm pbx-font-semibold pbx-text-myPrimaryDarkGrayColor pbx-mb-2 pbx-block"},SW={class:"pbx-flex pbx-justify-between pbx-items-center pbx-gap-4 pbx-border pbx-border-gray-200 pbx-py-4 pbx-px-3 pbx-rounded-lg"},CW=["placeholder","onKeydown"],EW=["disabled","title"],TW={key:0,class:"material-symbols-outlined pbx-text-xl"},MW={key:1,class:"material-symbols-outlined pbx-animate-spin"},NW={class:"pbx-text-xs pbx-text-gray-500 pbx-mt-2 pbx-mb-0"},PW=i.defineComponent({__name:"ImageSettingsModal",props:{show:{type:Boolean}},setup(r){const e=r,{translate:t}=re(),o=ce(),n=oe,a=i.ref(0),l=i.ref(""),s=i.ref(""),p=i.ref(!1),d=[["pbx-object-top-left","pbx-object-top","pbx-object-top-right"],["pbx-object-left","pbx-object-center","pbx-object-right"],["pbx-object-bottom-left","pbx-object-bottom","pbx-object-bottom-right"]],c=i.computed(()=>{a.value;const E=n.getImageObjectFit;return!E||E==="none"?null:E}),m=i.computed(()=>{a.value;const E=n.getImageObjectPosition;return!E||E==="none"?"pbx-object-center":E}),b=i.computed(()=>{a.value;const E=n.getImageAspectRatio;return!E||E==="none"?"none":E}),x=i.computed(()=>l.value.trim()!==s.value.trim());function g(){const E=o.getSelectedImageAltText();l.value=E,s.value=E}i.watch(()=>e.show,async E=>{E&&(g(),await o.initializeElementStyles(),g(),a.value++)},{immediate:!0});async function u(){a.value++,await o.handleAutoSave()}async function h(E){o.handleImageObjectFit(E),await u()}async function f(E){o.handleImageObjectPosition(E),await u()}async function w(E){o.handleImageAspectRatio(E),await u()}async function y(){if(!(!x.value||p.value)){p.value=!0,await se(400);try{await o.handleImageAltText(l.value),s.value=l.value.trim(),a.value++}finally{p.value=!1}}}const S=[{id:"none",labelKey:"Auto"},{id:"pbx-aspect-square",labelKey:"Square"},{id:"pbx-aspect-video",labelKey:"Landscape 16:9"},{id:"pbx-aspect-[9/16]",labelKey:"Portrait 9:16"}];return(E,P)=>(i.openBlock(),i.createElementBlock("div",{class:"pbx-flex pbx-flex-col pbx-gap-4 pbx-pt-1 pbx-pb-2",onMousedown:P[3]||(P[3]=i.withModifiers(()=>{},["stop"])),onClick:P[4]||(P[4]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",null,[i.createElementVNode("p",mW,i.toDisplayString(i.unref(t)("Image fit")),1),i.createElementVNode("div",bW,[i.createElementVNode("button",{type:"button",class:i.normalizeClass(["pbx-flex-1 pbx-rounded-xl pbx-border pbx-border-solid pbx-px-4 pbx-py-3 pbx-text-sm pbx-font-medium pbx-cursor-pointer pbx-transition-colors",c.value==="pbx-object-cover"?"pbx-border-myPrimaryLinkColor pbx-bg-green-50 pbx-text-myPrimaryLinkColor":"pbx-border-gray-200 pbx-bg-white pbx-text-gray-700 hover:pbx-border-gray-300"]),onClick:P[0]||(P[0]=k=>h("pbx-object-cover"))},i.toDisplayString(i.unref(t)("Cover")),3),i.createElementVNode("button",{type:"button",class:i.normalizeClass(["pbx-flex-1 pbx-rounded-xl pbx-border pbx-border-solid pbx-px-4 pbx-py-3 pbx-text-sm pbx-font-medium pbx-cursor-pointer pbx-transition-colors",c.value==="pbx-object-contain"?"pbx-border-myPrimaryLinkColor pbx-bg-green-50 pbx-text-myPrimaryLinkColor":"pbx-border-gray-200 pbx-bg-white pbx-text-gray-700 hover:pbx-border-gray-300"]),onClick:P[1]||(P[1]=k=>h("pbx-object-contain"))},i.toDisplayString(i.unref(t)("Contain")),3)]),i.createElementVNode("p",xW,i.toDisplayString(i.unref(t)("Cover fills the frame and may crop. Contain shows the full image.")),1)]),i.createElementVNode("div",null,[i.createElementVNode("p",gW,i.toDisplayString(i.unref(t)("Crop focus")),1),i.createElementVNode("div",uW,[i.createElementVNode("div",hW,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.flat(),k=>(i.openBlock(),i.createElementBlock("button",{key:k,type:"button",class:i.normalizeClass(["pbx-w-10 pbx-h-10 pbx-rounded-lg pbx-border pbx-border-solid pbx-flex pbx-items-center pbx-justify-center pbx-cursor-pointer pbx-text-xs pbx-transition-colors",m.value===k?"pbx-border-myPrimaryLinkColor pbx-bg-myPrimaryLinkColor pbx-text-white":"pbx-border-gray-200 pbx-bg-white pbx-text-gray-500 hover:pbx-border-gray-300"]),title:k.replace("pbx-object-",""),onClick:N=>f(k)},[...P[5]||(P[5]=[i.createElementVNode("span",{class:"material-symbols-outlined pbx-text-base"},"crop_free",-1)])],10,fW))),128))])])]),i.createElementVNode("div",null,[i.createElementVNode("p",yW,i.toDisplayString(i.unref(t)("Shape")),1),i.createElementVNode("div",wW,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(S,k=>i.createElementVNode("button",{key:k.id,type:"button",class:i.normalizeClass(["pbx-rounded-xl pbx-border pbx-border-solid pbx-px-3 pbx-py-2.5 pbx-text-sm pbx-font-medium pbx-cursor-pointer pbx-transition-colors",b.value===k.id?"pbx-border-myPrimaryLinkColor pbx-bg-green-50 pbx-text-myPrimaryLinkColor":"pbx-border-gray-200 pbx-bg-white pbx-text-gray-700 hover:pbx-border-gray-300"]),onClick:N=>w(k.id)},i.toDisplayString(i.unref(t)(k.labelKey)),11,vW)),64))])]),i.createElementVNode("div",null,[i.createElementVNode("label",kW,i.toDisplayString(i.unref(t)("Alt text")),1),i.createElementVNode("div",SW,[i.withDirectives(i.createElementVNode("input",{id:"image-alt-text","onUpdate:modelValue":P[2]||(P[2]=k=>l.value=k),type:"text",class:"pbx-myPrimaryInput pbx-flex-1 pbx-min-w-0",placeholder:i.unref(t)("Describe this image for accessibility"),onKeydown:i.withKeys(i.withModifiers(y,["prevent"]),["enter"])},null,40,CW),[[i.vModelText,l.value]]),i.createElementVNode("button",{type:"button",class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-shrink-0 pbx-rounded-xl pbx-border pbx-border-solid pbx-flex pbx-items-center pbx-justify-center pbx-cursor-pointer pbx-transition-colors",x.value?"pbx-border-myPrimaryLinkColor pbx-bg-myPrimaryLinkColor pbx-text-white hover:pbx-opacity-90":"pbx-border-gray-200 pbx-bg-gray-100 pbx-text-gray-400 pbx-cursor-not-allowed"]),disabled:!x.value||p.value,title:i.unref(t)("Save"),onClick:y},[p.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",TW,"check")),p.value?(i.openBlock(),i.createElementBlock("span",MW,"refresh")):i.createCommentVNode("",!0)],10,EW)]),i.createElementVNode("p",NW,i.toDisplayString(i.unref(t)("Helps screen readers and SEO understand the image content.")),1)])],32))}}),LW={class:"pbx-text-xs pbx-text-gray-600 pbx-mx-2 pbx-py-3 pbx-px-2 pbx-border-solid pbx-border pbx-border-gray-200 pbx-rounded-full"},BW=i.defineComponent({__name:"UndoRedo",emits:["toolbar-hide-request"],setup(r,{emit:e}){const t=ce(),o=e,n=oe,a=i.computed(()=>n.getIsLoadingGlobal),l=i.computed(()=>n.getHistoryIndex),s=i.computed(()=>n.getHistoryLength),p=i.computed(()=>l.value>0),d=i.computed(()=>l.value<s.value-1),c=async function(){p.value&&(o("toolbar-hide-request"),await t.undo(),await t.clearHtmlSelection())},m=async function(){d.value&&(o("toolbar-hide-request"),await t.redo(),await t.clearHtmlSelection())};return(b,x)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[a.value?(i.openBlock(),i.createBlock(dT,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("div",{onClick:x[0]||(x[0]=async()=>{await i.unref(t).clearHtmlSelection()}),class:"pbx-flex-1 pbx-flex pbx-justify-center pbx-items-center pbx-py-2 pbx-w-full gap-1"},[i.createElementVNode("div",{onClick:c,type:"button",class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square pbx-text-black hover:pbx-text-white",[p.value?"pbx-cursor-pointer hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0":"pbx-cursor-not-allowed pbx-bg-opacity-20 hover:pbx-bg-gray-200"]])},[...x[1]||(x[1]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," undo ",-1)])],2),i.createElementVNode("div",LW,i.toDisplayString(l.value+1)+"/"+i.toDisplayString(s.value),1),i.createElementVNode("div",{onClick:m,class:i.normalizeClass(["pbx-h-10 pbx-w-10 pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square pbx-text-black hover:pbx-text-white",[d.value?"pbx-cursor-pointer hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0":"pbx-cursor-not-allowed pbx-bg-opacity-20 hover:pbx-bg-gray-200"]])},[...x[2]||(x[2]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," redo ",-1)])],2)])],64))}}),AW=["width","height"],DW=i.defineComponent({__name:"LayersIcon",props:{size:{default:24}},setup(r){return(e,t)=>(i.openBlock(),i.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:r.size,height:r.size,viewBox:"0 0 24 24","aria-hidden":"true"},[...t[0]||(t[0]=[i.createStaticVNode('<title>layers</title><g fill="none"><path d="M9.12015 8.16C10.1529 7.38542 10.6693 6.99813 11.2364 6.84884C11.737 6.71706 12.2632 6.71705 12.7638 6.84883C13.331 6.99812 13.8474 7.38541 14.8801 8.15999L20.5868 12.44C21.7448 13.3085 22.3238 13.7427 22.5308 14.275C22.7122 14.7413 22.7122 15.2586 22.5308 15.7249C22.3238 16.2573 21.7448 16.6915 20.5868 17.56L14.8801 21.84C13.8474 22.6146 13.331 23.0019 12.7638 23.1512C12.2632 23.2829 11.737 23.2829 11.2364 23.1512C10.6693 23.0019 10.1529 22.6146 9.12014 21.84L3.41349 17.56C2.25552 16.6915 1.67654 16.2573 1.4695 15.7249C1.28816 15.2586 1.28816 14.7413 1.46951 14.275C1.67655 13.7427 2.25553 13.3085 3.41349 12.44L9.12015 8.16Z" fill="url(#layers-icon-gradient-0)" data-glass="origin" mask="url(#layers-icon-mask)"></path><path d="M9.12015 8.16C10.1529 7.38542 10.6693 6.99813 11.2364 6.84884C11.737 6.71706 12.2632 6.71705 12.7638 6.84883C13.331 6.99812 13.8474 7.38541 14.8801 8.15999L20.5868 12.44C21.7448 13.3085 22.3238 13.7427 22.5308 14.275C22.7122 14.7413 22.7122 15.2586 22.5308 15.7249C22.3238 16.2573 21.7448 16.6915 20.5868 17.56L14.8801 21.84C13.8474 22.6146 13.331 23.0019 12.7638 23.1512C12.2632 23.2829 11.737 23.2829 11.2364 23.1512C10.6693 23.0019 10.1529 22.6146 9.12014 21.84L3.41349 17.56C2.25552 16.6915 1.67654 16.2573 1.4695 15.7249C1.28816 15.2586 1.28816 14.7413 1.46951 14.275C1.67655 13.7427 2.25553 13.3085 3.41349 12.44L9.12015 8.16Z" fill="url(#layers-icon-gradient-0)" data-glass="clone" filter="url(#layers-icon-filter)" clip-path="url(#layers-icon-clip)"></path><path d="M9.12015 2.15999C10.1529 1.38542 10.6693 0.998128 11.2364 0.848835C11.737 0.717055 12.2632 0.717055 12.7638 0.848834C13.331 0.998124 13.8474 1.38541 14.8801 2.15999L20.5868 6.43998C21.7448 7.30845 22.3238 7.74269 22.5308 8.27503C22.7122 8.74132 22.7122 9.25864 22.5308 9.72492C22.3238 10.2573 21.7448 10.6915 20.5868 11.56L14.8801 15.84C13.8474 16.6146 13.331 17.0019 12.7638 17.1512C12.2632 17.2829 11.737 17.2829 11.2364 17.1512C10.6693 17.0019 10.1529 16.6146 9.12014 15.84L3.41349 11.56C2.25552 10.6915 1.67654 10.2573 1.4695 9.72492C1.28816 9.25864 1.28816 8.74132 1.46951 8.27504C1.67655 7.74269 2.25553 7.30846 3.41349 6.43998L9.12015 2.15999Z" fill="url(#layers-icon-gradient-1)" data-glass="blur"></path><path d="M11.237 0.848781C11.7375 0.717108 12.2639 0.717038 12.7644 0.848781C13.3314 0.998119 13.8479 1.38584 14.8806 2.1603L20.5866 6.44056C21.7446 7.30903 22.3239 7.74317 22.5309 8.27552C22.7121 8.74164 22.7121 9.25861 22.5309 9.72473C22.3239 10.2571 21.7446 10.6912 20.5866 11.5597L14.8806 15.8399L14.194 16.3507C13.5865 16.7934 13.1897 17.0395 12.7644 17.1515L12.5749 17.1944C12.1953 17.2685 11.805 17.2685 11.4255 17.1944L11.237 17.1515C10.8117 17.0395 10.4147 16.7933 9.80733 16.3507L9.12081 15.8399L3.4138 11.5597C2.25593 10.6913 1.67649 10.2571 1.46947 9.72473C1.31093 9.31688 1.29097 8.86987 1.4099 8.45227L1.46947 8.27552C1.62471 7.87635 1.98934 7.53197 2.65013 7.01868L3.4138 6.44056L9.12081 2.1603C10.0243 1.48266 10.5323 1.10089 11.0251 0.916164L11.237 0.848781ZM12.5729 1.57436C12.1975 1.47557 11.8029 1.47554 11.4274 1.57436C11.0366 1.67728 10.6561 1.94538 9.57003 2.75991L3.86399 7.04017C3.27389 7.48274 2.87129 7.78513 2.58665 8.04114C2.30554 8.29399 2.20972 8.44147 2.16868 8.547C2.05534 8.83843 2.05534 9.16182 2.16868 9.45325C2.20973 9.55878 2.30557 9.70629 2.58665 9.95911C2.87129 10.2151 3.27391 10.5175 3.86399 10.9601L9.57003 15.2403C10.6561 16.0549 11.0366 16.323 11.4274 16.4259C11.8029 16.5247 12.1975 16.5247 12.5729 16.4259C12.9638 16.323 13.3443 16.0549 14.4304 15.2403L20.1374 10.9601C20.7272 10.5177 21.1292 10.215 21.4137 9.95911C21.6947 9.70637 21.7906 9.55877 21.8317 9.45325C21.945 9.16182 21.945 8.83843 21.8317 8.547C21.7906 8.44148 21.6948 8.2939 21.4137 8.04114C21.1292 7.7852 20.7272 7.48254 20.1374 7.04017L14.4304 2.75991C13.3443 1.94534 12.9638 1.67725 12.5729 1.57436Z" fill="url(#layers-icon-gradient-2)"></path><defs><linearGradient id="layers-icon-gradient-0" x1="12" y1="6.75" x2="12" y2="23.25" gradientUnits="userSpaceOnUse"><stop stop-color="#575757"></stop><stop offset="1" stop-color="#151515"></stop></linearGradient><linearGradient id="layers-icon-gradient-1" x1="12" y1=".75" x2="12" y2="17.25" gradientUnits="userSpaceOnUse"><stop stop-color="#E3E3E5" stop-opacity=".6"></stop><stop offset="1" stop-color="#BBBBC0" stop-opacity=".6"></stop></linearGradient><linearGradient id="layers-icon-gradient-2" x1="12" y1=".75" x2="12" y2="10.305" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"></stop><stop offset="1" stop-color="#fff" stop-opacity="0"></stop></linearGradient><filter id="layers-icon-filter" x="-100%" y="-100%" width="400%" height="400%" filterUnits="objectBoundingBox" primitiveUnits="userSpaceOnUse"><feGaussianBlur stdDeviation="2" x="0%" y="0%" width="100%" height="100%" in="SourceGraphic" edgeMode="none" result="blur"></feGaussianBlur></filter><clipPath id="layers-icon-clip"><path d="M9.12015 2.15999C10.1529 1.38542 10.6693 0.998128 11.2364 0.848835C11.737 0.717055 12.2632 0.717055 12.7638 0.848834C13.331 0.998124 13.8474 1.38541 14.8801 2.15999L20.5868 6.43998C21.7448 7.30845 22.3238 7.74269 22.5308 8.27503C22.7122 8.74132 22.7122 9.25864 22.5308 9.72492C22.3238 10.2573 21.7448 10.6915 20.5868 11.56L14.8801 15.84C13.8474 16.6146 13.331 17.0019 12.7638 17.1512C12.2632 17.2829 11.737 17.2829 11.2364 17.1512C10.6693 17.0019 10.1529 16.6146 9.12014 15.84L3.41349 11.56C2.25552 10.6915 1.67654 10.2573 1.4695 9.72492C1.28816 9.25864 1.28816 8.74132 1.46951 8.27504C1.67655 7.74269 2.25553 7.30846 3.41349 6.43998L9.12015 2.15999Z" fill="url(#layers-icon-gradient-1)"></path></clipPath><mask id="layers-icon-mask"><rect width="100%" height="100%" fill="#FFF"></rect><path d="M9.12015 2.15999C10.1529 1.38542 10.6693 0.998128 11.2364 0.848835C11.737 0.717055 12.2632 0.717055 12.7638 0.848834C13.331 0.998124 13.8474 1.38541 14.8801 2.15999L20.5868 6.43998C21.7448 7.30845 22.3238 7.74269 22.5308 8.27503C22.7122 8.74132 22.7122 9.25864 22.5308 9.72492C22.3238 10.2573 21.7448 10.6915 20.5868 11.56L14.8801 15.84C13.8474 16.6146 13.331 17.0019 12.7638 17.1512C12.2632 17.2829 11.737 17.2829 11.2364 17.1512C10.6693 17.0019 10.1529 16.6146 9.12014 15.84L3.41349 11.56C2.25552 10.6915 1.67654 10.2573 1.4695 9.72492C1.28816 9.25864 1.28816 8.74132 1.46951 8.27504C1.67655 7.74269 2.25553 7.30846 3.41349 6.43998L9.12015 2.15999Z" fill="#000"></path></mask></defs></g>',2)])],8,AW))}}),VW={class:"lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-mx-auto pbx-flex pbx-flex-col pbx-font-sans pbx-text-black pbx-border-solid pbx-border pbx-border-gray-400 pbx-inset-x-0 pbx-z-10 pbx-bg-white pbx-overflow-x-auto pbx-h-full"},zW={id:"pagebuilder-navbar",class:"lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[64rem] pbx-max-w-[64rem] pbx-w-[64rem] pbx-flex-1 pbx-bg-myPrimaryLightGrayColor pbx-flex pbx-items-center pbx-justify-between pbx-border-0 pbx-border-solid pbx-border-b pbx-border-gray-200 pbx-mb-2 pbx-font-sans pbx-min-h-20"},IW=["src"],OW={class:"pbx-flex pbx-items-center pbx-justify-center"},_W=["disabled"],HW={key:0,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},RW={key:1,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},jW=["disabled"],FW={key:0,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},qW={key:1,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},UW={class:"lg:pbx-block pbx-hidden"},WW={class:"lg:pbx-hidden pbx-block"},GW={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2 pbx-border-gray-200"},KW={class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},JW={class:"pbx-cursor-pointer lg:pbx-block lg:pbx-pr-4 pbx-hidden"},YW={class:"pbx-flex pbx-items-center pbx-justify-center pbx-mr-2"},XW={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2"},QW={class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},ZW={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},$W={class:"lg:pbx-flex pbx-hidden pbx-items-center pbx-justify-center"},eG={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2"},tG={class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},rG={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},oG={class:"pbx-flex-1 pbx-flex gap-2 pbx-items-center pbx-justify-end"},iG={key:0,class:"pbx-flex-1 pbx-ml-2"},nG={key:0,class:"pbx-flex-1 pbx-flex pbx-justify-end pbx-items-center pbx-ml-2 lg:pbx-mr-4 pbx-mr-2"},aG=["value"],lG=["value"],sG={key:2,class:"pbx-flex-1 pbx-ml-2 pbx-mr-2"},pG={id:"pagebuilder-main",class:"lg:pbx-min-w-full lg:pbx-max-w-full lg:pbx-w-full pbx-min-w-[64rem] pbx-max-w-[64rem] pbx-w-[64rem] pbx-flex-1 pbx-relative pbx-h-full pbx-flex pbx-pb-2 pbx-gap-2"},dG={class:"pbx-mx-2 pbx-flex pbx-flex-col pbx-myPrimaryGap pbx-items-stretch"},cG={id:"pbxEditToolbar",class:"pbx-z-30 pbx-flex pbx-gap-2 pbx-justify-center pbx-items-center pbx-rounded-sm pbx-px-2 pbx-h-0 pbx-min-w-52 pbx-relative"},mG={key:0,id:"nolocalstorage"},bG={class:"pbx-flex pbx-justify-center pbx-w-full pbx-absolute pbx-items-center"},xG={class:"pbx-flex pbx-items-center pbx-gap-2"},gG={class:"pbx-font-medium pbx-break-words lg:pbx-text-lg md:pbx-text-lg pbx-text-base pbx-font-sans"},uG={key:1,id:"nolocalstorage"},hG={class:"pbx-flex pbx-justify-end pbx-w-full pbx-h-0 pbx-items-center pbx-rounded-r-full pbx-z-10"},fG={class:"pbx-flex pbx-items-center pbx-gap-1"},yG={class:"lg:pbx-block pbx-hidden"},wG=["innerHTML","onMouseup"],vG={key:1,id:"nolocalstorage"},kG={class:"pbx-flex pbx-justify-end pbx-w-full pbx-h-0 pbx-items-center pbx-rounded-r-full pbx-z-10"},SG=["onClick"],CG={class:"pbx-flex pbx-items-center pbx-gap-1"},EG={class:"lg:pbx-block pbx-hidden"},TG={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},MG={class:"pbx-flex pbx-justify-end pbx-min-h-6"},NG={key:0,class:"pbx-myPrimaryParagraphError"},PG={class:"pbx-border-0 pbx-border-solid pbx-border-t pbx-border-gray-200 pbx-flex pbx-items-center pbx-justify-end"},LG={class:"pbx-py-4 pbx-flex sm:pbx-justify-end pbx-justify-center"},BG={class:"sm:pbx-grid-cols-2 sm:pbx-items-end sm:pbx-justify-end pbx-flex pbx-flex-row pbx-myPrimaryGap pbx-w-full"},AG={key:1,class:"pbx-flex pbx-items-center pbx-my-2 pbx-justify-end"},DG={class:"pbx-flex pbx-justify-end pbx-min-h-6"},VG={key:0,class:"pbx-myPrimaryParagraphError"},zG={class:"pbx-border-0 pbx-border-solid pbx-border-t pbx-border-gray-200 pbx-flex pbx-items-center pbx-justify-end"},IG={class:"pbx-py-4 pbx-flex sm:pbx-justify-end pbx-justify-center"},OG={class:"sm:pbx-grid-cols-2 sm:pbx-items-end sm:pbx-justify-end pbx-flex pbx-flex-row pbx-myPrimaryGap pbx-w-full"},_G={key:1,class:"pbx-flex pbx-items-center pbx-my-2 pbx-justify-end"},HG=i.defineComponent({__name:"PageBuilder",props:{CustomMediaLibraryComponent:{type:Object,default:null},CustomBuilderComponents:{type:Object,default:null},showCloseButton:{type:Boolean,default:!1},showPublishButton:{type:Boolean,default:!1}},emits:["handleClosePageBuilder","handlePublishPageBuilder"],setup(r,{emit:e}){const t=ce(),o=r,{translate:n,loadTranslations:a}=re(),l=cl,s=oe;i.provide("pageBuilderStateStore",s),i.provide("internalPinia",l),i.provide("CustomMediaComponent",o.CustomMediaLibraryComponent),i.provide("CustomBuilderComponents",o.CustomBuilderComponents);const p=e,d=i.ref(1),c=i.ref(""),m=i.ref(!1),b=i.ref(""),x=i.ref(""),g=i.ref(""),u=i.ref(null),h=i.ref(null),f=i.ref(null),w=i.ref(null),y=i.ref(null),S=async function(){c.value="warning",m.value=!0,b.value=n("Continue Your Work?"),x.value=n("Are you sure you want to close the Page Builder? All unsaved changes will be lost."),g.value=null,u.value=n("Close Page Builder"),h.value=null,f.value=async function(){m.value=!1},w.value=function(){E()},y.value=async function(){}},E=function(){m.value=!1,p("handleClosePageBuilder")},P=async function(){s.setIsLoadingGlobal(!0),await t.handleManualSave(),s.setIsLoadingGlobal(!1),p("handlePublishPageBuilder")},k=()=>{tt.value=!1};i.provide("closeAddComponentModal",k);const N=i.ref("en");let C=!0;const A=i.ref(!1);i.watch(N,async R=>{if(R&&!C){A.value=!0,await se(200),await a(R),t.changeLanguage(R);const L=JSON.parse(localStorage.getItem("userSettingsPageBuilder")??"{}")||{};L.lang=R,localStorage.setItem("userSettingsPageBuilder",JSON.stringify(L)),A.value=!1}});const T=i.computed(()=>s.getBuilderStarted),v=i.computed(()=>s.getPageBuilderConfig),D=i.computed(()=>{var L,Bt;const R=(Bt=(L=v.value)==null?void 0:L.userSettings)==null?void 0:Bt.fontFamily;return R?R.startsWith("pbx-font-")?R:`pbx-font-${R}`:"pbx-font-sans"}),B=i.computed(()=>s.getCurrentLanguage);i.watch(B,R=>{R&&R!==N.value&&(N.value=R)});const V=i.computed(()=>s.getMenuRight),Be=i.ref(!1),Mo=i.ref(""),xe=i.ref(""),ve=function(){t.previewCurrentDesign()},No=function(){Mo.value=n("Preview"),ve(),Be.value=!0},gr=i.ref(!1),Po=function(){t.previewCurrentDesign()},Lo=function(){xe.value=n("Mobile"),Po(),gr.value=!0},Kt=i.ref(!1),Bo=function(){Kt.value=!1},Nt=function(){Be.value=!1},Jt=function(){gr.value=!1},tt=i.ref(!1),Oi=i.ref(""),_i=i.ref(""),ur=i.ref(null),Hi=async function(){await t.clearHtmlSelection(),Oi.value=n("Add Components to Page"),_i.value=n("Close"),tt.value=!0,ur.value=function(){tt.value=!1}},Ao=function(R){s.setAddComponentAddIndex(R),s.setComponentArrayAddMethod("insert"),Hi()},Xe=i.computed(()=>s.getElement),Pt=i.computed(()=>s.getComponents),Cp=i.computed(()=>s.getHasLocalDraftForUpdate),hr=i.computed(()=>s.getToggleGlobalHtmlMode);i.watch(Cp,R=>{R&&ji()});const Ep=i.computed(()=>!Xe.value||!(Xe.value instanceof HTMLElement)?null:{src:Xe.value.getAttribute("src"),href:Xe.value.getAttribute("href"),style:Xe.value.getAttribute("style"),class:Xe.value.getAttribute("class"),dataImage:Xe.value.getAttribute("data-image")}),Jr=pW();i.watch(Ep,async(R,L)=>{((R==null?void 0:R.src)!==(L==null?void 0:L.src)||(R==null?void 0:R.href)!==(L==null?void 0:L.href)||(R==null?void 0:R.style)!==(L==null?void 0:L.style)||(R==null?void 0:R.class)!==(L==null?void 0:L.class)||(R==null?void 0:R.dataImage)!==(L==null?void 0:L.dataImage))&&Jr(async()=>{await t.initializeElementStyles()},200)});const Yt=function(R){s.setComponent(R)},Do=i.computed(()=>s.getIsLoadingGlobal),Ri=i.computed(()=>s.getIsSaving),Tp=i.computed(()=>s.getIsLoadingResumeEditing),bt=i.computed(()=>s.getIsRestoring),Mp=i.ref(1),Wa=i.ref(""),xt=i.ref(!1),Vo=i.ref(""),zo=i.ref(""),Yr=i.ref(""),Xr=i.ref(null),Io=i.ref(null),fr=i.ref(null),yr=i.ref(null),Lt=i.ref(null),ji=async function(){Wa.value="warning",xt.value=!0,Vo.value=n("Continue Your Work?"),zo.value=n("We noticed you have some changes that weren’t saved last time. Would you like to pick up where you left off, or use the version that’s currently loaded from the database?"),Yr.value=n("Use Saved Version"),Xr.value=null,Io.value=n("Continue Where I Left Off"),fr.value=async function(){s.setHasLocalDraftForUpdate(!1),xt.value=!1},yr.value=function(){},Lt.value=async function(){await t.resumeEditingFromDraft(),s.setHasLocalDraftForUpdate(!1),xt.value=!1}},Qr=i.ref(1),Ga=i.ref(""),Oo=i.ref(!1),Ka=i.ref(""),_o=i.ref(""),_=i.ref(""),M=i.ref(null),O=i.ref(null),K=i.ref(null),ee=i.ref(null),ie=i.ref(null),Qe=async function(){await t.clearHtmlSelection(),Ga.value="success",Oo.value=!0,Ka.value=n("Do you want to reset this page?"),_o.value=n("Are you sure you want to reset this page? This will overwrite your current changes."),_.value=n("Close"),M.value=null,O.value=n("Reset changes"),K.value=function(){Oo.value=!1},ee.value=async function(){},ie.value=async function(){await t.restoreOriginalContent(),Oo.value=!1}},Ze=i.computed(()=>s.getShowModalHTMLEditor),Ue=i.computed(()=>!Xe.value||!(Xe.value instanceof HTMLElement)?"":Xe.value.outerHTML),yt=i.ref(""),wt=i.ref("");i.watch(Ze,async R=>{if(R){if(!hr.value){yt.value=Ue.value;return}wt.value=await t.generateFullPageHtml()}});const ge=()=>{s.setShowModalHTMLEditor(!1)},$=i.ref(!1),q=i.ref(null),Xt=i.ref(!1),rt=i.ref(!1),ot=i.ref(!1),Qt=async()=>{Xt.value=!0,rt.value=!0,Lp(),await se(200),s.setToggleGlobalHtmlMode(!0),await t.globalPageStyles(),Lp(),rt.value=!1},Zr=async()=>{rt.value=!0,await se(200),await t.handleManualSave(),t.stopGlobalStylesSync();const R=document.querySelector("[data-pagebuilder-content]");R&&R.removeAttribute("data-global-selected"),Xt.value=!1,rt.value=!1},Fi=()=>{if(ot.value){xT();return}t.setImageSettingsModalOpen(!0),ot.value=!0},xT=()=>{ot.value=!1,t.setImageSettingsModalOpen(!1)},WG=async()=>{q.value=null,$.value=!0,await se(300);const R=await t.applyModifiedHTML(yt.value);if(R){q.value=R,$.value=!1;return}s.setShowModalHTMLEditor(!1),$.value=!1},GG=async()=>{q.value=null,$.value=!0,q.value=null,await se(300);const R=await t.applyModifiedComponents(wt.value);if(R){q.value=R,$.value=!1;return}s.setShowModalHTMLEditor(!1),$.value=!1},Np=function(){T.value||(Kt.value=!0)},Pp=i.ref(null),Lp=function(){const R=document.querySelector("#pbxEditToolbar");R&&(R.classList.remove("is-visible"),R.removeAttribute("style"))};function Ja(){const R=Pp.value,L=R&&R.querySelector("#pbxEditToolbar");if(!R||!L)return;const Bt=R.querySelector("[selected]");if(Bt&&typeof Bt.getBoundingClientRect=="function"){const wr=(Bt.closest("[data-pb-no-select]")||Bt).getBoundingClientRect(),Ui=R.getBoundingClientRect();let Ho=wr.left-Ui.left+wr.width/2-L.offsetWidth/2;const gT=20;Ho=Math.max(gT,Math.min(Ho,R.offsetWidth-L.offsetWidth-gT));const KG=wr.top-Ui.top+R.scrollTop-L.offsetHeight-20,JG=Math.max(0,KG);L.style.position="absolute",L.style.left=`${Ho}px`,L.style.top=`${JG}px`,L.classList.add("is-visible")}else L.classList.remove("is-visible"),L.removeAttribute("style")}const Bp=JSON.parse(localStorage.getItem("userSettingsPageBuilder")??"null");return i.onMounted(async()=>{await t.completeBuilderInitialization(void 0),Bp&&Bp.lang&&(N.value=Bp.lang),await a(N.value),C=!1,Ja();const R=Pp.value;if(!R)return;new MutationObserver(Ja).observe(R,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["selected"]}),window.addEventListener("scroll",Ja),window.addEventListener("resize",Ja),await se(1e4),Np(),await se(1e4),Np(),await se(1e4),Np()}),(R,L)=>{var Bt;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",VW,[Do.value&&!Kt.value||A.value?(i.openBlock(),i.createBlock(dT,{key:0})):i.createCommentVNode("",!0),i.createVNode($e,{title:"The builder hasn’t started yet",showModalBuilder:Kt.value,onCloseMainModalBuilder:Bo,type:"delete",maxWidth:"2xl",noBackgroundOpacity:!0},{default:i.withCtx(()=>[...L[33]||(L[33]=[i.createTextVNode(" The builder hasn’t started yet. If this screen doesn’t go away soon, it may just need a little setup in the background. You can safely contact support and ask them to initialize the builder by running the startBuilder method for this resource. ",-1)])]),_:1},8,["showModalBuilder"]),tt.value?(i.openBlock(),i.createBlock(NH,{key:1,show:tt.value,firstButtonText:_i.value,title:Oi.value,CustomBuilderComponents:o.CustomBuilderComponents,onFirstModalButtonSearchComponentsFunction:L[0]||(L[0]=()=>{var U;return(U=ur.value)==null?void 0:U.call(ur)})},null,8,["show","firstButtonText","title","CustomBuilderComponents"])):i.createCommentVNode("",!0),i.createVNode(gt,{showDynamicModalBuilder:m.value,isLoading:!1,type:c.value,gridColumnAmount:d.value,title:b.value,description:x.value,firstButtonText:g.value??void 0,secondButtonText:u.value??void 0,thirdButtonText:h.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:L[1]||(L[1]=()=>{var U;return(U=f.value)==null?void 0:U.call(f)}),onSecondModalButtonFunctionDynamicModalBuilder:L[2]||(L[2]=()=>{var U;return(U=w.value)==null?void 0:U.call(w)}),onThirdModalButtonFunctionDynamicModalBuilder:L[3]||(L[3]=()=>{var U;return(U=y.value)==null?void 0:U.call(y)})},{default:i.withCtx(()=>[...L[34]||(L[34]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode($e,{title:Mo.value,showModalBuilder:Be.value,onCloseMainModalBuilder:Nt,maxWidth:"screen"},{default:i.withCtx(()=>[i.createVNode(tl)]),_:1},8,["title","showModalBuilder"]),i.createVNode($e,{title:xe.value,showModalBuilder:gr.value,onCloseMainModalBuilder:Jt,maxWidth:"lg"},{default:i.withCtx(()=>[i.createVNode(tl,{mobile:!0})]),_:1},8,["title","showModalBuilder"]),i.createVNode(gt,{showDynamicModalBuilder:xt.value,isLoading:Tp.value,type:Wa.value,gridColumnAmount:Mp.value,title:Vo.value,description:zo.value,firstButtonText:Yr.value,secondButtonText:Xr.value??void 0,thirdButtonText:Io.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:L[4]||(L[4]=()=>{var U;return(U=fr.value)==null?void 0:U.call(fr)}),onSecondModalButtonFunctionDynamicModalBuilder:L[5]||(L[5]=()=>{var U;return(U=yr.value)==null?void 0:U.call(yr)}),onThirdModalButtonFunctionDynamicModalBuilder:L[6]||(L[6]=()=>{var U;return(U=Lt.value)==null?void 0:U.call(Lt)})},{default:i.withCtx(()=>[...L[35]||(L[35]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","isLoading","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createVNode(gt,{showDynamicModalBuilder:Oo.value,isLoading:bt.value,type:Ga.value,gridColumnAmount:Qr.value,title:Ka.value,description:_o.value,firstButtonText:_.value,secondButtonText:M.value??void 0,thirdButtonText:O.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:L[7]||(L[7]=()=>{var U;return(U=K.value)==null?void 0:U.call(K)}),onSecondModalButtonFunctionDynamicModalBuilder:L[8]||(L[8]=()=>{var U;return(U=ee.value)==null?void 0:U.call(ee)}),onThirdModalButtonFunctionDynamicModalBuilder:L[9]||(L[9]=()=>{var U;return(U=ie.value)==null?void 0:U.call(ie)})},{default:i.withCtx(()=>[...L[36]||(L[36]=[i.createElementVNode("header",null,null,-1),i.createElementVNode("main",null,null,-1)])]),_:1},8,["showDynamicModalBuilder","isLoading","type","gridColumnAmount","title","description","firstButtonText","secondButtonText","thirdButtonText"]),i.createElementVNode("div",zW,[v.value&&v.value.pageBuilderLogo&&v.value.pageBuilderLogo.src?(i.openBlock(),i.createElementBlock("div",{key:0,onClick:L[10]||(L[10]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-flex pbx-justify-start pbx-py-2 lg:pbx-ml-4 pbx-ml-2"},[i.createElementVNode("img",{class:"pbx-h-6",src:v.value.pageBuilderLogo.src,alt:"Logo"},null,8,IW)])):i.createCommentVNode("",!0),i.createVNode(BW,{onToolbarHideRequest:Lp}),i.createElementVNode("div",{onClick:L[13]||(L[13]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-flex-1 pbx-flex pbx-justify-center pbx-items-center pbx-py-2 pbx-w-full"},[i.createElementVNode("div",OW,[i.createElementVNode("button",{class:"pbx-mySecondaryButton pbx-h-6 pbx-flex pbx-gap-2 pbx-mr-2",onClick:L[11]||(L[11]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection(),await i.unref(t).handleManualSave()},["stop"])),type:"button",disabled:Ri.value},[Ri.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",HW,[...L[37]||(L[37]=[i.createElementVNode("span",{class:"material-symbols-outlined"},"save",-1)])])),Ri.value?(i.openBlock(),i.createElementBlock("div",RW,[...L[38]||(L[38]=[i.createElementVNode("span",{class:"pbx-relative pbx-flex pbx-size-3"},[i.createElementVNode("span",{class:"pbx-absolute pbx-inline-flex pbx-h-full pbx-w-full pbx-animate-ping pbx-rounded-full pbx-bg-gray-400 pbx-opacity-75"}),i.createElementVNode("span",{class:"pbx-relative pbx-inline-flex pbx-size-3 pbx-rounded-full pbx-bg-green-200"})],-1)])])):i.createCommentVNode("",!0),i.createElementVNode("div",null,i.toDisplayString(i.unref(n)("Save")),1)],8,_W),v.value&&v.value.updateOrCreate&&v.value.updateOrCreate.formType==="update"?(i.openBlock(),i.createElementBlock("button",{key:0,class:"pbx-mySecondaryButton pbx-h-6 pbx-flex pbx-gap-2 lg:pbx-mr-2 pbx-mr-2",onClick:L[12]||(L[12]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection(),await Qe()},["stop"])),type:"button",disabled:bt.value},[bt.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",FW,[...L[39]||(L[39]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," settings_backup_restore ",-1)])])),bt.value?(i.openBlock(),i.createElementBlock("div",qW,[...L[40]||(L[40]=[i.createElementVNode("span",{class:"pbx-relative pbx-flex pbx-size-3"},[i.createElementVNode("span",{class:"pbx-absolute pbx-inline-flex pbx-h-full pbx-w-full pbx-animate-ping pbx-rounded-full pbx-bg-gray-400 pbx-opacity-75"}),i.createElementVNode("span",{class:"pbx-relative pbx-inline-flex pbx-size-3 pbx-rounded-full pbx-bg-green-200"})],-1)])])):i.createCommentVNode("",!0),i.createElementVNode("div",UW,[i.createElementVNode("span",null,i.toDisplayString(i.unref(n)("Reset Page")),1)]),i.createElementVNode("div",WW,[i.createElementVNode("span",null,i.toDisplayString(i.unref(n)("Reset")),1)])],8,jW)):i.createCommentVNode("",!0)])]),i.createElementVNode("div",{onClick:L[18]||(L[18]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-flex-1 pbx-flex pbx-justify-center pbx-items-center pbx-py-2 pbx-w-full"},[i.createElementVNode("div",{onClick:L[17]||(L[17]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-flex pbx-items-center pbx-justify-center"},[i.createElementVNode("div",{class:"pbx-mr-2",onClick:L[14]||(L[14]=()=>{i.unref(s).setComponentArrayAddMethod("unshift"),Hi()})},[i.createElementVNode("div",GW,[i.createElementVNode("span",KW,[i.createVNode(DW)]),i.createElementVNode("span",JW,i.toDisplayString(i.unref(n)("Add")),1)])]),i.createElementVNode("div",YW,[i.createElementVNode("div",{onClick:L[15]||(L[15]=async()=>{i.unref(s).setMenuRight(!1),i.unref(s).setElement(null),await i.unref(t).clearHtmlSelection(),No()})},[i.createElementVNode("div",XW,[i.createElementVNode("span",QW,[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",ZW,[...L[41]||(L[41]=[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M2 3h18v13h-8v2h3v2H7v-2h3v-2H2V3zm2 2v9h14V5H4z","fill-rule":"evenodd"},null,-1)])]))])])])])]),i.createElementVNode("div",$W,[i.createElementVNode("div",{onClick:L[16]||(L[16]=async()=>{i.unref(s).setMenuRight(!1),i.unref(s).setElement(null),await i.unref(t).clearHtmlSelection(),Lo()})},[i.createElementVNode("div",eG,[i.createElementVNode("span",tG,[(i.openBlock(),i.createElementBlock("svg",rG,[...L[42]||(L[42]=[i.createElementVNode("path",{d:"M14 16H8v2h6v-2z"},null,-1),i.createElementVNode("path",{d:"M14 1H8a3 3 0 00-3 3v14a3 3 0 003 3h6a3 3 0 003-3V4a3 3 0 00-3-3zM7 4a1 1 0 011-1h6a1 1 0 011 1v14a1 1 0 01-1 1H8a1 1 0 01-1-1V4z"},null,-1)])]))])])])])])]),i.createElementVNode("div",oG,[i.createElementVNode("div",{onClick:L[19]||(L[19]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:i.normalizeClass(["pbx-flex pbx-items-center pbx-py-2 pbx-w-full",[r.showCloseButton?"pbx-justify-between":"pbx-justify-end"]])},[i.createVNode(sW)],2),r.showPublishButton?(i.openBlock(),i.createElementBlock("div",iG,[i.createElementVNode("button",{class:"pbx-myPrimaryButton",onClick:L[20]||(L[20]=async()=>{P()})},i.toDisplayString(i.unref(n)("Publish")),1)])):i.createCommentVNode("",!0),i.unref(t)&&v.value&&v.value.userSettings&&v.value.userSettings.language&&!((Bt=v.value.userSettings.language)!=null&&Bt.disableLanguageDropDown)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[v.value&&v.value.userSettings&&v.value.userSettings.language?(i.openBlock(),i.createElementBlock("div",nG,[i.withDirectives(i.createElementVNode("select",{id:"pbx-lang",class:"pbx-myPrimarySelect pbx-min-w-20","onUpdate:modelValue":L[21]||(L[21]=U=>N.value=U)},[Array.isArray(v.value.userSettings.language.enable)&&v.value.userSettings.language.enable.length>=1?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(i.unref(t).availableLanguage().filter(U=>{var qi,wr,Ui,Ho;return((Ho=(Ui=(wr=(qi=v.value)==null?void 0:qi.userSettings)==null?void 0:wr.language)==null?void 0:Ui.enable)==null?void 0:Ho.includes(U))??!1}),U=>(i.openBlock(),i.createElementBlock("option",{key:U,value:U},i.toDisplayString(U),9,aG))),128)):i.createCommentVNode("",!0),!v.value.userSettings.language.enable||Array.isArray(v.value.userSettings.language.enable)&&v.value.userSettings.language.enable.length===0?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(i.unref(t).availableLanguage(),U=>(i.openBlock(),i.createElementBlock("option",{key:U,value:U},i.toDisplayString(U),9,lG))),128)):i.createCommentVNode("",!0)],512),[[i.vModelSelect,N.value]])])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),r.showCloseButton?(i.openBlock(),i.createElementBlock("div",sG,[i.createElementVNode("button",{class:"pbx-h-10 pbx-w-10 pbx-flex-end pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor hover:pbx-text-white hover:pbx-fill-white focus-visible:pbx-ring-0",onClick:L[22]||(L[22]=async()=>{S(),await i.unref(t).clearHtmlSelection()})},[...L[43]||(L[43]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," close ",-1)])])])):i.createCommentVNode("",!0)])]),i.createElementVNode("div",pG,[i.createElementVNode("div",{onClick:L[24]||(L[24]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),id:"pagebuilder-left-menu",class:"pbx-w-16 pbx-pt-7 pbx-pb-2 pbx-bg-myPrimaryLightGrayColor pbx-rounded-r-2xl pbx-shadow-sm"},[i.createElementVNode("div",dG,[i.createElementVNode("div",{onClick:L[23]||(L[23]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"]))},[i.createVNode(AN)])])]),i.createElementVNode("main",{ref_key:"pbxBuilderWrapper",ref:Pp,id:"page-builder-wrapper",class:i.normalizeClass(["pbx-transition-all pbx-duration-300 pbx-font-sans pbx-p-1 pbx-flex pbx-flex-col pbx-grow pbx-rounded-tr-2xl pbx-rounded-tl-2xl pbx-border-solid pbx-border pbx-border-gray-200 pbx-items-stretch pbx-text-black pbx-h-[100vh] pbx-overflow-y-scroll pbx-relative pbx-pt-16",[(V.value,"pbx-w-full")]])},[i.createElementVNode("div",cG,[Xe.value?(i.openBlock(),i.createBlock(M_,{key:0,onOpenGlobalPageSettings:Qt,onOpenImageSettings:Fi})):i.createCommentVNode("",!0)]),i.createElementVNode("div",{id:"pagebuilder","data-builder-canvas":"",class:i.normalizeClass([D.value,"pbx-text-black"])},[Array.isArray(Pt.value)&&Pt.value.length===0?(i.openBlock(),i.createElementBlock("div",mG,[i.createElementVNode("div",bG,[i.createElementVNode("div",{onClick:L[25]||(L[25]=U=>Ao(0)),class:"pbx-py-4 pbx-px-4 pbx-my-4 pbx-rounded-full pbx-bg-gray-100 pbx-text-gray-600 pbx-flex pbx-items-center pbx-justify-center hover:pbx-text-white hover:pbx-bg-gray-900 pbx-cursor-pointer"},[i.createElementVNode("div",xG,[i.createElementVNode("span",gG,i.toDisplayString(i.unref(n)("Add new Components")),1)])])])])):i.createCommentVNode("",!0),Array.isArray(Pt.value)&&Pt.value.length!=0?(i.openBlock(),i.createElementBlock("div",uG,[i.createElementVNode("div",hG,[i.createElementVNode("div",{onClick:L[26]||(L[26]=U=>Ao(0)),id:"addsection",class:"pbx-font-sans pbx-h-10 pbx-rounded-l-full pbx-bg-gray-100 pbx-text-gray-600 pbx-z-50 pbx-pl-2 pbx-pr-2 pbx-flex pbx-items-center pbx-justify-center hover:pbx-text-white hover:pbx-bg-gray-900 pbx-cursor-pointer"},[i.createElementVNode("div",fG,[L[44]||(L[44]=i.createElementVNode("span",{class:"material-symbols-outlined"}," add ",-1)),i.createElementVNode("span",yG,i.toDisplayString(i.unref(n)("Add")),1)])])])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(Pt.value,(U,qi)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:U.id},[U.html_code?(i.openBlock(),i.createElementBlock("div",{key:0,"data-pagebuilder-content":"",innerHTML:U.html_code,onMouseup:wr=>Yt(U)},null,40,wG)):i.createCommentVNode("",!0),Array.isArray(Pt.value)&&Pt.value.length!=0?(i.openBlock(),i.createElementBlock("div",vG,[i.createElementVNode("div",kG,[i.createElementVNode("div",{onClick:wr=>Ao(qi+1),id:"addsection",class:"pbx-font-sans pbx-h-10 pbx-rounded-l-full pbx-bg-gray-100 pbx-text-gray-600 pbx-z-50 pbx-pl-2 pbx-pr-2 pbx-flex pbx-items-center pbx-justify-center hover:pbx-text-white hover:pbx-bg-gray-900 pbx-cursor-pointer"},[i.createElementVNode("div",CG,[L[45]||(L[45]=i.createElementVNode("span",{class:"material-symbols-outlined"}," add ",-1)),i.createElementVNode("span",EG,i.toDisplayString(i.unref(n)("Add")),1)])],8,SG)])])):i.createCommentVNode("",!0)],64))),128))],2)],2),i.createVNode(i.Transition,{name:"slide-right",appear:"",mode:"out-in"},{default:i.withCtx(()=>[V.value?(i.openBlock(),i.createElementBlock("aside",{key:0,"aria-label":"menu",id:"pagebuilder-right-menu",class:i.normalizeClass(["pbx-z-20 pbx-flex-shrink-0 pbx-overflow-hidden pbx-border-0 pbx-border-solid pbx-border-l-0 pbx-border-l-gray-600 pbx-rounded-l-2xl pbx-h-[100vh]",[V.value?"pbx-w-96 pbx-bg-myPrimaryLightGrayColor pbx-items-stretch":"bpx-w-0 pbx-mr-0"]])},[i.createVNode(eW,{onCloseEditor:L[27]||(L[27]=U=>i.unref(s).setMenuRight(!1))})],2)):(i.openBlock(),i.createElementBlock("div",{key:1,onClick:L[30]||(L[30]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-w-18 pbx-bg-myPrimaryLightGrayColor pbx-pt-5 pbx-z-20 pbx-flex-shrink-0 pbx-overflow-hidden pbx-border-0 pbx-border-solid pbx-border-l-0 pbx-border-l-gray-600 pbx-rounded-l-2xl pbx-h-[100vh] pbx-pl-2 pbx-pr-2"},[i.createElementVNode("div",{onClick:L[29]||(L[29]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"])),class:"pbx-flex pbx-flex-col pbx-items-center pbx-justify-center pbx-gap-2"},[V.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("button",{key:0,onClick:L[28]||(L[28]=U=>i.unref(s).setMenuRight(!0)),type:"button",class:"pbx-h-10 pbx-w-10 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-border-none pbx-justify-center pbx-bg-gray-50 pbx-aspect-square hover:pbx-bg-myPrimaryLinkColor focus-visible:pbx-ring-0 pbx-text-black hover:pbx-text-white"},[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",TG,[...L[46]||(L[46]=[i.createElementVNode("g",{"clip-path":"url(#prefix__clip0_1645_485)"},[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M19.871 1.81a2.768 2.768 0 00-3.914 0l-3.543 3.544-2.5-2.5L0 12.768l8.914 8.914 9.914-9.914-2.5-2.5 3.543-3.543a2.768 2.768 0 000-3.914zm-2.5 1.415a.768.768 0 011.086 1.086L13.5 9.268l2.5 2.5-1.086 1.086-6.086-6.086 1.086-1.086 2.5 2.5 4.957-4.957zM7.414 8.182l-4.586 4.586 1.086 1.086 3.293-3.293 1.414 1.414-3.293 3.293 1.086 1.086 3.293-3.293 1.414 1.414-3.293 3.293 1.086 1.086 4.586-4.586-6.086-6.086z","fill-rule":"evenodd"})],-1),i.createElementVNode("defs",null,[i.createElementVNode("clipPath",{id:"prefix__clip0_1645_485"},[i.createElementVNode("path",{d:"M0 0h22v22H0z",fill:"#fff"})])],-1)])]))])]))])]))]),_:1})])]),i.createVNode($e,{maxWidth:"5xl",showModalBuilder:Xt.value,title:i.unref(n)("Global Page Styles"),onCloseMainModalBuilder:Zr,minHeight:"",maxHeight:""},{default:i.withCtx(()=>[i.createVNode(pT,{isLoading:rt.value},null,8,["isLoading"])]),_:1},8,["showModalBuilder","title"]),i.createVNode(Q3,{title:i.unref(n)("Image Settings"),showSidebarPanel:ot.value,position:"left",closeOnOverlayClick:!1,onCloseSidebarPanel:xT},{default:i.withCtx(()=>[i.createVNode(PW,{show:ot.value},null,8,["show"])]),_:1},8,["title","showSidebarPanel"]),i.createVNode($e,{maxWidth:"7xl",showModalBuilder:Ze.value,title:i.unref(n)("HTML Editor"),onCloseMainModalBuilder:ge},{default:i.withCtx(()=>[hr.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.withDirectives(i.createElementVNode("textarea",{id:"html-editor","onUpdate:modelValue":L[31]||(L[31]=U=>yt.value=U),class:"pbx-h-full pbx-font-sans pbx-bg-gray-900 pbx-text-white pbx-w-full",style:{overflow:"auto","min-height":"400px"}},null,512),[[i.vModelText,yt.value]]),i.createElementVNode("div",MG,[q.value?(i.openBlock(),i.createElementBlock("p",NG," Error: "+i.toDisplayString(q.value),1)):i.createCommentVNode("",!0)]),i.createElementVNode("div",PG,[i.createElementVNode("div",LG,[i.createElementVNode("div",BG,[$.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("button",{onClick:ge,type:"button",class:"pbx-mySecondaryButton"},i.toDisplayString(i.unref(n)("Close")),1),i.createElementVNode("button",{onClick:WG,type:"button",class:"pbx-myPrimaryButton"},i.toDisplayString(i.unref(n)("Save")),1)],64)),$.value?(i.openBlock(),i.createElementBlock("div",AG,[...L[47]||(L[47]=[i.createElementVNode("div",{class:"pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"},[i.createElementVNode("span",{class:"!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"},"Loading...")],-1)])])):i.createCommentVNode("",!0)])])])],64)),hr.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.withDirectives(i.createElementVNode("textarea",{id:"html-editor","onUpdate:modelValue":L[32]||(L[32]=U=>wt.value=U),class:"pbx-h-full pbx-font-sans pbx-bg-gray-900 pbx-text-white pbx-w-full",style:{overflow:"auto","min-height":"400px"}},null,512),[[i.vModelText,wt.value]]),i.createElementVNode("div",DG,[q.value?(i.openBlock(),i.createElementBlock("p",VG," Error: "+i.toDisplayString(q.value),1)):i.createCommentVNode("",!0)]),i.createElementVNode("div",zG,[i.createElementVNode("div",IG,[i.createElementVNode("div",OG,[$.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("button",{onClick:ge,type:"button",class:"pbx-mySecondaryButton"},i.toDisplayString(i.unref(n)("Close")),1),i.createElementVNode("button",{onClick:GG,type:"button",class:"pbx-myPrimaryButton"},i.toDisplayString(i.unref(n)("Save")),1)],64)),$.value?(i.openBlock(),i.createElementBlock("div",_G,[...L[48]||(L[48]=[i.createElementVNode("div",{class:"pbx-inline-block pbx-h-8 pbx-w-8 pbx-animate-spin pbx-rounded-full pbx-border-4 pbx-border-solid pbx-border-current pbx-border-r-transparent pbx-align-[-0.125em] motion-reduce:pbx-animate-[spin_1.5s_linear_infinite]"},[i.createElementVNode("span",{class:"!pbx-absolute !pbx-m-px !pbx-h-px !pbx-w-px !pbx-overflow-hidden !pbx-whitespace-nowrap !pbx-border-0 !pbx-p-0 !pbx-[clip:rect(0,0,0,0)]"},"Loading...")],-1)])])):i.createCommentVNode("",!0)])])])],64)):i.createCommentVNode("",!0)]),_:1},8,["showModalBuilder","title"])],64)}}});class To{static getHistory(e){const t=e+this.HISTORY_KEY_SUFFIX,o=localStorage.getItem(t);return o?JSON.parse(o):[]}static addToHistory(e,t){const o=e+this.HISTORY_KEY_SUFFIX;let n=this.getHistory(e);n.push(t),n.length>this.MAX_HISTORY_SIZE&&(n=n.slice(n.length-this.MAX_HISTORY_SIZE)),localStorage.setItem(o,JSON.stringify(n))}static clearHistory(e){const t=e+this.HISTORY_KEY_SUFFIX;localStorage.removeItem(t)}}Q(To,"HISTORY_KEY_SUFFIX","-history"),Q(To,"MAX_HISTORY_SIZE",10);const Sp={objectFit:["none","pbx-object-cover","pbx-object-contain"],objectPosition:["none","pbx-object-top-left","pbx-object-top","pbx-object-top-right","pbx-object-left","pbx-object-center","pbx-object-right","pbx-object-bottom-left","pbx-object-bottom","pbx-object-bottom-right"],aspectRatio:["none","pbx-aspect-square","pbx-aspect-video","pbx-aspect-[9/16]"]};let qa;const RG=new Uint8Array(16);function jG(){if(!qa&&(qa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qa(RG)}const Le=[];for(let r=0;r<256;++r)Le.push((r+256).toString(16).slice(1));function FG(r,e=0){return Le[r[e+0]]+Le[r[e+1]]+Le[r[e+2]]+Le[r[e+3]]+"-"+Le[r[e+4]]+Le[r[e+5]]+"-"+Le[r[e+6]]+Le[r[e+7]]+"-"+Le[r[e+8]]+Le[r[e+9]]+"-"+Le[r[e+10]]+Le[r[e+11]]+Le[r[e+12]]+Le[r[e+13]]+Le[r[e+14]]+Le[r[e+15]]}const cT={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function mT(r,e,t){if(cT.randomUUID&&!r)return cT.randomUUID();r=r||{};const o=r.random||(r.rng||jG)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,FG(o)}const qG=["en","zh-Hans","fr","ja","ru","es","pt","de","ar","hi","da","it"],Ua="pbx-full-width-component";class bT{constructor(e){Q(this,"fontSizeRegex",/^(sm:|md:|lg:|xl:|2xl:)?pbx-text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);Q(this,"pageBuilderStateStore");Q(this,"getLocalStorageItemName");Q(this,"getApplyImageToSelection");Q(this,"getHyberlinkEnable");Q(this,"getComponents");Q(this,"getComponent");Q(this,"getElement");Q(this,"getComponentArrayAddMethod");Q(this,"NoneListernesTags");Q(this,"hasStartedEditing",!1);Q(this,"originalComponents");Q(this,"savedMountComponents",null);Q(this,"pendingMountComponents",null);Q(this,"globalStylesObserver",null);Q(this,"_pendingPageSettings",null);Q(this,"_lastKnownPageSettings",null);Q(this,"isPageBuilderMissingOnStart",!1);Q(this,"elementsWithListeners",new WeakMap);Q(this,"translate");Q(this,"handleMouseOver",(e,t)=>{e.preventDefault(),e.stopPropagation();const o=document.querySelector("#pagebuilder");if(!o)return;const n=o.querySelector("[hovered]");n&&n.removeAttribute("hovered"),t.hasAttribute("selected")||t.setAttribute("hovered","")});Q(this,"handleMouseLeave",e=>{e.preventDefault(),e.stopPropagation();const t=document.querySelector("#pagebuilder");if(!t)return;const o=t.querySelector("[hovered]");o&&o.removeAttribute("hovered")});Q(this,"addListenersToEditableElements",async()=>{const e=document.querySelector("#pagebuilder");e&&(await i.nextTick(),e.querySelectorAll("section *").forEach(t=>{if(this.isEditableElement(t)){const o=t;if(this.elementsWithListeners.has(o)){const s=this.elementsWithListeners.get(o);s&&(o.removeEventListener("click",s.click),o.removeEventListener("mouseover",s.mouseover),o.removeEventListener("mouseleave",s.mouseleave))}const n=s=>this.handleElementClick(s,o),a=s=>this.handleMouseOver(s,o),l=s=>this.handleMouseLeave(s);o.addEventListener("click",n),o.addEventListener("mouseover",a),o.addEventListener("mouseleave",l),this.elementsWithListeners.set(o,{click:n,mouseover:a,mouseleave:l})}}))});Q(this,"handleElementClick",async(e,t)=>{if(this.pageBuilderStateStore.getImageSettingsPanelOpen)return;e.preventDefault(),e.stopPropagation();const o=document.querySelector("#pagebuilder");if(!o)return;this.pageBuilderStateStore.setMenuRight(!0);const n=o.querySelector("[selected]");n&&n.removeAttribute("selected"),t.removeAttribute("hovered"),t.setAttribute("selected",""),this.pageBuilderStateStore.setElement(t),await this.handleAutoSave()});Q(this,"handleAutoSave",async()=>{this.startEditing();const e=this.pageBuilderStateStore.getPageBuilderConfig;if(e&&e.userSettings&&typeof e.userSettings.autoSave=="boolean"&&e.userSettings.autoSave!==!1){if(this.pageBuilderStateStore.getIsSaving)return;try{this.pageBuilderStateStore.setIsSaving(!0),this.saveDomComponentsToLocalStorage(),await se(400)}catch(t){console.error("Error trying auto save.",t)}finally{this.pageBuilderStateStore.setIsSaving(!1)}}if(e&&!e.userSettings)try{this.pageBuilderStateStore.setIsSaving(!0),this.saveDomComponentsToLocalStorage(),await se(400)}catch(t){console.error("Error trying saving.",t)}finally{this.pageBuilderStateStore.setIsSaving(!1)}});Q(this,"handleManualSave",async e=>{this.pageBuilderStateStore.setIsSaving(!0),e||this.clearHtmlSelection(),this.startEditing(),this.saveDomComponentsToLocalStorage(),await se(300),this.pageBuilderStateStore.setIsSaving(!1)});Q(this,"ensureTextAreaHasContent",()=>{if(!this.getElement.value||typeof this.getElement.value.innerHTML!="string")return;const e=this.getElement.value,t=e.tagName;["DIV"].includes(t)&&e.tagName.toLowerCase()!=="img"&&e.textContent&&Number(e.textContent.length)===0?(e.classList.add("h-6"),e.classList.add("bg-red-50")):(e.classList.remove("h-6"),e.classList.remove("bg-red-50"))});Q(this,"handleTextInput",async e=>{var t;typeof((t=this.getElement.value)==null?void 0:t.innerHTML)=="string"&&(typeof this.getElement.value.innerHTML=="string"&&(await i.nextTick(),this.getElement.value.textContent=e,this.pageBuilderStateStore.setTextAreaVueModel(this.getElement.value.innerHTML),this.getElement.value.innerHTML=e),this.ensureTextAreaHasContent())});this.hasStartedEditing=!1,this.pageBuilderStateStore=e;const{translate:t}=re();this.translate=t,this.getApplyImageToSelection=i.computed(()=>this.pageBuilderStateStore.getApplyImageToSelection),this.getLocalStorageItemName=i.computed(()=>this.pageBuilderStateStore.getLocalStorageItemName),this.getHyberlinkEnable=i.computed(()=>this.pageBuilderStateStore.getHyberlinkEnable),this.getComponents=i.computed(()=>this.pageBuilderStateStore.getComponents),this.getComponent=i.computed(()=>this.pageBuilderStateStore.getComponent),this.getElement=i.computed(()=>this.pageBuilderStateStore.getElement),this.getComponentArrayAddMethod=i.computed(()=>this.pageBuilderStateStore.getComponentArrayAddMethod),this.NoneListernesTags=["P","H1","H2","H3","H4","H5","H6","IFRAME","UL","OL","LI","EM","STRONG","B","A","SPAN","BLOCKQUOTE","BR","PRE","CODE","MARK","DEL","INS","U","FIGURE","FIGCAPTION"]}availableLanguage(){return qG}changeLanguage(e){this.pageBuilderStateStore.setCurrentLanguage(e)}async clearHtmlSelection(){this.pageBuilderStateStore.getImageSettingsPanelOpen||(this.pageBuilderStateStore.setComponent(null),this.pageBuilderStateStore.setElement(null),await this.removeHoveredAndSelected())}ensureUpdateOrCreateConfig(e){if(!e.updateOrCreate||e.updateOrCreate&&er(e.updateOrCreate)){const t={...e,updateOrCreate:{formType:"create",formName:"post"}};this.pageBuilderStateStore.setPageBuilderConfig(t);return}if(e.updateOrCreate&&typeof e.updateOrCreate.formType=="string"&&(e.updateOrCreate.formType==="create"||e.updateOrCreate.formType==="update")&&typeof e.updateOrCreate.formName!="string"||typeof e.updateOrCreate.formName=="string"&&e.updateOrCreate.formName.length===0){const t={...e,updateOrCreate:{formType:e.updateOrCreate.formType,formName:"post"}};this.pageBuilderStateStore.setPageBuilderConfig(t)}if(e.updateOrCreate&&typeof e.updateOrCreate.formType!="string"||typeof e.updateOrCreate.formType=="string"&&e.updateOrCreate.formType!=="create"&&e.updateOrCreate.formType!=="update"&&typeof e.updateOrCreate.formName=="string"&&e.updateOrCreate.formName.length!==0){const t={...e,updateOrCreate:{formType:"create",formName:e.updateOrCreate.formName}};this.pageBuilderStateStore.setPageBuilderConfig(t);return}if(e.updateOrCreate&&typeof e.updateOrCreate.formType=="string"&&e.updateOrCreate.formType!=="create"&&e.updateOrCreate.formType!=="update"&&typeof e.formName!="string"){const t={...e,updateOrCreate:{formType:"create",formName:"post"}};this.pageBuilderStateStore.setPageBuilderConfig(t)}}validateUserProvidedComponents(e){const t=this.pageBuilderStateStore.getPageBuilderConfig&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate.formType;if(Array.isArray(e)&&e.length>=1&&t==="create"&&e)return{error:!0,warning:"You cannot set formType to create in your configuration while also passing a components data array to the Page Builder. Please set formType to update.",status:"validation_failed"};if(!Array.isArray(e))return{error:!0,reason:"Components data must be an array."};const o=e[0];if(o&&"html_code"in o&&typeof o.html_code!="string")return{error:!0,reason:"The 'html_code' property in the first object must be a string."};if(Array.isArray(e)&&e.length>=1&&(!o||!("html_code"in o)))return{error:!0,reason:"The first object in the array must include an 'html_code' key."}}ensureLanguage(e){const o=["en","zh-Hans","fr","ja","ru","es","pt","de","ar","hi","da"];let n=!1;const a=e.userSettings,l=a&&a.language;if((!a||er(a)||!l||er(l))&&(n=!0),n){const s=a?{...a}:{};s.language={default:"en",enable:o};const p={...e,userSettings:s};this.pageBuilderStateStore.setPageBuilderConfig(p);return}if(l&&Array.isArray(l.enable)&&l.default&&!l.enable.includes(l.default)){const s=[...l.enable,l.default],p={...e,userSettings:{...a,language:{...l,enable:s}}};this.pageBuilderStateStore.setPageBuilderConfig(p)}}validateConfig(e){var n;const t={updateOrCreate:{formType:"create",formName:"post"}};if(!e||e&&Object.keys(e).length===0&&e.constructor===Object){this.pageBuilderStateStore.setPageBuilderConfig(t);return}e&&Object.keys(e).length!==0&&e.constructor===Object&&(this.ensureUpdateOrCreateConfig(e),(!e.resourceData||typeof e.resourceData.title!="string"||!e.resourceData.title.trim())&&(!e.resourceData||typeof e.resourceData!="object"?e.resourceData={title:"Default Post"}:e.resourceData.title="Default Post"));let o=e;if(!o.userSettings||typeof o.userSettings!="object"||!("autoSave"in o.userSettings)){const a=o.userSettings?{...o.userSettings}:{};a.autoSave=((n=o.userSettings)==null?void 0:n.autoSave)!==!1;const l={...o,userSettings:a};this.pageBuilderStateStore.setPageBuilderConfig(l),o=l}this.ensureLanguage(o)}saveUserSettingsStorage(e){localStorage.setItem("userSettingsPageBuilder",JSON.stringify({userSettings:{lang:e}}))}async startBuilder(e,t){var a,l;this.pageBuilderStateStore.setBuilderStarted(!0);const o=document.querySelector("#pagebuilder");let n;try{this.originalComponents=t,this.pageBuilderStateStore.setPageBuilderConfig(e);const s=JSON.parse(localStorage.getItem("userSettingsPageBuilder")??"null");!(s!=null&&s.lang)&&((l=(a=e.userSettings)==null?void 0:a.language)!=null&&l.default)&&this.changeLanguage(e.userSettings.language.default),this.validateConfig(e),n=this.validateUserProvidedComponents(t),this.updateLocalStorageItemName(),this.initializeHistory(),t&&(this.savedMountComponents=t),o||(this.isPageBuilderMissingOnStart=!0),t&&!o&&(this.pendingMountComponents=t),o&&this.completeBuilderInitialization(t);const p={message:"Page builder started successfully."};return n&&(p.validation=n),Array.isArray(t)&&t.length>=0&&(p.passedComponentsArray=t),p}catch(s){return console.error("Not able to start the Page Builder",s),{error:!0,reason:"Failed to start the Page Builder due to an unexpected error."}}}async completeBuilderInitialization(e){this.pageBuilderStateStore.setIsLoadingGlobal(!0),await se(400),this.deleteAllComponentsFromDOM();const t=this.pageBuilderStateStore.getPageBuilderConfig,o=t&&t.updateOrCreate&&t.updateOrCreate.formType,n=this.getSavedPageHtml();if(await this.clearHtmlSelection(),o==="update"||o==="create"){if(!this.pendingMountComponents){if(!e&&this.isPageBuilderMissingOnStart&&n){await this.completeMountProcess(n);return}if(e&&!n){const a=this.renderComponentsToHtml(e);await this.completeMountProcess(a,!0),this.saveDomComponentsToLocalStorage();return}if(e&&n){const a=this.renderComponentsToHtml(e);await this.completeMountProcess(a,!0),await se(500),this.pageBuilderStateStore.setHasLocalDraftForUpdate(!0);return}if(!e&&n&&!this.savedMountComponents){await this.completeMountProcess(n);return}if(!e&&this.savedMountComponents&&n){const a=this.renderComponentsToHtml(this.savedMountComponents);await this.completeMountProcess(a);return}if(!e&&!n&&this.isPageBuilderMissingOnStart){const a=this.renderComponentsToHtml([]);await this.completeMountProcess(a);return}if(!this.isPageBuilderMissingOnStart&&!n&&!e){const a=this.renderComponentsToHtml([]);await this.completeMountProcess(a);return}}if(this.pendingMountComponents){if(n&&this.isPageBuilderMissingOnStart){const a=this.renderComponentsToHtml(this.pendingMountComponents);await this.completeMountProcess(a,!0),await se(500),this.pageBuilderStateStore.setHasLocalDraftForUpdate(!0),this.pendingMountComponents=null;return}if(!n&&e&&this.isPageBuilderMissingOnStart){const a=this.renderComponentsToHtml(this.pendingMountComponents);await this.completeMountProcess(a,!0),this.saveDomComponentsToLocalStorage();return}if(!e&&!n&&this.isPageBuilderMissingOnStart){const a=this.renderComponentsToHtml(this.pendingMountComponents);await this.completeMountProcess(a,!0),this.saveDomComponentsToLocalStorage();return}}}}renderComponentsToHtml(e){return!e||Array.isArray(e)&&e.length===0?'<div id="pagebuilder" class="pbx-text-black pbx-font-sans"></div>':e.map(o=>o.html_code).join(`
|
|
393
393
|
`)}async completeMountProcess(e,t){await this.mountComponentsToDOM(e,t),this.deleteOldPageBuilderLocalStorage(),this.pageBuilderStateStore.setIsRestoring(!1),this.pageBuilderStateStore.setIsLoadingGlobal(!1)}applyElementClassChanges(e,t,o){const n=this.getElement.value;if(!n)return;const a=t.find(s=>n.classList.contains(s));let l=a||"none";if(e===void 0){if(typeof o=="string"&&o.length>2&&o in this.pageBuilderStateStore&&typeof this.pageBuilderStateStore[o]=="function"){const s=this.pageBuilderStateStore[o];s(l)}return a}if(typeof e=="string"&&e!=="none"?(l&&n.classList.contains(l)&&n.classList.remove(l),t.forEach(s=>{s!=="none"&&["lg","md","sm","xl","2xl"].forEach(p=>{const d=`${p}:${s}`;n.classList.contains(d)&&n.classList.remove(d)})}),n.classList.add(e),l=e):typeof e=="string"&&e==="none"&&l&&(n.classList.remove(l),t.forEach(s=>{s!=="none"&&["lg","md","sm","xl","2xl"].forEach(p=>{const d=`${p}:${s}`;n.classList.contains(d)&&n.classList.remove(d)})}),l=e),typeof o=="string"&&o.length>2&&o in this.pageBuilderStateStore&&typeof this.pageBuilderStateStore[o]=="function"){const s=this.pageBuilderStateStore[o];s(l),this.pageBuilderStateStore.setElement(n)}return a}removeElementClassesFromArray(e,t){t.forEach(o=>{o!=="none"&&e.classList.contains(o)&&e.classList.remove(o)})}async clearClassesFromPage(){document.querySelectorAll("[data-pagebuilder-content]").forEach(e=>{e.removeAttribute("class")}),this.initializeElementStyles(),await i.nextTick()}async clearInlineStylesFromPage(){document.querySelectorAll("[data-pagebuilder-content]").forEach(e=>{e.removeAttribute("style")}),this.initializeElementStyles(),await i.nextTick()}async globalPageStyles(){const e=document.querySelectorAll("[data-pagebuilder-content]"),t=e[0];t&&(await this.clearHtmlSelection(),this.pageBuilderStateStore.setElement(t),t.setAttribute("data-global-selected","true"),this.globalStylesObserver&&this.globalStylesObserver.disconnect(),this.globalStylesObserver=new MutationObserver(()=>{const o=t.getAttribute("class")??"",n=t.getAttribute("style")??"";e.forEach(a=>{a!==t&&(o?a.setAttribute("class",o):a.removeAttribute("class"),n?a.setAttribute("style",n):a.removeAttribute("style"))})}),this.globalStylesObserver.observe(t,{attributes:!0,attributeFilter:["class","style"]}),await i.nextTick())}stopGlobalStylesSync(){this.globalStylesObserver&&(this.globalStylesObserver.disconnect(),this.globalStylesObserver=null)}handleFontWeight(e){this.applyElementClassChanges(e,Wt.fontWeight,"setFontWeight")}handleFontSizeBase(e){this.applyElementClassChanges(e,vo.fontBase,"setFontBase")}handleFontSizeDesktop(e){const t=this.getElement.value;if(!t)return;const o={"pbx-text-9xl":"pbx-text-6xl","pbx-text-8xl":"pbx-text-5xl","pbx-text-7xl":"pbx-text-4xl","pbx-text-6xl":"pbx-text-3xl","pbx-text-5xl":"pbx-text-3xl","pbx-text-4xl":"pbx-text-2xl","pbx-text-3xl":"pbx-text-xl","pbx-text-2xl":"pbx-text-lg","pbx-text-xl":"pbx-text-base","pbx-text-lg":"pbx-text-sm","pbx-text-base":"pbx-text-xs","pbx-text-sm":"pbx-text-xs","pbx-text-xs":"pbx-text-xs"};if(e){Array.from(t.classList).forEach(p=>{this.fontSizeRegex.test(p)&&t.classList.remove(p)});const a=e.replace(/^lg:/,""),l=o[a]||a,s=`lg:${a}`;l!==a?t.classList.add(l,s):t.classList.add(l)}const n=vo.fontDesktop.find(a=>t.classList.contains(a));e||this.pageBuilderStateStore.setFontDesktop("none"),n&&!e&&this.pageBuilderStateStore.setFontDesktop(n)}ensureImagesHaveAltText(e){e.tagName==="IMG"&&!e.hasAttribute("alt")&&e.setAttribute("alt","image"),e.querySelectorAll("img:not([alt])").forEach(t=>{t.setAttribute("alt","image")})}applyHelperCSSToElements(e){if(this.wrapElementInDivIfExcluded(e),this.ensureImagesHaveAltText(e),e.tagName==="DIV"&&e.children.length===1&&["H1","H2","H3","H4","H5","H6"].includes(e.children[0].tagName)){const t=e.children[0];Array.from(e.classList).some(n=>this.fontSizeRegex.test(n))||(t.tagName==="H2"&&e.classList.add("pbx-text-3xl","lg:pbx-text-4xl","pbx-font-medium"),t.tagName==="H3"&&e.classList.add("pbx-text-2xl","lg:pbx-text-3xl","pbx-font-medium"),t.tagName==="H4"&&e.classList.add("pbx-text-xl","lg:pbx-text-2xl","pbx-font-medium"),t.tagName==="H5"&&e.classList.add("pbx-text-lg","lg:pbx-text-xl","pbx-font-medium"),t.tagName==="H6"&&e.classList.add("pbx-text-base","lg:pbx-text-base","pbx-font-medium"))}}async toggleTipTapModal(e){this.pageBuilderStateStore.setShowModalTipTap(e),await i.nextTick(),await this.addListenersToEditableElements(),e||await this.handleAutoSave()}wrapElementInDivIfExcluded(e){var t;if(e&&this.NoneListernesTags.includes(e.tagName)&&(e.previousElementSibling&&e.previousElementSibling.tagName==="IMG"||e.nextElementSibling&&e.nextElementSibling.tagName==="IMG")){const o=document.createElement("div");(t=e.parentNode)==null||t.insertBefore(o,e),o.appendChild(e)}}isEditableElement(e){return!e||e.tagName!=="IMG"&&e.closest("[data-pb-no-select]")?!1:!this.NoneListernesTags.includes(e.tagName)}getSelectedComponentSection(){const e=this.getElement.value;return!e||!(e instanceof HTMLElement)?null:e.closest("section")}isSelectedComponentTopElement(){const e=this.getElement.value,t=this.getSelectedComponentSection();return!e||!t?!1:e.parentElement===t}selectedComponentIsFullWidth(){var e;return((e=this.getSelectedComponentSection())==null?void 0:e.classList.contains(Ua))??!1}async setSelectedComponentFullWidth(e){const t=this.getSelectedComponentSection();t&&(t.classList.toggle(Ua,e),await this.handleAutoSave())}isGlobalFullWidth(){const e=document.querySelector("[data-pagebuilder-content]");return(e==null?void 0:e.classList.contains(Ua))??!1}async setGlobalFullWidth(e){document.querySelectorAll("[data-pagebuilder-content]").forEach(t=>{t.classList.toggle(Ua,e)}),this.saveDomComponentsToLocalStorage(),await this.handleAutoSave()}isSelectedElementImage(){var e;return((e=this.getElement.value)==null?void 0:e.tagName)==="IMG"}setImageSettingsModalOpen(e){this.pageBuilderStateStore.setImageSettingsPanelOpen(e)}isImageSettingsModalOpen(){return this.pageBuilderStateStore.getImageSettingsPanelOpen}findImageAspectClass(e){const t=Sp.aspectRatio.find(n=>n!=="none"&&e.classList.contains(n));return t||(Array.from(e.classList).find(n=>n.startsWith("pbx-aspect-"))??null)}removeImageAspectClasses(e){Array.from(e.classList).forEach(t=>{t.startsWith("pbx-aspect-")&&e.classList.remove(t)})}handleImageObjectFit(e){this.applyElementClassChanges(e,Sp.objectFit,"setImageObjectFit")}handleImageObjectPosition(e){this.applyElementClassChanges(e,Sp.objectPosition,"setImageObjectPosition")}handleImageAspectRatio(e){const t=this.getElement.value;if(!(!t||t.tagName!=="IMG")){if(e===void 0){const o=this.findImageAspectClass(t);this.pageBuilderStateStore.setImageAspectRatio(o||"none");return}this.removeImageAspectClasses(t),e!=="none"&&t.classList.add(e),this.pageBuilderStateStore.setImageAspectRatio(e),this.pageBuilderStateStore.setElement(t)}}async handleImageAltText(e){const t=this.getElement.value;if(!t||t.tagName!=="IMG"||e===void 0)return;const o=e.trim();o?t.setAttribute("alt",o):t.removeAttribute("alt"),this.pageBuilderStateStore.setElement(t),await this.handleAutoSave()}getSelectedImageAltText(){const e=this.getElement.value;return!e||e.tagName!=="IMG"?"":e.getAttribute("alt")||""}getHistoryBaseKey(){return this.getLocalStorageItemName.value}initializeHistory(){const e=this.getHistoryBaseKey();if(e){const t=To.getHistory(e);this.pageBuilderStateStore.setHistoryIndex(t.length-1),this.pageBuilderStateStore.setHistoryLength(t.length)}}cloneCompObjForDOMInsertion(e){const t={...e},o=document.querySelector("#page-builder-wrapper");o&&this.getComponentArrayAddMethod.value==="unshift"&&o.scrollTo({top:0,behavior:"smooth"});const a=new DOMParser().parseFromString(t.html_code||"","text/html");a.querySelectorAll("*").forEach(p=>{this.applyHelperCSSToElements(p)});const s=a.querySelector("section");return s&&(s.querySelectorAll("[class]").forEach(p=>{p.setAttribute("class",this.addTailwindPrefixToClasses(p.getAttribute("class")||"","pbx-"))}),s.dataset.componentid=mT(),t.title&&s.setAttribute("data-component-title",t.title),t.id=s.dataset.componentid,t.html_code=s.outerHTML),t}async removeHoveredAndSelected(){const e=document.querySelector("#pagebuilder");if(!e)return;const t=e.querySelector("[hovered]");t&&t.removeAttribute("hovered");const o=e.querySelector("[selected]");o&&o.removeAttribute("selected")}async syncCurrentClasses(){var t;const e=Array.from(((t=this.getElement.value)==null?void 0:t.classList)||[]);this.pageBuilderStateStore.setCurrentClasses(e)}async syncCurrentStyles(){var t;const e=(t=this.getElement.value)==null?void 0:t.getAttribute("style");if(e){const o=this.parseStyleString(e);this.pageBuilderStateStore.setCurrentStyles(o)}else this.pageBuilderStateStore.setCurrentStyles({})}handleAddClasses(e){var t,o;if(typeof e=="string"&&e.trim()!==""&&!e.includes(" ")&&!((t=this.getElement.value)!=null&&t.classList.contains("pbx-"+e.trim()))){const n=e.trim(),a=n.startsWith("pbx-")?n:"pbx-"+n;(o=this.getElement.value)==null||o.classList.add(a),this.pageBuilderStateStore.setElement(this.getElement.value),this.pageBuilderStateStore.setClass(a)}}handleAddStyle(e,t){const o=this.getElement.value;!o||!e||!t||(o.style.setProperty(e,t),this.pageBuilderStateStore.setElement(o))}handleRemoveStyle(e){const t=this.getElement.value;!t||!e||(t.style.removeProperty(e),this.pageBuilderStateStore.setElement(t))}handleFontFamily(e){this.applyElementClassChanges(e,Wt.fontFamily,"setFontFamily")}handleFontStyle(e){this.applyElementClassChanges(e,Wt.fontStyle,"setFontStyle")}purgeConflictingClasses(e){const t=this.getElement.value;t&&e.forEach(o=>{o.forEach(n=>{n!=="none"&&t.classList.contains(n)&&t.classList.remove(n)})})}handleVerticalPadding(e){e!==void 0&&this.purgeConflictingClasses([Y.topPadding,Y.bottomPadding]),this.applyElementClassChanges(e,Y.verticalPadding,"setFontVerticalPadding")}handleHorizontalPadding(e){e!==void 0&&this.purgeConflictingClasses([Y.leftPadding,Y.rightPadding]),this.applyElementClassChanges(e,Y.horizontalPadding,"setFontHorizontalPadding")}handleTopPadding(e){e!==void 0&&this.purgeConflictingClasses([Y.verticalPadding]),this.applyElementClassChanges(e,Y.topPadding,"setFontTopPadding")}handleRightPadding(e){e!==void 0&&this.purgeConflictingClasses([Y.horizontalPadding]),this.applyElementClassChanges(e,Y.rightPadding,"setFontRightPadding")}handleBottomPadding(e){e!==void 0&&this.purgeConflictingClasses([Y.verticalPadding]),this.applyElementClassChanges(e,Y.bottomPadding,"setFontBottomPadding")}handleLeftPadding(e){e!==void 0&&this.purgeConflictingClasses([Y.horizontalPadding]),this.applyElementClassChanges(e,Y.leftPadding,"setFontLeftPadding")}handleVerticalMargin(e){e!==void 0&&this.purgeConflictingClasses([Y.topMargin,Y.bottomMargin]),this.applyElementClassChanges(e,Y.verticalMargin,"setFontVerticalMargin")}handleHorizontalMargin(e){e!==void 0&&this.purgeConflictingClasses([Y.leftMargin,Y.rightMargin]),this.applyElementClassChanges(e,Y.horizontalMargin,"setFontHorizontalMargin")}handleTopMargin(e){e!==void 0&&this.purgeConflictingClasses([Y.verticalMargin]),this.applyElementClassChanges(e,Y.topMargin,"setFontTopMargin")}handleRightMargin(e){e!==void 0&&this.purgeConflictingClasses([Y.horizontalMargin]),this.applyElementClassChanges(e,Y.rightMargin,"setFontRightMargin")}handleBottomMargin(e){e!==void 0&&this.purgeConflictingClasses([Y.verticalMargin]),this.applyElementClassChanges(e,Y.bottomMargin,"setFontBottomMargin")}handleLeftMargin(e){e!==void 0&&this.purgeConflictingClasses([Y.horizontalMargin]),this.applyElementClassChanges(e,Y.leftMargin,"setFontLeftMargin")}handleBorderStyle(e){this.applyElementClassChanges(e,Eo.borderStyle,"setBorderStyle")}handleBorderWidth(e){this.applyElementClassChanges(e,Eo.borderWidth,"setBorderWidth")}handleBorderColor(e){this.applyElementClassChanges(e,Eo.borderColor,"setBorderColor")}handleBackgroundColor(e){var t,o;if(e===void 0){const n=(t=this.getElement.value)==null?void 0:t.style.getPropertyValue("background-color");if(n){this.pageBuilderStateStore.setBackgroundColor(`custom:${n}`);return}}else(o=this.getElement.value)==null||o.style.removeProperty("background-color");this.applyElementClassChanges(e,So.backgroundColorVariables,"setBackgroundColor")}handleCustomBackgroundColor(e){const t=this.getElement.value;!t||!e||(this.removeElementClassesFromArray(t,So.backgroundColorVariables),t.style.setProperty("background-color",e),this.pageBuilderStateStore.setBackgroundColor(`custom:${e}`),this.pageBuilderStateStore.setElement(t))}handleTextColor(e){var t,o;if(e===void 0){const n=(t=this.getElement.value)==null?void 0:t.style.getPropertyValue("color");if(n){this.pageBuilderStateStore.setTextColor(`custom:${n}`);return}}else(o=this.getElement.value)==null||o.style.removeProperty("color");this.applyElementClassChanges(e,So.textColorVariables,"setTextColor")}handleCustomTextColor(e){const t=this.getElement.value;!t||!e||(this.removeElementClassesFromArray(t,So.textColorVariables),t.style.setProperty("color",e),this.pageBuilderStateStore.setTextColor(`custom:${e}`),this.pageBuilderStateStore.setElement(t))}handleBorderRadiusGlobal(e){this.applyElementClassChanges(e,Mt.roundedGlobal,"setBorderRadiusGlobal")}handleBorderRadiusTopLeft(e){this.applyElementClassChanges(e,Mt.roundedTopLeft,"setBorderRadiusTopLeft")}handleBorderRadiusTopRight(e){this.applyElementClassChanges(e,Mt.roundedTopRight,"setBorderRadiusTopRight")}handleBorderRadiusBottomleft(e){this.applyElementClassChanges(e,Mt.roundedBottomLeft,"setBorderRadiusBottomleft")}handleBorderRadiusBottomRight(e){this.applyElementClassChanges(e,Mt.roundedBottomRight,"setBorderRadiusBottomRight")}handleFontSizeTablet(e){this.applyElementClassChanges(e,vo.fontTablet,"setFontTablet")}handleFontSizeMobile(e){this.applyElementClassChanges(e,vo.fontMobile,"setFontMobile")}handleBackgroundOpacity(e){this.applyElementClassChanges(e,Fa.backgroundOpacities,"setBackgroundOpacity")}handleOpacity(e){this.applyElementClassChanges(e,Fa.opacities,"setOpacity")}deleteAllComponentsFromDOM(){this.pageBuilderStateStore.setComponents([]);const e=document.querySelector("#pagebuilder");e&&e.querySelectorAll("section[data-componentid]").forEach(t=>t.remove())}async undo(){this.pageBuilderStateStore.setIsLoadingGlobal(!0),await se(300);const e=this.getHistoryBaseKey();if(!e)return;const t=To.getHistory(e);if(t.length>1&&this.pageBuilderStateStore.getHistoryIndex>0){this.pageBuilderStateStore.setHistoryIndex(this.pageBuilderStateStore.getHistoryIndex-1);const o=t[this.pageBuilderStateStore.getHistoryIndex],n=this.renderComponentsToHtml(o.components);await this.mountComponentsToDOM(n,!1,o.pageSettings)}this.pageBuilderStateStore.setIsLoadingGlobal(!1)}async redo(){this.pageBuilderStateStore.setIsLoadingGlobal(!0),await se(300);const e=this.getHistoryBaseKey();if(!e)return;const t=To.getHistory(e);if(t.length>0&&this.pageBuilderStateStore.getHistoryIndex<t.length-1){this.pageBuilderStateStore.setHistoryIndex(this.pageBuilderStateStore.getHistoryIndex+1);const o=t[this.pageBuilderStateStore.getHistoryIndex],n=this.renderComponentsToHtml(o.components);await this.mountComponentsToDOM(n,!1,o.pageSettings)}this.pageBuilderStateStore.setIsLoadingGlobal(!1)}hasVisibleContent(e){if(!e)return!1;if(e.querySelector("img, video, iframe, input, button, a, h1, h2, h3, h4, h5, h6, p, li, blockquote, pre, code, table"))return!0;const o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);for(;o.nextNode();)if(o.currentNode.nodeValue&&o.currentNode.nodeValue.trim()!=="")return!0;return!1}isSectionEmpty(e){return!this.hasVisibleContent(e)}findReverseableContainer(){const e=this.getSelectedComponentSection();if(!e)return null;const t=['[class*="flex-row"]','[class*="pbx-flex-row"]','[class*="grid-cols-2"]','[class*="pbx-grid-cols-2"]'];for(const o of t){const n=Array.from(e.querySelectorAll(o));for(const a of n)if(Array.from(a.children).filter(s=>s instanceof HTMLElement).length===2)return a}return null}async reverseComponentLayout(){const e=this.findReverseableContainer();if(!e)return;const t=Array.from(e.children);t.length===2&&(e.insertBefore(t[1],t[0]),await this.syncDomToStoreOnly(),await i.nextTick(),this.saveDomComponentsToLocalStorage(),await this.handleAutoSave(),this.pageBuilderStateStore.setComponent(null),this.pageBuilderStateStore.setElement(null),await this.clearHtmlSelection(),await i.nextTick(),await this.addListenersToEditableElements())}async duplicateComponent(){await this.syncDomToStoreOnly(),await i.nextTick();const e=this.pageBuilderStateStore.getComponents,t=this.getComponent.value;if(!e||!t)return;const o=e.findIndex(l=>l.id===t.id);if(o===-1)return;const n=this.cloneCompObjForDOMInsertion(e[o]),a=[...e.slice(0,o+1),n,...e.slice(o+1)];await this.setComponentsPreservingPageSettings(a),await i.nextTick(),await this.addListenersToEditableElements(),this.pageBuilderStateStore.setComponent(n),this.pageBuilderStateStore.setElement(null),await this.handleAutoSave()}async deleteComponentFromDOM(){await this.syncDomToStoreOnly(),await i.nextTick();const e=this.pageBuilderStateStore.getComponents;if(!e)return;const t=e.findIndex(n=>this.getComponent.value?n.id===this.getComponent.value.id:!1);if(t===-1)return;const o=[...e.slice(0,t),...e.slice(t+1)];await this.setComponentsPreservingPageSettings(o),await i.nextTick(),await this.addListenersToEditableElements(),this.pageBuilderStateStore.setComponent(null),this.pageBuilderStateStore.setElement(null),await this.handleAutoSave()}async duplicateElementInDOM(){const e=this.getElement.value;if(!e||!e.parentNode)return;e.removeAttribute("selected");const t=e.cloneNode(!0);e.parentNode.insertBefore(t,e.nextSibling),await this.syncDomToStoreOnly(),await this.addListenersToEditableElements(),this.pageBuilderStateStore.setComponent(null),this.pageBuilderStateStore.setElement(null),this.saveDomComponentsToLocalStorage(),await this.handleAutoSave()}async deleteElementFromDOM(){const e=this.getElement.value;if(!e)return;if(e.removeAttribute("selected"),!e.parentNode){this.pageBuilderStateStore.setComponent(null),this.pageBuilderStateStore.setElement(null);return}const t=e.closest("section");e.tagName==="SECTION"?await this.deleteComponentFromDOM():(e.remove(),t&&this.isSectionEmpty(t)&&t.remove(),await this.syncDomToStoreOnly(),this.saveDomComponentsToLocalStorage()),this.pageBuilderStateStore.setComponent(null),this.pageBuilderStateStore.setElement(null),await this.clearHtmlSelection(),await i.nextTick(),await this.addListenersToEditableElements()}handleRemoveClasses(e){var t,o;(t=this.getElement.value)!=null&&t.classList.contains(e)&&((o=this.getElement.value)==null||o.classList.remove(e),this.pageBuilderStateStore.setElement(this.getElement.value),this.pageBuilderStateStore.removeClass(e))}async reorderComponent(e){if(!this.getComponents.value||!this.getComponent.value||this.getComponents.value.length<=1)return;const t=this.getComponent.value,o=this.getComponents.value.findIndex(s=>s.id===t.id);if(o===-1)return;const n=o+e;if(n<0||n>=this.getComponents.value.length)return;this.getComponents.value.splice(o,1),this.getComponents.value.splice(n,0,t),await i.nextTick();const a=document.querySelector("#page-builder-wrapper"),l=a==null?void 0:a.querySelector(`section[data-componentid="${t.id}"]`);if(l){l.classList.add("pbx-reorder-highlight");const s=l.previousElementSibling,p=l.nextElementSibling;if(s&&s.tagName==="SECTION"&&s.classList.add("pbx-sibling-highlight"),p&&p.tagName==="SECTION"&&p.classList.add("pbx-sibling-highlight"),a){const d=l.offsetTop-a.offsetTop;a.scrollTop=d-a.clientHeight/2,setTimeout(()=>{l.classList.remove("pbx-reorder-highlight"),s&&s.tagName==="SECTION"&&s.classList.remove("pbx-sibling-highlight"),p&&p.tagName==="SECTION"&&p.classList.remove("pbx-sibling-highlight")},200)}}}canMoveUp(){return!this.getComponents.value||!this.getComponent.value?!1:this.getComponents.value.findIndex(t=>{var o;return t.id===((o=this.getComponent.value)==null?void 0:o.id)})>0}canMoveDown(){return!this.getComponents.value||!this.getComponent.value?!1:this.getComponents.value.findIndex(t=>{var o;return t.id===((o=this.getComponent.value)==null?void 0:o.id)})<this.getComponents.value.length-1}ElOrFirstChildIsIframe(){var e,t,o;return((e=this.getElement.value)==null?void 0:e.tagName)==="IFRAME"||((o=(t=this.getElement.value)==null?void 0:t.firstElementChild)==null?void 0:o.tagName)==="IFRAME"}isSelectedElementValidText(){var o,n,a,l;let e=!1;const t=(o=this.getElement.value)==null?void 0:o.children;if(!(((n=this.getElement.value)==null?void 0:n.tagName)==="IMG"||((l=(a=this.getElement.value)==null?void 0:a.firstElementChild)==null?void 0:l.tagName)==="IFRAME")&&t)return Array.from(t).forEach(s=>{(s==null?void 0:s.tagName)==="IMG"||(s==null?void 0:s.tagName)==="DIV"?e=!1:e=!0}),e}previewCurrentDesign(){this.pageBuilderStateStore.setElement(null);const e=document.querySelector("#pagebuilder");if(e&&e){const t=sT(e,this.pageBuilderStateStore.getPageBuilderConfig?this.pageBuilderStateStore.getPageBuilderConfig:void 0),o=JSON.stringify([t]);this.pageBuilderStateStore.setCurrentLayoutPreview(o)}}sanitizeForLocalStorage(e){return e.trim().toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}cloneAndRemoveSelectionAttributes(e){const t=e.cloneNode(!0);return t.querySelectorAll("[hovered]").forEach(o=>o.removeAttribute("hovered")),t.querySelectorAll("[selected]").forEach(o=>o.removeAttribute("selected")),t.removeAttribute("hovered"),t.removeAttribute("selected"),t}async syncDomToStoreOnly(){const e=document.querySelector("#pagebuilder");if(!e)return;const t=[];e.querySelectorAll("section[data-componentid]").forEach(o=>{const n=this.cloneAndRemoveSelectionAttributes(o);t.push({html_code:n.outerHTML,id:n.getAttribute("data-componentid"),title:n.getAttribute("data-component-title")||"Untitled Component"})}),await this.setComponentsPreservingPageSettings(t)}async generateHtmlFromComponents(){await this.syncDomToStoreOnly(),await i.nextTick();const e=this.pageBuilderStateStore.getComponents;return Array.isArray(e)?(await i.nextTick(),await this.addListenersToEditableElements(),e.map(t=>t.html_code.replace(/data-componentid="[^"]*"/g,"").replace(/\s{2,}/g," ")).join(`
|
|
394
|
-
`)):""}saveDomComponentsToLocalStorage(){this.updateLocalStorageItemName();const e=document.querySelector("#pagebuilder");if(!e)return;const t=e.querySelector("[hovered]");t&&t.removeAttribute("hovered");const o=[];e.querySelectorAll("section[data-componentid]").forEach(p=>{const d=this.cloneAndRemoveSelectionAttributes(p);d.removeAttribute("data-componentid"),o.push({html_code:d.outerHTML,title:d.getAttribute("data-component-title")||"Untitled Component"})});const n=document.querySelector("[data-pagebuilder-content]"),a={classes:(n==null?void 0:n.className)||"",style:(n==null?void 0:n.getAttribute("style"))||(n==null?void 0:n.style.cssText)||""},l={components:o,pageBuilderContentSavedAt:new Date().toISOString(),pageSettings:a},s=this.getHistoryBaseKey();if(s){const p=localStorage.getItem(s);if(p||localStorage.setItem(s,JSON.stringify(l)),p){const d=JSON.parse(p),c=d.components||[],m=l.components||[],b=m.length!==c.length||m.some((g,u)=>{const h=c[u];return!h||h.html_code!==g.html_code}),x=d.pageSettings&&d.pageSettings.classes!==l.pageSettings.classes||d.pageSettings&&d.pageSettings.style!==l.pageSettings.style;if(b||x){localStorage.setItem(s,JSON.stringify(l));let g=To.getHistory(s);const u=g[g.length-1];if(u){const h=JSON.stringify(u.components),f=JSON.stringify(l.components),w=JSON.stringify(u.pageSettings),y=JSON.stringify(l.pageSettings);if(h===f&&w===y)return}this.pageBuilderStateStore.getHistoryIndex<g.length-1&&(g=g.slice(0,this.pageBuilderStateStore.getHistoryIndex+1)),g.push(l),g.length>10&&(g=g.slice(g.length-10)),localStorage.setItem(s+"-history",JSON.stringify(g)),this.pageBuilderStateStore.setHistoryIndex(g.length-1),this.pageBuilderStateStore.setHistoryLength(g.length);return}}}}async removeCurrentComponentsFromLocalStorage(){this.updateLocalStorageItemName(),await i.nextTick();const e=this.getLocalStorageItemName.value;e&&localStorage.removeItem(e)}async handleFormSubmission(){const e=this.readCurrentPageSettings();if(e&&(this._lastKnownPageSettings=e),await this.removeCurrentComponentsFromLocalStorage(),this.deleteAllComponentsFromDOM(),this.pageBuilderStateStore.setComponents([]),e){this.updateLocalStorageItemName();const t=this.getLocalStorageItemName.value;if(t){const o={components:[],pageBuilderContentSavedAt:new Date().toISOString(),pageSettings:e};localStorage.setItem(t,JSON.stringify(o))}}}readCurrentPageSettings(){const e=document.querySelector("[data-pagebuilder-content]");if(e)return{classes:e.className||"",style:e.getAttribute("style")||e.style.cssText||""};this.updateLocalStorageItemName();const t=this.getLocalStorageItemName.value;if(t)try{const o=localStorage.getItem(t);if(o){const n=JSON.parse(o);if(n!=null&&n.pageSettings)return n.pageSettings}}catch{}return null}applyPageSettingsToAllWrappers(e){document.querySelectorAll("[data-pagebuilder-content]").forEach(t=>{e.classes?t.setAttribute("class",e.classes):t.removeAttribute("class"),e.style?t.setAttribute("style",e.style):t.removeAttribute("style")}),(e.classes||e.style)&&(this._lastKnownPageSettings=e)}reconnectGlobalStylesObserver(){if(!this.globalStylesObserver)return;const e=document.querySelector("[data-pagebuilder-content]");if(!e)return;const t=document.querySelectorAll("[data-pagebuilder-content]");this.globalStylesObserver.disconnect(),this.globalStylesObserver=new MutationObserver(()=>{const o=e.getAttribute("class")??"",n=e.getAttribute("style")??"";t.forEach(a=>{a!==e&&(o?a.setAttribute("class",o):a.removeAttribute("class"),n?a.setAttribute("style",n):a.removeAttribute("style"))})}),this.globalStylesObserver.observe(e,{attributes:!0,attributeFilter:["class","style"]})}async setComponentsPreservingPageSettings(e){var n;const t=this.readCurrentPageSettings()??this._lastKnownPageSettings??null,o=this.globalStylesObserver!==null;(n=this.globalStylesObserver)==null||n.disconnect(),this.pageBuilderStateStore.setComponents(e),await i.nextTick(),await i.nextTick(),t&&(t.classes||t.style)&&this.applyPageSettingsToAllWrappers(t),o&&this.reconnectGlobalStylesObserver()}parseStyleString(e){return e.split(";").map(t=>t.trim()).filter(Boolean).reduce((t,o)=>{const[n,a]=o.split(":").map(l=>l.trim());return n&&a&&(t[n]=a),t},{})}deleteOldPageBuilderLocalStorage(){const e=this.pageBuilderStateStore.getPageBuilderConfig;if((e&&e.updateOrCreate&&e.updateOrCreate.formType)==="update"){let o=0;const n=[],a=new Date(Date.now()-336*60*60*1e3);for(let l=0;l<localStorage.length;l++){const s=localStorage.key(l);if(s&&s.startsWith("page-builder-update-resource-"))try{const p=localStorage.getItem(s);if(!p)continue;const c=JSON.parse(p).pageBuilderContentSavedAt;c&&new Date(c)<a&&(o++,n.push({Number:o,Key:s,SavedAt:c}),localStorage.removeItem(s))}catch{}}n.length>0&&(console.info(`Deleted ${n.length} localStorage item(s) older than ${a} days:`),console.table(n))}}startEditing(){this.hasStartedEditing=!0}async refreshListeners(){await i.nextTick(),await this.addListenersToEditableElements()}async resumeEditingFromDraft(){this.updateLocalStorageItemName();const e=this.getSavedPageHtml();e&&(await se(400),this.pageBuilderStateStore.setIsLoadingResumeEditing(!0),await this.mountComponentsToDOM(e),this.pageBuilderStateStore.setIsLoadingResumeEditing(!1)),await i.nextTick(),await this.addListenersToEditableElements(),this.pageBuilderStateStore.setIsLoadingResumeEditing(!1)}async restoreOriginalContent(){if(this.updateLocalStorageItemName(),this.pageBuilderStateStore.setIsRestoring(!0),await se(400),Array.isArray(this.originalComponents)){await this.clearClassesFromPage(),await this.clearInlineStylesFromPage();const e=this.renderComponentsToHtml(this.originalComponents);await this.mountComponentsToDOM(e),this.removeCurrentComponentsFromLocalStorage()}await i.nextTick(),await this.addListenersToEditableElements(),this.pageBuilderStateStore.setIsRestoring(!1)}async returnLatestComponents(){return await this.syncDomToStoreOnly(),await i.nextTick(),await this.addListenersToEditableElements(),this.pageBuilderStateStore.getComponents}getStorageItemNameForResource(){return this.getLocalStorageItemName.value}getSavedPageHtml(){if(!this.getLocalStorageItemName.value)return!1;const e=this.getLocalStorageItemName.value;if(!e)return!1;const t=localStorage.getItem(e);if(!t)return!1;const o=JSON.parse(t);if(o&&Array.isArray(o.components)){const n=o.pageSettings&&o.pageSettings.classes||"",a=o.pageSettings&&o.pageSettings.style||"",l=o.components.map(s=>{const c=new DOMParser().parseFromString(s.html_code,"text/html").querySelector("section");return c?(c.removeAttribute("data-componentid"),c.outerHTML):s.html_code}).join(`
|
|
394
|
+
`)):""}async generateFullPageHtml(){await this.syncDomToStoreOnly(),await i.nextTick();const e=this.pageBuilderStateStore.getComponents;if(!Array.isArray(e))return"";await i.nextTick(),await this.addListenersToEditableElements();const t=this.readCurrentPageSettings()??this._lastKnownPageSettings,o=document.createElement("div");return o.setAttribute("id","pagebuilder"),t!=null&&t.classes&&o.setAttribute("class",t.classes),t!=null&&t.style&&o.setAttribute("style",t.style),e.forEach(n=>{const s=new DOMParser().parseFromString(n.html_code,"text/html").querySelector("section");if(s){s.removeAttribute("data-componentid"),o.appendChild(document.importNode(s,!0));return}o.insertAdjacentHTML("beforeend",n.html_code)}),o.outerHTML}saveDomComponentsToLocalStorage(){this.updateLocalStorageItemName();const e=document.querySelector("#pagebuilder");if(!e)return;const t=e.querySelector("[hovered]");t&&t.removeAttribute("hovered");const o=[];e.querySelectorAll("section[data-componentid]").forEach(p=>{const d=this.cloneAndRemoveSelectionAttributes(p);d.removeAttribute("data-componentid"),o.push({html_code:d.outerHTML,title:d.getAttribute("data-component-title")||"Untitled Component"})});const n=document.querySelector("[data-pagebuilder-content]"),a={classes:(n==null?void 0:n.className)||"",style:(n==null?void 0:n.getAttribute("style"))||(n==null?void 0:n.style.cssText)||""},l={components:o,pageBuilderContentSavedAt:new Date().toISOString(),pageSettings:a},s=this.getHistoryBaseKey();if(s){const p=localStorage.getItem(s);if(p||localStorage.setItem(s,JSON.stringify(l)),p){const d=JSON.parse(p),c=d.components||[],m=l.components||[],b=m.length!==c.length||m.some((g,u)=>{const h=c[u];return!h||h.html_code!==g.html_code}),x=d.pageSettings&&d.pageSettings.classes!==l.pageSettings.classes||d.pageSettings&&d.pageSettings.style!==l.pageSettings.style;if(b||x){localStorage.setItem(s,JSON.stringify(l));let g=To.getHistory(s);const u=g[g.length-1];if(u){const h=JSON.stringify(u.components),f=JSON.stringify(l.components),w=JSON.stringify(u.pageSettings),y=JSON.stringify(l.pageSettings);if(h===f&&w===y)return}this.pageBuilderStateStore.getHistoryIndex<g.length-1&&(g=g.slice(0,this.pageBuilderStateStore.getHistoryIndex+1)),g.push(l),g.length>10&&(g=g.slice(g.length-10)),localStorage.setItem(s+"-history",JSON.stringify(g)),this.pageBuilderStateStore.setHistoryIndex(g.length-1),this.pageBuilderStateStore.setHistoryLength(g.length);return}}}}async removeCurrentComponentsFromLocalStorage(){this.updateLocalStorageItemName(),await i.nextTick();const e=this.getLocalStorageItemName.value;e&&localStorage.removeItem(e)}async handleFormSubmission(){const e=this.readCurrentPageSettings();if(e&&(this._lastKnownPageSettings=e),await this.removeCurrentComponentsFromLocalStorage(),this.deleteAllComponentsFromDOM(),this.pageBuilderStateStore.setComponents([]),e){this.updateLocalStorageItemName();const t=this.getLocalStorageItemName.value;if(t){const o={components:[],pageBuilderContentSavedAt:new Date().toISOString(),pageSettings:e};localStorage.setItem(t,JSON.stringify(o))}}}readCurrentPageSettings(){const e=document.querySelector("[data-pagebuilder-content]");if(e)return{classes:e.className||"",style:e.getAttribute("style")||e.style.cssText||""};this.updateLocalStorageItemName();const t=this.getLocalStorageItemName.value;if(t)try{const o=localStorage.getItem(t);if(o){const n=JSON.parse(o);if(n!=null&&n.pageSettings)return n.pageSettings}}catch{}return null}applyPageSettingsToAllWrappers(e){document.querySelectorAll("[data-pagebuilder-content]").forEach(t=>{e.classes?t.setAttribute("class",e.classes):t.removeAttribute("class"),e.style?t.setAttribute("style",e.style):t.removeAttribute("style")}),(e.classes||e.style)&&(this._lastKnownPageSettings=e)}reconnectGlobalStylesObserver(){if(!this.globalStylesObserver)return;const e=document.querySelector("[data-pagebuilder-content]");if(!e)return;const t=document.querySelectorAll("[data-pagebuilder-content]");this.globalStylesObserver.disconnect(),this.globalStylesObserver=new MutationObserver(()=>{const o=e.getAttribute("class")??"",n=e.getAttribute("style")??"";t.forEach(a=>{a!==e&&(o?a.setAttribute("class",o):a.removeAttribute("class"),n?a.setAttribute("style",n):a.removeAttribute("style"))})}),this.globalStylesObserver.observe(e,{attributes:!0,attributeFilter:["class","style"]})}async setComponentsPreservingPageSettings(e){var n;const t=this.readCurrentPageSettings()??this._lastKnownPageSettings??null,o=this.globalStylesObserver!==null;(n=this.globalStylesObserver)==null||n.disconnect(),this.pageBuilderStateStore.setComponents(e),await i.nextTick(),await i.nextTick(),t&&(t.classes||t.style)&&this.applyPageSettingsToAllWrappers(t),o&&this.reconnectGlobalStylesObserver()}parseStyleString(e){return e.split(";").map(t=>t.trim()).filter(Boolean).reduce((t,o)=>{const[n,a]=o.split(":").map(l=>l.trim());return n&&a&&(t[n]=a),t},{})}deleteOldPageBuilderLocalStorage(){const e=this.pageBuilderStateStore.getPageBuilderConfig;if((e&&e.updateOrCreate&&e.updateOrCreate.formType)==="update"){let o=0;const n=[],a=new Date(Date.now()-336*60*60*1e3);for(let l=0;l<localStorage.length;l++){const s=localStorage.key(l);if(s&&s.startsWith("page-builder-update-resource-"))try{const p=localStorage.getItem(s);if(!p)continue;const c=JSON.parse(p).pageBuilderContentSavedAt;c&&new Date(c)<a&&(o++,n.push({Number:o,Key:s,SavedAt:c}),localStorage.removeItem(s))}catch{}}n.length>0&&(console.info(`Deleted ${n.length} localStorage item(s) older than ${a} days:`),console.table(n))}}startEditing(){this.hasStartedEditing=!0}async refreshListeners(){await i.nextTick(),await this.addListenersToEditableElements()}async resumeEditingFromDraft(){this.updateLocalStorageItemName();const e=this.getSavedPageHtml();e&&(await se(400),this.pageBuilderStateStore.setIsLoadingResumeEditing(!0),await this.mountComponentsToDOM(e),this.pageBuilderStateStore.setIsLoadingResumeEditing(!1)),await i.nextTick(),await this.addListenersToEditableElements(),this.pageBuilderStateStore.setIsLoadingResumeEditing(!1)}async restoreOriginalContent(){if(this.updateLocalStorageItemName(),this.pageBuilderStateStore.setIsRestoring(!0),await se(400),Array.isArray(this.originalComponents)){await this.clearClassesFromPage(),await this.clearInlineStylesFromPage();const e=this.renderComponentsToHtml(this.originalComponents);await this.mountComponentsToDOM(e),this.removeCurrentComponentsFromLocalStorage()}await i.nextTick(),await this.addListenersToEditableElements(),this.pageBuilderStateStore.setIsRestoring(!1)}async returnLatestComponents(){return await this.syncDomToStoreOnly(),await i.nextTick(),await this.addListenersToEditableElements(),this.pageBuilderStateStore.getComponents}getStorageItemNameForResource(){return this.getLocalStorageItemName.value}getSavedPageHtml(){if(!this.getLocalStorageItemName.value)return!1;const e=this.getLocalStorageItemName.value;if(!e)return!1;const t=localStorage.getItem(e);if(!t)return!1;const o=JSON.parse(t);if(o&&Array.isArray(o.components)){const n=o.pageSettings&&o.pageSettings.classes||"",a=o.pageSettings&&o.pageSettings.style||"",l=o.components.map(s=>{const c=new DOMParser().parseFromString(s.html_code,"text/html").querySelector("section");return c?(c.removeAttribute("data-componentid"),c.outerHTML):s.html_code}).join(`
|
|
395
395
|
`);return`<div id="pagebuilder" class="${n}" style="${a}">
|
|
396
396
|
${l}
|
|
397
397
|
</div>`}return!1}async applySelectedImage(e){this.pageBuilderStateStore.setApplyImageToSelection(e),this.getElement.value&&this.getApplyImageToSelection.value&&this.getApplyImageToSelection.value.src&&(await i.nextTick(),this.pageBuilderStateStore.setBasePrimaryImage(`${this.getApplyImageToSelection.value.src}`),await this.handleAutoSave())}setBasePrimaryImageFromSelectedElement(){if(!this.getElement.value)return;const e=document.createElement("div");e.innerHTML=this.getElement.value.outerHTML;const t=e.getElementsByTagName("img"),o=e.getElementsByTagName("div");if(t.length===1&&o.length===0){this.pageBuilderStateStore.setBasePrimaryImage(t[0].src);return}this.pageBuilderStateStore.setBasePrimaryImage(null)}addHyperlinkToElement(e,t,o){if(!this.getElement.value||!(this.getElement.value instanceof HTMLElement)||typeof this.getElement.value.closest!="function")return;const n=this.getElement.value.closest("a"),a=this.getElement.value.querySelector("a");this.pageBuilderStateStore.setHyperlinkError(null);const l=/^https?:\/\//,s=i.ref(!0);if(e===!0&&t!==null&&(s.value=l.test(t)),s.value===!1){this.pageBuilderStateStore.setHyperlinkMessage(null),this.pageBuilderStateStore.setHyperlinkError("URL is not valid");return}if(e===!0&&typeof t=="string"){if(a!==null&&t.length!==0){a.href=t,o===!0&&(a.target="_blank"),o===!1&&a.removeAttribute("target"),a.textContent=this.getElement.value.textContent,this.pageBuilderStateStore.setHyperlinkMessage("Succesfully updated element hyperlink"),this.pageBuilderStateStore.setElementContainsHyperlink(!0);return}if(a===null&&t.length!==0&&n===null){const p=document.createElement("a");p.href=t,o===!0&&(p.target="_blank"),p.textContent=this.getElement.value.textContent,this.getElement.value.textContent="",this.getElement.value.appendChild(p),this.pageBuilderStateStore.setHyperlinkMessage("Successfully added hyperlink to element"),this.pageBuilderStateStore.setElementContainsHyperlink(!0);return}}if(e===!1&&t==="removeHyperlink"){const p=this.getElement.value.textContent||"",d=document.createTextNode(p);this.getElement.value.textContent="",this.getElement.value.appendChild(d),this.pageBuilderStateStore.setHyberlinkEnable(!1),this.pageBuilderStateStore.setElementContainsHyperlink(!1)}}checkForHyperlink(){if(!this.getElement.value)return;const e=this.getElement.value.querySelector("a");if(e!==null){this.pageBuilderStateStore.setHyberlinkEnable(!0),this.pageBuilderStateStore.setElementContainsHyperlink(!0),this.pageBuilderStateStore.setHyperlinkInput(e.href),this.pageBuilderStateStore.setHyperlinkMessage(null),this.pageBuilderStateStore.setHyperlinkError(null),e.target==="_blank"&&this.pageBuilderStateStore.setOpenHyperlinkInNewTab(!0),e.target!=="_blank"&&this.pageBuilderStateStore.setOpenHyperlinkInNewTab(!1);return}this.pageBuilderStateStore.setElementContainsHyperlink(!1),this.pageBuilderStateStore.setHyperlinkInput(""),this.pageBuilderStateStore.setHyperlinkError(null),this.pageBuilderStateStore.setHyperlinkMessage(null),this.pageBuilderStateStore.setHyberlinkEnable(!1)}handleHyperlink(e,t,o){var l;if(this.pageBuilderStateStore.setHyperlinkAbility(!0),!this.getElement.value||!(this.getElement.value instanceof HTMLElement)||typeof this.getElement.value.closest!="function")return;this.getElement.value.closest("a")!==null&&this.pageBuilderStateStore.setHyperlinkAbility(!1);const a=(l=this.getElement.value)==null?void 0:l.tagName.toUpperCase();if(a!=="P"&&a!=="H1"&&a!=="H2"&&a!=="H3"&&a!=="H4"&&a!=="H5"&&a!=="H6"&&this.pageBuilderStateStore.setHyperlinkAbility(!1),e===void 0){this.checkForHyperlink();return}this.addHyperlinkToElement(e,t||null,o||!1)}async addTheme(e){e&&(this.validateMountingHTML(e),await this.mountComponentsToDOM(e)),await this.handleAutoSave()}async analyzeSEO(){const e=await this.returnLatestComponents();if(!e||!Array.isArray(e)||e.length===0)return{score:0,checks:[]};const t=e.map(E=>E.html_code).filter(E=>E&&E.trim()!=="").join(`
|