@myissue/vue-website-page-builder 3.5.8 → 3.5.9
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.
|
@@ -505,7 +505,7 @@ export declare class PageBuilderService {
|
|
|
505
505
|
* Syncs the current DOM state of components to the in-memory store.
|
|
506
506
|
* @private
|
|
507
507
|
*/
|
|
508
|
-
syncDomToStoreOnly(): void
|
|
508
|
+
syncDomToStoreOnly(): Promise<void>;
|
|
509
509
|
generateHtmlFromComponents(): Promise<string>;
|
|
510
510
|
/**
|
|
511
511
|
* Saves the current DOM state of components to local storage.
|
|
@@ -530,6 +530,16 @@ export declare class PageBuilderService {
|
|
|
530
530
|
* if there are no [data-pagebuilder-content] elements.
|
|
531
531
|
*/
|
|
532
532
|
private readCurrentPageSettings;
|
|
533
|
+
/** Applies captured global page classes/styles to every section wrapper. */
|
|
534
|
+
private applyPageSettingsToAllWrappers;
|
|
535
|
+
/** Reconnects the global-styles MutationObserver after a Vue remount replaces wrapper nodes. */
|
|
536
|
+
private reconnectGlobalStylesObserver;
|
|
537
|
+
/**
|
|
538
|
+
* Updates the component store and re-renders the page without losing global page
|
|
539
|
+
* styles on [data-pagebuilder-content]. setComponents clears wrappers first, so
|
|
540
|
+
* settings must be captured before the remount and re-applied after Vue renders.
|
|
541
|
+
*/
|
|
542
|
+
private setComponentsPreservingPageSettings;
|
|
533
543
|
/**
|
|
534
544
|
* Parses a CSS style string into a key-value object.
|
|
535
545
|
* @param {string} style - The style string to parse.
|
|
@@ -6552,7 +6552,7 @@ const LP = /* @__PURE__ */ PP("pageBuilderState", {
|
|
|
6552
6552
|
}
|
|
6553
6553
|
}), x3 = kP(), we = LP(x3), zr = function(r) {
|
|
6554
6554
|
return !r || typeof r == "object" && r.constructor === Object && Object.keys(r).length === 0;
|
|
6555
|
-
}, EP = "3.5.
|
|
6555
|
+
}, EP = "3.5.9", AP = { 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" }, $P = { 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" }, BP = { class: "pbx-flex pbx-items-left pbx-flex-col pbx-gap-1" }, IP = { class: "pbx-myQuaternaryHeader" }, DP = { class: "pbx-myPrimaryParagraph pbx-text-xs" }, _P = { class: "pbx-px-2" }, HP = { class: "pbx-mt-8" }, OP = { class: "pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2" }, zP = { class: "pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg" }, NP = { class: "pbx-overflow-x-auto" }, RP = { class: "pbx-min-w-full" }, FP = { class: "pbx-bg-gray-50" }, jP = {
|
|
6556
6556
|
scope: "col",
|
|
6557
6557
|
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"
|
|
6558
6558
|
}, VP = {
|
|
@@ -35368,10 +35368,10 @@ class hW {
|
|
|
35368
35368
|
const e = this.findReverseableContainer();
|
|
35369
35369
|
if (!e) return;
|
|
35370
35370
|
const t = Array.from(e.children);
|
|
35371
|
-
t.length === 2 && (e.insertBefore(t[1], t[0]), this.syncDomToStoreOnly(), await oe(), this.saveDomComponentsToLocalStorage(), await this.handleAutoSave(), this.pageBuilderStateStore.setComponent(null), this.pageBuilderStateStore.setElement(null), await this.clearHtmlSelection(), await oe(), await this.addListenersToEditableElements());
|
|
35371
|
+
t.length === 2 && (e.insertBefore(t[1], t[0]), await this.syncDomToStoreOnly(), await oe(), this.saveDomComponentsToLocalStorage(), await this.handleAutoSave(), this.pageBuilderStateStore.setComponent(null), this.pageBuilderStateStore.setElement(null), await this.clearHtmlSelection(), await oe(), await this.addListenersToEditableElements());
|
|
35372
35372
|
}
|
|
35373
35373
|
async duplicateComponent() {
|
|
35374
|
-
this.syncDomToStoreOnly(), await oe();
|
|
35374
|
+
await this.syncDomToStoreOnly(), await oe();
|
|
35375
35375
|
const e = this.pageBuilderStateStore.getComponents, t = this.getComponent.value;
|
|
35376
35376
|
if (!e || !t) return;
|
|
35377
35377
|
const o = e.findIndex(
|
|
@@ -35383,14 +35383,14 @@ class hW {
|
|
|
35383
35383
|
i,
|
|
35384
35384
|
...e.slice(o + 1)
|
|
35385
35385
|
];
|
|
35386
|
-
this.
|
|
35386
|
+
await this.setComponentsPreservingPageSettings(n), await oe(), await this.addListenersToEditableElements(), this.pageBuilderStateStore.setComponent(i), this.pageBuilderStateStore.setElement(null), await this.handleAutoSave();
|
|
35387
35387
|
}
|
|
35388
35388
|
/**
|
|
35389
35389
|
* Deletes the currently selected component from the DOM and the state.
|
|
35390
35390
|
* @returns {Promise<void>}
|
|
35391
35391
|
*/
|
|
35392
35392
|
async deleteComponentFromDOM() {
|
|
35393
|
-
this.syncDomToStoreOnly(), await oe();
|
|
35393
|
+
await this.syncDomToStoreOnly(), await oe();
|
|
35394
35394
|
const e = this.pageBuilderStateStore.getComponents;
|
|
35395
35395
|
if (!e) return;
|
|
35396
35396
|
const t = e.findIndex(
|
|
@@ -35402,7 +35402,7 @@ class hW {
|
|
|
35402
35402
|
...e.slice(0, t),
|
|
35403
35403
|
...e.slice(t + 1)
|
|
35404
35404
|
];
|
|
35405
|
-
this.
|
|
35405
|
+
await this.setComponentsPreservingPageSettings(o), await oe(), await this.addListenersToEditableElements(), this.pageBuilderStateStore.setComponent(null), this.pageBuilderStateStore.setElement(null), await this.handleAutoSave();
|
|
35406
35406
|
}
|
|
35407
35407
|
/**
|
|
35408
35408
|
* Duplicates the currently selected element and inserts the copy immediately
|
|
@@ -35413,31 +35413,7 @@ class hW {
|
|
|
35413
35413
|
if (!e || !e.parentNode) return;
|
|
35414
35414
|
e.removeAttribute("selected");
|
|
35415
35415
|
const t = e.cloneNode(!0);
|
|
35416
|
-
e.parentNode.insertBefore(t, e.nextSibling);
|
|
35417
|
-
const o = e.closest("section");
|
|
35418
|
-
if (o) {
|
|
35419
|
-
const i = o.getAttribute("data-componentid");
|
|
35420
|
-
if (i) {
|
|
35421
|
-
const n = this.pageBuilderStateStore.getComponents;
|
|
35422
|
-
if (n) {
|
|
35423
|
-
const a = n.findIndex(
|
|
35424
|
-
(s) => s.id === i
|
|
35425
|
-
);
|
|
35426
|
-
if (a !== -1) {
|
|
35427
|
-
const s = {
|
|
35428
|
-
...n[a],
|
|
35429
|
-
html_code: o.outerHTML
|
|
35430
|
-
}, l = [
|
|
35431
|
-
...n.slice(0, a),
|
|
35432
|
-
s,
|
|
35433
|
-
...n.slice(a + 1)
|
|
35434
|
-
];
|
|
35435
|
-
this.pageBuilderStateStore.setComponents(l);
|
|
35436
|
-
}
|
|
35437
|
-
}
|
|
35438
|
-
}
|
|
35439
|
-
}
|
|
35440
|
-
this.syncDomToStoreOnly(), await oe(), await this.addListenersToEditableElements(), this.pageBuilderStateStore.setComponent(null), this.pageBuilderStateStore.setElement(null), this.saveDomComponentsToLocalStorage(), await this.handleAutoSave();
|
|
35416
|
+
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();
|
|
35441
35417
|
}
|
|
35442
35418
|
/**
|
|
35443
35419
|
* Deletes the currently selected element from the DOM and stores it for potential restoration.
|
|
@@ -35451,47 +35427,7 @@ class hW {
|
|
|
35451
35427
|
return;
|
|
35452
35428
|
}
|
|
35453
35429
|
const t = e.closest("section");
|
|
35454
|
-
|
|
35455
|
-
await this.deleteComponentFromDOM();
|
|
35456
|
-
else if (e.remove(), this.syncDomToStoreOnly(), t && this.isSectionEmpty(t)) {
|
|
35457
|
-
const o = t.getAttribute("data-componentid");
|
|
35458
|
-
if (o) {
|
|
35459
|
-
const i = this.pageBuilderStateStore.getComponents;
|
|
35460
|
-
if (i) {
|
|
35461
|
-
const n = i.findIndex((a) => a.id === o);
|
|
35462
|
-
if (n !== -1) {
|
|
35463
|
-
const a = [
|
|
35464
|
-
...i.slice(0, n),
|
|
35465
|
-
...i.slice(n + 1)
|
|
35466
|
-
];
|
|
35467
|
-
this.pageBuilderStateStore.setComponents(a), t.remove(), this.syncDomToStoreOnly(), this.saveDomComponentsToLocalStorage();
|
|
35468
|
-
}
|
|
35469
|
-
}
|
|
35470
|
-
}
|
|
35471
|
-
} else if (t) {
|
|
35472
|
-
const o = t.getAttribute("data-componentid");
|
|
35473
|
-
if (o) {
|
|
35474
|
-
const i = this.pageBuilderStateStore.getComponents;
|
|
35475
|
-
if (i) {
|
|
35476
|
-
const n = i.findIndex(
|
|
35477
|
-
(a) => a.id === o
|
|
35478
|
-
);
|
|
35479
|
-
if (n !== -1) {
|
|
35480
|
-
const a = {
|
|
35481
|
-
...i[n],
|
|
35482
|
-
html_code: t.outerHTML
|
|
35483
|
-
}, s = [
|
|
35484
|
-
...i.slice(0, n),
|
|
35485
|
-
a,
|
|
35486
|
-
...i.slice(n + 1)
|
|
35487
|
-
];
|
|
35488
|
-
this.pageBuilderStateStore.setComponents(s), this.syncDomToStoreOnly(), this.saveDomComponentsToLocalStorage();
|
|
35489
|
-
}
|
|
35490
|
-
}
|
|
35491
|
-
}
|
|
35492
|
-
} else
|
|
35493
|
-
this.syncDomToStoreOnly(), this.saveDomComponentsToLocalStorage();
|
|
35494
|
-
this.pageBuilderStateStore.setComponent(null), this.pageBuilderStateStore.setElement(null), await this.clearHtmlSelection(), await oe(), await this.addListenersToEditableElements();
|
|
35430
|
+
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 oe(), await this.addListenersToEditableElements();
|
|
35495
35431
|
}
|
|
35496
35432
|
/**
|
|
35497
35433
|
* Removes a CSS class from the currently selected element.
|
|
@@ -35611,25 +35547,21 @@ class hW {
|
|
|
35611
35547
|
* Syncs the current DOM state of components to the in-memory store.
|
|
35612
35548
|
* @private
|
|
35613
35549
|
*/
|
|
35614
|
-
syncDomToStoreOnly() {
|
|
35550
|
+
async syncDomToStoreOnly() {
|
|
35615
35551
|
const e = document.querySelector("#pagebuilder");
|
|
35616
35552
|
if (!e) return;
|
|
35617
|
-
const t =
|
|
35618
|
-
e.querySelectorAll("section[data-componentid]").forEach((
|
|
35619
|
-
const
|
|
35620
|
-
|
|
35621
|
-
html_code:
|
|
35622
|
-
id:
|
|
35623
|
-
title:
|
|
35624
|
-
});
|
|
35625
|
-
}), this.pageBuilderStateStore.setComponents(n), (o || i) && oe(() => {
|
|
35626
|
-
document.querySelectorAll("[data-pagebuilder-content]").forEach((a) => {
|
|
35627
|
-
o ? a.setAttribute("class", o) : a.removeAttribute("class"), i ? a.setAttribute("style", i) : a.removeAttribute("style");
|
|
35553
|
+
const t = [];
|
|
35554
|
+
e.querySelectorAll("section[data-componentid]").forEach((o) => {
|
|
35555
|
+
const i = this.cloneAndRemoveSelectionAttributes(o);
|
|
35556
|
+
t.push({
|
|
35557
|
+
html_code: i.outerHTML,
|
|
35558
|
+
id: i.getAttribute("data-componentid"),
|
|
35559
|
+
title: i.getAttribute("data-component-title") || "Untitled Component"
|
|
35628
35560
|
});
|
|
35629
|
-
});
|
|
35561
|
+
}), await this.setComponentsPreservingPageSettings(t);
|
|
35630
35562
|
}
|
|
35631
35563
|
async generateHtmlFromComponents() {
|
|
35632
|
-
this.syncDomToStoreOnly(), await oe();
|
|
35564
|
+
await this.syncDomToStoreOnly(), await oe();
|
|
35633
35565
|
const e = this.pageBuilderStateStore.getComponents;
|
|
35634
35566
|
return Array.isArray(e) ? (await oe(), await this.addListenersToEditableElements(), e.map((t) => t.html_code.replace(/data-componentid="[^"]*"/g, "").replace(/\s{2,}/g, " ")).join(`
|
|
35635
35567
|
`)) : "";
|
|
@@ -35742,6 +35674,38 @@ class hW {
|
|
|
35742
35674
|
}
|
|
35743
35675
|
return null;
|
|
35744
35676
|
}
|
|
35677
|
+
/** Applies captured global page classes/styles to every section wrapper. */
|
|
35678
|
+
applyPageSettingsToAllWrappers(e) {
|
|
35679
|
+
document.querySelectorAll("[data-pagebuilder-content]").forEach((t) => {
|
|
35680
|
+
e.classes ? t.setAttribute("class", e.classes) : t.removeAttribute("class"), e.style ? t.setAttribute("style", e.style) : t.removeAttribute("style");
|
|
35681
|
+
}), (e.classes || e.style) && (this._lastKnownPageSettings = e);
|
|
35682
|
+
}
|
|
35683
|
+
/** Reconnects the global-styles MutationObserver after a Vue remount replaces wrapper nodes. */
|
|
35684
|
+
reconnectGlobalStylesObserver() {
|
|
35685
|
+
if (!this.globalStylesObserver) return;
|
|
35686
|
+
const e = document.querySelector("[data-pagebuilder-content]");
|
|
35687
|
+
if (!e) return;
|
|
35688
|
+
const t = document.querySelectorAll("[data-pagebuilder-content]");
|
|
35689
|
+
this.globalStylesObserver.disconnect(), this.globalStylesObserver = new MutationObserver(() => {
|
|
35690
|
+
const o = e.getAttribute("class") ?? "", i = e.getAttribute("style") ?? "";
|
|
35691
|
+
t.forEach((n) => {
|
|
35692
|
+
n !== e && (o ? n.setAttribute("class", o) : n.removeAttribute("class"), i ? n.setAttribute("style", i) : n.removeAttribute("style"));
|
|
35693
|
+
});
|
|
35694
|
+
}), this.globalStylesObserver.observe(e, {
|
|
35695
|
+
attributes: !0,
|
|
35696
|
+
attributeFilter: ["class", "style"]
|
|
35697
|
+
});
|
|
35698
|
+
}
|
|
35699
|
+
/**
|
|
35700
|
+
* Updates the component store and re-renders the page without losing global page
|
|
35701
|
+
* styles on [data-pagebuilder-content]. setComponents clears wrappers first, so
|
|
35702
|
+
* settings must be captured before the remount and re-applied after Vue renders.
|
|
35703
|
+
*/
|
|
35704
|
+
async setComponentsPreservingPageSettings(e) {
|
|
35705
|
+
var i;
|
|
35706
|
+
const t = this.readCurrentPageSettings() ?? this._lastKnownPageSettings ?? null, o = this.globalStylesObserver !== null;
|
|
35707
|
+
(i = this.globalStylesObserver) == null || i.disconnect(), this.pageBuilderStateStore.setComponents(e), await oe(), await oe(), t && (t.classes || t.style) && this.applyPageSettingsToAllWrappers(t), o && this.reconnectGlobalStylesObserver();
|
|
35708
|
+
}
|
|
35745
35709
|
/**
|
|
35746
35710
|
* Parses a CSS style string into a key-value object.
|
|
35747
35711
|
* @param {string} style - The style string to parse.
|
|
@@ -35820,7 +35784,7 @@ class hW {
|
|
|
35820
35784
|
await oe(), await this.addListenersToEditableElements(), this.pageBuilderStateStore.setIsRestoring(!1);
|
|
35821
35785
|
}
|
|
35822
35786
|
async returnLatestComponents() {
|
|
35823
|
-
return this.syncDomToStoreOnly(), await oe(), await this.addListenersToEditableElements(), this.pageBuilderStateStore.getComponents;
|
|
35787
|
+
return await this.syncDomToStoreOnly(), await oe(), await this.addListenersToEditableElements(), this.pageBuilderStateStore.getComponents;
|
|
35824
35788
|
}
|
|
35825
35789
|
/**
|
|
35826
35790
|
* Gets the local storage key for the current resource.
|
|
@@ -36066,7 +36030,7 @@ ${a}
|
|
|
36066
36030
|
const b = document.querySelector(
|
|
36067
36031
|
"[data-pagebuilder-content]"
|
|
36068
36032
|
), u = (b == null ? void 0 : b.getAttribute("class")) || ((o = this._lastKnownPageSettings) == null ? void 0 : o.classes) || "", m = (b == null ? void 0 : b.getAttribute("style")) || ((i = this._lastKnownPageSettings) == null ? void 0 : i.style) || "";
|
|
36069
|
-
(n = this.globalStylesObserver) == null || n.disconnect(), this.syncDomToStoreOnly(), await oe();
|
|
36033
|
+
(n = this.globalStylesObserver) == null || n.disconnect(), await this.syncDomToStoreOnly(), await oe();
|
|
36070
36034
|
const x = this.pageBuilderStateStore.getComponents || [], g = [
|
|
36071
36035
|
...x.slice(0, t),
|
|
36072
36036
|
l,
|
|
@@ -18,7 +18,7 @@ Only state can be modified.`);l[0]="$state",to=!1,o.set(a,l,o.state.value),to=!0
|
|
|
18
18
|
state: () => new MyClass()
|
|
19
19
|
Found in store "${S.$id}".`),g&&a&&t.hydrate&&t.hydrate(S.$state,g),d=!0,c=!0,S}/*! #__NO_SIDE_EFFECTS__ */function bT(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"&&Ro&&Ro._testing?null:s)||(d?i.inject(w3,null):null),s&&Fo(s),process.env.NODE_ENV!=="production"&&!Ro)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=Ro,s._s.has(o)||(a?al(o,e,n,s):_3(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?al(m,e,n,s,!0):_3(m,it({},n),s,!0);p._hotUpdate(b),delete s.state.value[m],s._s.delete(m)}if(process.env.NODE_ENV!=="production"&&er){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 H3=bT("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,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},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},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}}}),ll=L3(),re=H3(ll),rr=function(r){return!r||typeof r=="object"&&r.constructor===Object&&Object.keys(r).length===0},xT="3.5.8",gT={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"},uT={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"},hT={class:"pbx-flex pbx-items-left pbx-flex-col pbx-gap-1"},fT={class:"pbx-myQuaternaryHeader"},yT={class:"pbx-myPrimaryParagraph pbx-text-xs"},wT={class:"pbx-px-2"},vT={class:"pbx-mt-8"},kT={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},ST={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},CT={class:"pbx-overflow-x-auto"},ET={class:"pbx-min-w-full"},TT={class:"pbx-bg-gray-50"},MT={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"},NT={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"},PT={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},BT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},LT={class:"pbx-min-w-[30rem] pbx-w-max"},AT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},DT={class:"pbx-min-w-[30rem] pbx-w-max"},VT={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"},zT={key:0,class:"pbx-mt-4"},IT={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},_T={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},HT={class:"pbx-overflow-x-auto"},OT={class:"pbx-min-w-full"},RT={class:"pbx-bg-gray-50"},FT={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"},jT={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"},qT={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},UT={key:0},WT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},GT={class:"pbx-min-w-[30rem] pbx-w-max"},JT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},KT={class:"pbx-min-w-[30rem] pbx-w-max"},YT={key:1},XT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},QT={class:"pbx-min-w-[30rem] pbx-w-max"},ZT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},$T={class:"pbx-min-w-[30rem] pbx-w-max"},e8={key:1,class:"pbx-mt-8"},t8={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},r8={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"},i8={class:"pbx-min-w-full"},n8={class:"pbx-bg-gray-50"},a8={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"},l8={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"},s8={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},p8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},d8={class:"pbx-min-w-[30rem] pbx-w-max"},c8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},m8={class:"pbx-min-w-[30rem] pbx-w-max"},b8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},x8={class:"pbx-min-w-[30rem] pbx-w-max"},g8={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"},h8={key:0,class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},f8={class:"pbx-min-w-[30rem] pbx-w-max"},y8={class:"pbx-flex pbx-items-center pbx-space-x-3"},w8=["src"],v8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},k8={class:"pbx-min-w-[30rem] pbx-w-max"},S8={key:0,class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},C8={class:"pbx-min-w-[30rem] pbx-w-max"},E8={key:2,class:"pbx-mt-8"},T8={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},M8={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},N8={class:"pbx-overflow-x-auto"},P8={class:"pbx-min-w-full"},B8={class:"pbx-bg-gray-50"},L8={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"},A8={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"},D8={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},V8={key:0},z8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},I8={class:"pbx-min-w-[30rem] pbx-w-max"},_8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},H8={class:"pbx-min-w-[30rem] pbx-w-max"},O8={key:1},R8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},F8={class:"pbx-min-w-[30rem] pbx-w-max"},j8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},q8={class:"pbx-min-w-[30rem] pbx-w-max"},U8={key:2},W8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},G8={class:"pbx-min-w-[30rem] pbx-w-max"},J8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},K8={class:"pbx-min-w-[30rem] pbx-w-max"},Y8={key:3,class:"pbx-mt-8"},X8={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},Q8={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},Z8={class:"pbx-overflow-x-auto"},$8={class:"pbx-min-w-full"},e7={class:"pbx-bg-gray-50"},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={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"},o7={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},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={class:"pbx-flex pbx-items-center pbx-space-x-3"},p7=["src"],d7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},c7={class:"pbx-min-w-[30rem] pbx-w-max"},m7={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"},x7={class:"pbx-flex pbx-items-center pbx-space-x-3"},g7={class:"pbx-pr-6"},u7={class:"pbx-flex pbx-items-center pbx-space-x-3"},h7={class:"pbx-whitespace-nowrap"},f7={key:4,class:"pbx-mt-8"},y7={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},w7={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},v7={class:"pbx-overflow-x-auto"},k7={class:"pbx-w-max"},S7={class:"pbx-bg-gray-50"},C7={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"},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={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},M7={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"},P7={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"},L7={key:0},A7={key:1},D7={key:0},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={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},_7={class:"pbx-min-w-[30rem] pbx-w-max"},H7={class:"pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium"},O7={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"},R7={class:"pbx-flex pbx-items-left pbx-flex-col pbx-gap-1"},F7={class:"pbx-myQuaternaryHeader"},j7={class:"pbx-myPrimaryParagraph pbx-text-xs"},q7={class:"pbx-mt-4 pbx-whitespace-pre-wrap pbx-text-white pbx-overflow-hidden pbx-bg-gray-900"},U7={class:"pbx-flex bg-gray-800/40 pbx-ring-1 ring-white/5"},W7={class:"pbx-mb-px pbx-flex pbx-text-xs pbx-font-medium pbx-text-myPrimaryMediumGrayColor"},G7={class:"pbx-px-4 pbx-py-4 pbx-text-white"},J7={class:"pbx-px-4 pbx-pb-8 pbx-pt-4 pbx-text-white pbx-text-xs pbx-break-all"},K7={class:"pbx-myPrimaryParagraph pbx-text-xs pbx-text-white"},Y7=i.defineComponent({__name:"PageBuilderSettings",setup(r){const{translate:e}=te(),t=re,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",gT,[i.createElementVNode("div",uT,[i.createElementVNode("div",null,[i.createElementVNode("div",hT,[i.createElementVNode("h3",fT,i.toDisplayString(i.unref(e)("Configuration Overview")),1),i.createElementVNode("p",yT,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",wT,[i.createElementVNode("div",vT,[i.createElementVNode("h4",kT,i.toDisplayString(i.unref(e)("Version Information")),1),i.createElementVNode("div",ST,[i.createElementVNode("div",CT,[i.createElementVNode("table",ET,[i.createElementVNode("thead",TT,[i.createElementVNode("tr",null,[i.createElementVNode("th",MT,i.toDisplayString(i.unref(e)("App")),1),i.createElementVNode("th",NT,i.toDisplayString(i.unref(e)("Version")),1)])]),i.createElementVNode("tbody",PT,[i.createElementVNode("tr",null,[i.createElementVNode("td",BT,[i.createElementVNode("div",LT,i.toDisplayString(i.unref(e)("Page Builder")),1)]),i.createElementVNode("td",AT,[i.createElementVNode("div",DT,[i.createElementVNode("span",VT,i.toDisplayString(i.unref(xT)),1)])])])])])])])]),(l=o.value)!=null&&l.resourceData&&!i.unref(rr)(o.value.resourceData)?(i.openBlock(),i.createElementBlock("div",zT,[i.createElementVNode("h4",IT,i.toDisplayString(i.unref(e)("Resource Data")),1),i.createElementVNode("div",_T,[i.createElementVNode("div",HT,[i.createElementVNode("table",OT,[i.createElementVNode("thead",RT,[i.createElementVNode("tr",null,[i.createElementVNode("th",FT,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",jT,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",qT,[(p=(s=o.value)==null?void 0:s.resourceData)!=null&&p.title?(i.openBlock(),i.createElementBlock("tr",UT,[i.createElementVNode("td",WT,[i.createElementVNode("div",GT,i.toDisplayString(i.unref(e)("Title")),1)]),i.createElementVNode("td",JT,[i.createElementVNode("div",KT,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",YT,[i.createElementVNode("td",XT,[i.createElementVNode("div",QT,i.toDisplayString(i.unref(e)("ID")),1)]),i.createElementVNode("td",ZT,[i.createElementVNode("div",$T,i.toDisplayString(o.value.resourceData.id),1)])])):i.createCommentVNode("",!0)])])])])])):i.createCommentVNode("",!0),(m=o.value)!=null&&m.userForPageBuilder&&!i.unref(rr)(o.value.userForPageBuilder)?(i.openBlock(),i.createElementBlock("div",e8,[i.createElementVNode("h4",t8,i.toDisplayString(i.unref(e)("User Information")),1),i.createElementVNode("div",r8,[i.createElementVNode("div",o8,[i.createElementVNode("table",i8,[i.createElementVNode("thead",n8,[i.createElementVNode("tr",null,[i.createElementVNode("th",a8,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",l8,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",s8,[i.createElementVNode("tr",null,[i.createElementVNode("td",p8,[i.createElementVNode("div",d8,i.toDisplayString(i.unref(e)("User Name")),1)]),i.createElementVNode("td",c8,[i.createElementVNode("div",m8,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",b8,[i.createElementVNode("div",x8,i.toDisplayString(o.value.userForPageBuilder.id),1)])]),i.createElementVNode("tr",null,[i.createElementVNode("td",g8,[i.createElementVNode("div",u8,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",h8,[i.createElementVNode("div",f8,[i.createElementVNode("div",y8,[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,w8)])])])):i.createCommentVNode("",!0)]),i.createElementVNode("tr",null,[i.createElementVNode("td",v8,[i.createElementVNode("div",k8,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",S8,[i.createElementVNode("div",C8,i.toDisplayString(o.value.userForPageBuilder.image),1)])):i.createCommentVNode("",!0)])])])])])])):i.createCommentVNode("",!0),(b=o.value)!=null&&b.userSettings&&!i.unref(rr)(o.value.userSettings)?(i.openBlock(),i.createElementBlock("div",E8,[i.createElementVNode("h4",T8,i.toDisplayString(i.unref(e)("User Settings")),1),i.createElementVNode("div",M8,[i.createElementVNode("div",N8,[i.createElementVNode("table",P8,[i.createElementVNode("thead",B8,[i.createElementVNode("tr",null,[i.createElementVNode("th",L8,i.toDisplayString(i.unref(e)("Setting")),1),i.createElementVNode("th",A8,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",D8,[(g=(x=o.value)==null?void 0:x.userSettings)!=null&&g.language?(i.openBlock(),i.createElementBlock("tr",V8,[i.createElementVNode("td",z8,[i.createElementVNode("div",I8,i.toDisplayString(i.unref(e)("Language")),1)]),i.createElementVNode("td",_8,[i.createElementVNode("div",H8,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",O8,[i.createElementVNode("td",R8,[i.createElementVNode("div",F8,i.toDisplayString(i.unref(e)("Auto Save")),1)]),i.createElementVNode("td",j8,[i.createElementVNode("div",q8,[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",U8,[i.createElementVNode("td",W8,[i.createElementVNode("div",G8,i.toDisplayString(i.unref(e)("Notifications")),1)]),i.createElementVNode("td",J8,[i.createElementVNode("div",K8,[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(rr)(o.value.pageBuilderLogo)?(i.openBlock(),i.createElementBlock("div",Y8,[i.createElementVNode("h4",X8,i.toDisplayString(i.unref(e)("Logo Configuration")),1),i.createElementVNode("div",Q8,[i.createElementVNode("div",Z8,[i.createElementVNode("table",$8,[i.createElementVNode("thead",e7,[i.createElementVNode("tr",null,[i.createElementVNode("th",t7,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",r7,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",o7,[i.createElementVNode("tr",null,[i.createElementVNode("td",i7,[i.createElementVNode("div",n7,i.toDisplayString(i.unref(e)("Logo")),1)]),i.createElementVNode("td",a7,[i.createElementVNode("div",l7,[i.createElementVNode("div",s7,[i.createElementVNode("img",{class:"pbx-h-4",src:o.value.pageBuilderLogo.src,alt:"Logo"},null,8,p7)])])])]),i.createElementVNode("tr",null,[i.createElementVNode("td",d7,[i.createElementVNode("div",c7,i.toDisplayString(i.unref(e)("Logo URL")),1)]),i.createElementVNode("td",m7,[i.createElementVNode("div",b7,[i.createElementVNode("div",x7,[i.createElementVNode("div",g7,[i.createElementVNode("div",u7,[i.createElementVNode("span",h7,i.toDisplayString(o.value.pageBuilderLogo.src),1)])])])])])])])])])])])):i.createCommentVNode("",!0),(y=o.value)!=null&&y.updateOrCreate&&!i.unref(rr)(o.value.updateOrCreate)?(i.openBlock(),i.createElementBlock("div",f7,[i.createElementVNode("h4",y7,i.toDisplayString(i.unref(e)("Form Type")),1),i.createElementVNode("div",w7,[i.createElementVNode("div",v7,[i.createElementVNode("table",k7,[i.createElementVNode("thead",S7,[i.createElementVNode("tr",null,[i.createElementVNode("th",C7,i.toDisplayString(i.unref(e)("Mode")),1),i.createElementVNode("th",E7,i.toDisplayString(i.unref(e)("Description")),1)])]),i.createElementVNode("tbody",T7,[i.createElementVNode("tr",null,[i.createElementVNode("td",M7,[i.createElementVNode("div",N7,i.toDisplayString(i.unref(e)("Form Type")),1)]),i.createElementVNode("td",P7,[i.createElementVNode("div",B7,[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",L7,i.toDisplayString(o.value.updateOrCreate.formType),1)):i.createCommentVNode("",!0),o.value&&o.value.updateOrCreate.formType==="update"?(i.openBlock(),i.createElementBlock("span",A7,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",D7,[i.createElementVNode("td",V7,[i.createElementVNode("div",z7,i.toDisplayString(i.unref(e)("Form Name")),1)]),i.createElementVNode("td",I7,[i.createElementVNode("div",_7,[i.createElementVNode("span",H7,i.toDisplayString(o.value.updateOrCreate.formName),1)])])])):i.createCommentVNode("",!0)])])])])])):i.createCommentVNode("",!0)])])]),i.createElementVNode("div",O7,[i.createElementVNode("div",R7,[i.createElementVNode("h3",F7,i.toDisplayString(i.unref(e)("Complete Configuration Overview")),1),i.createElementVNode("p",j7,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",q7,[i.createElementVNode("div",U7,[i.createElementVNode("div",W7,[i.createElementVNode("div",G7,i.toDisplayString(i.unref(e)("Configuration")),1)])]),i.createElementVNode("div",J7,[i.createElementVNode("p",K7," config: "+i.toDisplayString(JSON.stringify(o.value,null,4)),1)])])])])}}}),X7={key:0,class:"pbx-fixed pbx-inset-0 pbx-z-[9999]"},Q7={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"},Z7={class:"pbx-myQuaternaryHeader pbx-my-0 pbx-py-0 pbx-text-black"},$7={class:"pbx-pt-4 pbx-px-2"},eM=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}}},emits:["closeSidebarPanel"],setup(r,{emit:e}){const t=e,o=()=>{t("closeSidebarPanel")};return(n,a)=>(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",X7,[i.createElementVNode("div",{class:"pbx-fixed pbx-inset-0 pbx-bg-black pbx-opacity-20 pbx-z-40",onClick:o}),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:a[0]||(a[0]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",Q7,[i.createElementVNode("span",Z7,i.toDisplayString(r.title),1),i.createElementVNode("span",{onClick:o},[...a[1]||(a[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",$7,[i.renderSlot(n.$slots,"default")])],2)])):i.createCommentVNode("",!0)]),_:3})]))}}),tM={class:"pbx-flex pbx-flex-col pbx-items-center pbx-justify-center pbx-myPrimaryGap"},rM={class:"pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center pbx-relative"},oM={class:"pbx-overflow-y-auto"},iM={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2"},nM={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"},aM={class:"pbx-bg-gray-100 pbx-rounded-full pbx-w-32 pbx-h-32 pbx-flex pbx-items-center pbx-justify-center"},lM={class:"pbx-text-center"},sM={class:"pbx-lg:pbx-text-7xl pbx-text-5xl"},pM={key:0,class:"pbx-w-full pbx-space-y-6"},dM={class:"pbx-text-xl pbx-font-semibold pbx-mb-4 pbx-text-center"},cM={class:"pbx-text-sm pbx-font-semibold pbx-uppercase pbx-tracking-widest pbx-text-gray-400 pbx-mb-3 pbx-px-1"},mM={class:"pbx-space-y-3"},bM={class:"pbx-flex-shrink-0 pbx-mt-1"},xM={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"},gM={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"},uM={class:"pbx-flex-1"},hM={class:"pbx-text-sm pbx-text-gray-600"},fM={key:1,class:"pbx-text-gray-500 pbx-text-center"},yM={class:"pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center"},wM=i.defineComponent({__name:"ComponentTopMenu",setup(r){const{translate:e}=te(),t=me(),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 pe(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),k=i.ref(!1),T=i.computed(()=>{if(!y.value)return[];const M=new Map;for(const C of y.value.checks){const A=C.category??"Other";M.has(A)||M.set(A,[]),M.get(A).push(C)}return Array.from(M.entries()).map(([C,A])=>({title:C,checks:A}))}),L=async function(){k.value=!k.value,k.value&&(y.value=await t.analyzeSEO())},S=function(){k.value=!1};return(M,C)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",tM,[i.createElementVNode("div",rM,[i.createElementVNode("div",{onClick:L,"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":k.value}])},[...C[4]||(C[4]=[i.createElementVNode("div",{class:"pbx-font-semibold pbx-text-sm"},"SEO",-1)])],2),i.createVNode(eM,{title:"SEO",showSidebarPanel:k.value,onCloseSidebarPanel:S,position:"left"},{default:i.withCtx(()=>[i.createElementVNode("div",oM,[i.createElementVNode("div",null,[i.createElementVNode("div",iM,[i.createElementVNode("div",nM,[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",aM,[i.createElementVNode("div",lM,[i.createElementVNode("span",sM,i.toDisplayString(y.value.score),1),C[5]||(C[5]=i.createElementVNode("span",{class:"pbx-text-xl"},"%",-1))])])],4)):i.createCommentVNode("",!0)])]),T.value.length?(i.openBlock(),i.createElementBlock("div",pM,[i.createElementVNode("h3",dM,i.toDisplayString(i.unref(e)("SEO Check Results")),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(T.value,A=>(i.openBlock(),i.createElementBlock("div",{key:A.title},[i.createElementVNode("h4",cM,i.toDisplayString(i.unref(e)(A.title)),1),i.createElementVNode("ul",mM,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.checks,(E,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",E.passed?"pbx-border-emerald-500":"pbx-border-red-600"])},[i.createElementVNode("div",bM,[E.passed?(i.openBlock(),i.createElementBlock("div",xM,[...C[6]||(C[6]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," check ",-1)])])):i.createCommentVNode("",!0),E.passed?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",gM,[...C[7]||(C[7]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," check_indeterminate_small ",-1)])]))]),i.createElementVNode("div",uM,[i.createElementVNode("p",{class:i.normalizeClass(["pbx-text-lg pbx-font-medium",E.passed?"pbx-text-green-700":"pbx-text-red-700"])},i.toDisplayString(i.unref(e)(E.check)),3),i.createElementVNode("p",hM,i.toDisplayString(E.details),1)])],2))),128))])]))),128))])):(i.openBlock(),i.createElementBlock("div",fM,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",yM,[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(xt,{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(Y7)]),_:1},8,["showModalBuilder"])]))}});function Pe(r){this.content=r}Pe.prototype={constructor:Pe,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 Pe(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 Pe(t)},addToStart:function(r,e){return new Pe([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Pe(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 Pe(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=Pe.from(r),r.size?new Pe(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Pe.from(r),r.size?new Pe(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Pe.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}},Pe.from=function(r){if(r instanceof Pe)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Pe(e)};function O3(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&&j3(l.charCodeAt(p-1))&&F3(l.charCodeAt(p))&&t--,t}if(n.content.size||a.content.size){let l=O3(n.content,a.content,t+1);if(l!=null)return l}t+=n.nodeSize}}function R3(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&&j3(d.charCodeAt(m-1))&&F3(d.charCodeAt(m))&&(t++,o++),{a:t,b:o}}if(l.content.size||s.content.size){let d=R3(l.content,s.content,t-1,o-1);if(d)return d}t-=p,o-=p}}function F3(r){return r>=56320&&r<57344}function j3(r){return r>=55296&&r<56320}let I=class Ke{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 Ke(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 Ke(o,n)}cutByIndex(e,t){return e==t?Ke.empty:e==0&&t==this.content.length?this:new Ke(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 Ke(n,a)}addToStart(e){return new Ke([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ke(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 O3(this,e,t)}findDiffEnd(e,t=this.size,o=e.size){return R3(this,e,t,o)}findIndex(e){if(e==0)return ln(0,e);if(e==this.size)return ln(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?ln(t+1,a):ln(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 Ke.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return Ke.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ke.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 Ke(t||e,o)}static from(e){if(!e)return Ke.empty;if(e instanceof Ke)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ke([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 sl={index:0,offset:0};function ln(r,e){return sl.index=r,sl.offset=e,sl}function sn(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(!sn(r[o],e[o]))return!1}else{for(let o in r)if(!(o in e)||!sn(r[o],e[o]))return!1;for(let o in e)if(!(o in r))return!1}return!0}let $=class Tp{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&&sn(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 Tp.none;if(e instanceof Tp)return[e];let t=e.slice();return t.sort((o,n)=>o.type.rank-n.type.rank),t}};$.none=[];let jo=class extends Error{},O=class Io{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=U3(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return o&&new Io(o,this.openStart,this.openEnd)}removeBetween(e,t){return new Io(q3(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 Io.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 Io(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 Io(e,o,n)}};O.empty=new O(I.empty,0,0);function q3(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(q3(a.content,e-n-1,t-n-1)))}function U3(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=U3(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 vM(r,e,t){if(t.openStart>r.depth)throw new jo("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new jo("Inconsistent open depths");return W3(r,e,t,0)}function W3(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=W3(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 Lr(l,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:l,end:s}=kM(t,r);return Lr(a,J3(r,l,s,e,o))}else return Lr(a,pn(r,e,o))}function G3(r,e){if(!e.type.compatibleContent(r.type))throw new jo("Cannot join "+e.type.name+" onto "+r.type.name)}function pl(r,e,t){let o=r.node(t);return G3(o,e.node(t)),o}function Br(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 qo(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&&(Br(r.nodeAfter,o),a++));for(let s=a;s<l;s++)Br(n.child(s),o);e&&e.depth==t&&e.textOffset&&Br(e.nodeBefore,o)}function Lr(r,e){if(!r.type.validContent(e))throw new jo("Invalid content for node "+r.type.name);return r.copy(e)}function J3(r,e,t,o,n){let a=r.depth>n&&pl(r,e,n+1),l=o.depth>n&&pl(t,o,n+1),s=[];return qo(null,r,n,s),a&&l&&e.index(n)==t.index(n)?(G3(a,l),Br(Lr(a,J3(r,e,t,o,n+1)),s)):(a&&Br(Lr(a,pn(r,e,n+1)),s),qo(e,t,n,s),l&&Br(Lr(l,pn(t,o,n+1)),s)),qo(o,null,n,s),new I(s)}function pn(r,e,t){let o=[];if(qo(null,r,t,o),r.depth>t){let n=pl(r,e,t+1);Br(Lr(n,pn(r,e,t+1)),o)}return qo(e,null,t,o),new I(o)}function kM(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 Uo{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 $.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 dn(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 Uo(t,o,a)}static resolveCached(e,t){let o=K3.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 K3.set(e,o=new SM);let n=o.elts[o.i]=Uo.resolve(e,t);return o.i=(o.i+1)%CM,n}}class SM{constructor(){this.elts=[],this.i=0}}const CM=12,K3=new WeakMap;class dn{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 EM=Object.create(null);let or=class Mp{constructor(e,t,o,n=$.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&&sn(this.attrs,t||e.defaultAttrs||EM)&&$.sameSet(this.marks,o||$.none)}copy(e=null){return e==this.content?this:new Mp(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Mp(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 O.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 O(d,n.depth-l,a.depth-l)}replace(e,t,o){return vM(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 Uo.resolveCached(this,e)}resolveNoCache(e){return Uo.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()+")"),Y3(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=$.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(!$.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}};or.prototype.text=void 0;class cn extends or{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):Y3(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 cn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new cn(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 Y3(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class Ar{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let o=new TM(e,t);if(o.next==null)return Ar.empty;let n=X3(o);o.next&&o.err("Unexpected trailing text");let a=DM(AM(n));return VM(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=Ro,s._s.has(o)||(a?al(o,e,n,s):_3(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?al(m,e,n,s,!0):_3(m,it({},n),s,!0);p._hotUpdate(b),delete s.state.value[m],s._s.delete(m)}if(process.env.NODE_ENV!=="production"&&er){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 H3=bT("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,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},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},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}}}),ll=L3(),re=H3(ll),rr=function(r){return!r||typeof r=="object"&&r.constructor===Object&&Object.keys(r).length===0},xT="3.5.9",gT={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"},uT={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"},hT={class:"pbx-flex pbx-items-left pbx-flex-col pbx-gap-1"},fT={class:"pbx-myQuaternaryHeader"},yT={class:"pbx-myPrimaryParagraph pbx-text-xs"},wT={class:"pbx-px-2"},vT={class:"pbx-mt-8"},kT={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},ST={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},CT={class:"pbx-overflow-x-auto"},ET={class:"pbx-min-w-full"},TT={class:"pbx-bg-gray-50"},MT={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"},NT={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"},PT={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},BT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},LT={class:"pbx-min-w-[30rem] pbx-w-max"},AT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},DT={class:"pbx-min-w-[30rem] pbx-w-max"},VT={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"},zT={key:0,class:"pbx-mt-4"},IT={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},_T={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},HT={class:"pbx-overflow-x-auto"},OT={class:"pbx-min-w-full"},RT={class:"pbx-bg-gray-50"},FT={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"},jT={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"},qT={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},UT={key:0},WT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},GT={class:"pbx-min-w-[30rem] pbx-w-max"},JT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},KT={class:"pbx-min-w-[30rem] pbx-w-max"},YT={key:1},XT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},QT={class:"pbx-min-w-[30rem] pbx-w-max"},ZT={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},$T={class:"pbx-min-w-[30rem] pbx-w-max"},e8={key:1,class:"pbx-mt-8"},t8={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},r8={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"},i8={class:"pbx-min-w-full"},n8={class:"pbx-bg-gray-50"},a8={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"},l8={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"},s8={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},p8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},d8={class:"pbx-min-w-[30rem] pbx-w-max"},c8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},m8={class:"pbx-min-w-[30rem] pbx-w-max"},b8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},x8={class:"pbx-min-w-[30rem] pbx-w-max"},g8={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"},h8={key:0,class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},f8={class:"pbx-min-w-[30rem] pbx-w-max"},y8={class:"pbx-flex pbx-items-center pbx-space-x-3"},w8=["src"],v8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},k8={class:"pbx-min-w-[30rem] pbx-w-max"},S8={key:0,class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},C8={class:"pbx-min-w-[30rem] pbx-w-max"},E8={key:2,class:"pbx-mt-8"},T8={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},M8={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},N8={class:"pbx-overflow-x-auto"},P8={class:"pbx-min-w-full"},B8={class:"pbx-bg-gray-50"},L8={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"},A8={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"},D8={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},V8={key:0},z8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},I8={class:"pbx-min-w-[30rem] pbx-w-max"},_8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},H8={class:"pbx-min-w-[30rem] pbx-w-max"},O8={key:1},R8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},F8={class:"pbx-min-w-[30rem] pbx-w-max"},j8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},q8={class:"pbx-min-w-[30rem] pbx-w-max"},U8={key:2},W8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},G8={class:"pbx-min-w-[30rem] pbx-w-max"},J8={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},K8={class:"pbx-min-w-[30rem] pbx-w-max"},Y8={key:3,class:"pbx-mt-8"},X8={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},Q8={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},Z8={class:"pbx-overflow-x-auto"},$8={class:"pbx-min-w-full"},e7={class:"pbx-bg-gray-50"},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={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"},o7={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},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={class:"pbx-flex pbx-items-center pbx-space-x-3"},p7=["src"],d7={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-font-medium pbx-text-gray-900"},c7={class:"pbx-min-w-[30rem] pbx-w-max"},m7={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"},x7={class:"pbx-flex pbx-items-center pbx-space-x-3"},g7={class:"pbx-pr-6"},u7={class:"pbx-flex pbx-items-center pbx-space-x-3"},h7={class:"pbx-whitespace-nowrap"},f7={key:4,class:"pbx-mt-8"},y7={class:"pbx-myQuaternaryHeader pbx-text-sm pbx-mb-2"},w7={class:"pbx-overflow-hidden pbx-shadow pbx-ring-1 pbx-ring-black pbx-ring-opacity-5 md:pbx-rounded-lg"},v7={class:"pbx-overflow-x-auto"},k7={class:"pbx-w-max"},S7={class:"pbx-bg-gray-50"},C7={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"},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={class:"pbx-bg-white pbx-divide-y pbx-divide-gray-200"},M7={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"},P7={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"},L7={key:0},A7={key:1},D7={key:0},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={class:"pbx-px-6 pbx-py-4 pbx-whitespace-nowrap pbx-text-sm pbx-text-gray-500"},_7={class:"pbx-min-w-[30rem] pbx-w-max"},H7={class:"pbx-inline-flex pbx-items-center pbx-px-2.5 pbx-py-0.5 pbx-rounded-full pbx-text-xs pbx-font-medium"},O7={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"},R7={class:"pbx-flex pbx-items-left pbx-flex-col pbx-gap-1"},F7={class:"pbx-myQuaternaryHeader"},j7={class:"pbx-myPrimaryParagraph pbx-text-xs"},q7={class:"pbx-mt-4 pbx-whitespace-pre-wrap pbx-text-white pbx-overflow-hidden pbx-bg-gray-900"},U7={class:"pbx-flex bg-gray-800/40 pbx-ring-1 ring-white/5"},W7={class:"pbx-mb-px pbx-flex pbx-text-xs pbx-font-medium pbx-text-myPrimaryMediumGrayColor"},G7={class:"pbx-px-4 pbx-py-4 pbx-text-white"},J7={class:"pbx-px-4 pbx-pb-8 pbx-pt-4 pbx-text-white pbx-text-xs pbx-break-all"},K7={class:"pbx-myPrimaryParagraph pbx-text-xs pbx-text-white"},Y7=i.defineComponent({__name:"PageBuilderSettings",setup(r){const{translate:e}=te(),t=re,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",gT,[i.createElementVNode("div",uT,[i.createElementVNode("div",null,[i.createElementVNode("div",hT,[i.createElementVNode("h3",fT,i.toDisplayString(i.unref(e)("Configuration Overview")),1),i.createElementVNode("p",yT,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",wT,[i.createElementVNode("div",vT,[i.createElementVNode("h4",kT,i.toDisplayString(i.unref(e)("Version Information")),1),i.createElementVNode("div",ST,[i.createElementVNode("div",CT,[i.createElementVNode("table",ET,[i.createElementVNode("thead",TT,[i.createElementVNode("tr",null,[i.createElementVNode("th",MT,i.toDisplayString(i.unref(e)("App")),1),i.createElementVNode("th",NT,i.toDisplayString(i.unref(e)("Version")),1)])]),i.createElementVNode("tbody",PT,[i.createElementVNode("tr",null,[i.createElementVNode("td",BT,[i.createElementVNode("div",LT,i.toDisplayString(i.unref(e)("Page Builder")),1)]),i.createElementVNode("td",AT,[i.createElementVNode("div",DT,[i.createElementVNode("span",VT,i.toDisplayString(i.unref(xT)),1)])])])])])])])]),(l=o.value)!=null&&l.resourceData&&!i.unref(rr)(o.value.resourceData)?(i.openBlock(),i.createElementBlock("div",zT,[i.createElementVNode("h4",IT,i.toDisplayString(i.unref(e)("Resource Data")),1),i.createElementVNode("div",_T,[i.createElementVNode("div",HT,[i.createElementVNode("table",OT,[i.createElementVNode("thead",RT,[i.createElementVNode("tr",null,[i.createElementVNode("th",FT,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",jT,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",qT,[(p=(s=o.value)==null?void 0:s.resourceData)!=null&&p.title?(i.openBlock(),i.createElementBlock("tr",UT,[i.createElementVNode("td",WT,[i.createElementVNode("div",GT,i.toDisplayString(i.unref(e)("Title")),1)]),i.createElementVNode("td",JT,[i.createElementVNode("div",KT,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",YT,[i.createElementVNode("td",XT,[i.createElementVNode("div",QT,i.toDisplayString(i.unref(e)("ID")),1)]),i.createElementVNode("td",ZT,[i.createElementVNode("div",$T,i.toDisplayString(o.value.resourceData.id),1)])])):i.createCommentVNode("",!0)])])])])])):i.createCommentVNode("",!0),(m=o.value)!=null&&m.userForPageBuilder&&!i.unref(rr)(o.value.userForPageBuilder)?(i.openBlock(),i.createElementBlock("div",e8,[i.createElementVNode("h4",t8,i.toDisplayString(i.unref(e)("User Information")),1),i.createElementVNode("div",r8,[i.createElementVNode("div",o8,[i.createElementVNode("table",i8,[i.createElementVNode("thead",n8,[i.createElementVNode("tr",null,[i.createElementVNode("th",a8,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",l8,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",s8,[i.createElementVNode("tr",null,[i.createElementVNode("td",p8,[i.createElementVNode("div",d8,i.toDisplayString(i.unref(e)("User Name")),1)]),i.createElementVNode("td",c8,[i.createElementVNode("div",m8,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",b8,[i.createElementVNode("div",x8,i.toDisplayString(o.value.userForPageBuilder.id),1)])]),i.createElementVNode("tr",null,[i.createElementVNode("td",g8,[i.createElementVNode("div",u8,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",h8,[i.createElementVNode("div",f8,[i.createElementVNode("div",y8,[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,w8)])])])):i.createCommentVNode("",!0)]),i.createElementVNode("tr",null,[i.createElementVNode("td",v8,[i.createElementVNode("div",k8,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",S8,[i.createElementVNode("div",C8,i.toDisplayString(o.value.userForPageBuilder.image),1)])):i.createCommentVNode("",!0)])])])])])])):i.createCommentVNode("",!0),(b=o.value)!=null&&b.userSettings&&!i.unref(rr)(o.value.userSettings)?(i.openBlock(),i.createElementBlock("div",E8,[i.createElementVNode("h4",T8,i.toDisplayString(i.unref(e)("User Settings")),1),i.createElementVNode("div",M8,[i.createElementVNode("div",N8,[i.createElementVNode("table",P8,[i.createElementVNode("thead",B8,[i.createElementVNode("tr",null,[i.createElementVNode("th",L8,i.toDisplayString(i.unref(e)("Setting")),1),i.createElementVNode("th",A8,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",D8,[(g=(x=o.value)==null?void 0:x.userSettings)!=null&&g.language?(i.openBlock(),i.createElementBlock("tr",V8,[i.createElementVNode("td",z8,[i.createElementVNode("div",I8,i.toDisplayString(i.unref(e)("Language")),1)]),i.createElementVNode("td",_8,[i.createElementVNode("div",H8,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",O8,[i.createElementVNode("td",R8,[i.createElementVNode("div",F8,i.toDisplayString(i.unref(e)("Auto Save")),1)]),i.createElementVNode("td",j8,[i.createElementVNode("div",q8,[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",U8,[i.createElementVNode("td",W8,[i.createElementVNode("div",G8,i.toDisplayString(i.unref(e)("Notifications")),1)]),i.createElementVNode("td",J8,[i.createElementVNode("div",K8,[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(rr)(o.value.pageBuilderLogo)?(i.openBlock(),i.createElementBlock("div",Y8,[i.createElementVNode("h4",X8,i.toDisplayString(i.unref(e)("Logo Configuration")),1),i.createElementVNode("div",Q8,[i.createElementVNode("div",Z8,[i.createElementVNode("table",$8,[i.createElementVNode("thead",e7,[i.createElementVNode("tr",null,[i.createElementVNode("th",t7,i.toDisplayString(i.unref(e)("Property")),1),i.createElementVNode("th",r7,i.toDisplayString(i.unref(e)("Value")),1)])]),i.createElementVNode("tbody",o7,[i.createElementVNode("tr",null,[i.createElementVNode("td",i7,[i.createElementVNode("div",n7,i.toDisplayString(i.unref(e)("Logo")),1)]),i.createElementVNode("td",a7,[i.createElementVNode("div",l7,[i.createElementVNode("div",s7,[i.createElementVNode("img",{class:"pbx-h-4",src:o.value.pageBuilderLogo.src,alt:"Logo"},null,8,p7)])])])]),i.createElementVNode("tr",null,[i.createElementVNode("td",d7,[i.createElementVNode("div",c7,i.toDisplayString(i.unref(e)("Logo URL")),1)]),i.createElementVNode("td",m7,[i.createElementVNode("div",b7,[i.createElementVNode("div",x7,[i.createElementVNode("div",g7,[i.createElementVNode("div",u7,[i.createElementVNode("span",h7,i.toDisplayString(o.value.pageBuilderLogo.src),1)])])])])])])])])])])])):i.createCommentVNode("",!0),(y=o.value)!=null&&y.updateOrCreate&&!i.unref(rr)(o.value.updateOrCreate)?(i.openBlock(),i.createElementBlock("div",f7,[i.createElementVNode("h4",y7,i.toDisplayString(i.unref(e)("Form Type")),1),i.createElementVNode("div",w7,[i.createElementVNode("div",v7,[i.createElementVNode("table",k7,[i.createElementVNode("thead",S7,[i.createElementVNode("tr",null,[i.createElementVNode("th",C7,i.toDisplayString(i.unref(e)("Mode")),1),i.createElementVNode("th",E7,i.toDisplayString(i.unref(e)("Description")),1)])]),i.createElementVNode("tbody",T7,[i.createElementVNode("tr",null,[i.createElementVNode("td",M7,[i.createElementVNode("div",N7,i.toDisplayString(i.unref(e)("Form Type")),1)]),i.createElementVNode("td",P7,[i.createElementVNode("div",B7,[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",L7,i.toDisplayString(o.value.updateOrCreate.formType),1)):i.createCommentVNode("",!0),o.value&&o.value.updateOrCreate.formType==="update"?(i.openBlock(),i.createElementBlock("span",A7,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",D7,[i.createElementVNode("td",V7,[i.createElementVNode("div",z7,i.toDisplayString(i.unref(e)("Form Name")),1)]),i.createElementVNode("td",I7,[i.createElementVNode("div",_7,[i.createElementVNode("span",H7,i.toDisplayString(o.value.updateOrCreate.formName),1)])])])):i.createCommentVNode("",!0)])])])])])):i.createCommentVNode("",!0)])])]),i.createElementVNode("div",O7,[i.createElementVNode("div",R7,[i.createElementVNode("h3",F7,i.toDisplayString(i.unref(e)("Complete Configuration Overview")),1),i.createElementVNode("p",j7,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",q7,[i.createElementVNode("div",U7,[i.createElementVNode("div",W7,[i.createElementVNode("div",G7,i.toDisplayString(i.unref(e)("Configuration")),1)])]),i.createElementVNode("div",J7,[i.createElementVNode("p",K7," config: "+i.toDisplayString(JSON.stringify(o.value,null,4)),1)])])])])}}}),X7={key:0,class:"pbx-fixed pbx-inset-0 pbx-z-[9999]"},Q7={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"},Z7={class:"pbx-myQuaternaryHeader pbx-my-0 pbx-py-0 pbx-text-black"},$7={class:"pbx-pt-4 pbx-px-2"},eM=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}}},emits:["closeSidebarPanel"],setup(r,{emit:e}){const t=e,o=()=>{t("closeSidebarPanel")};return(n,a)=>(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",X7,[i.createElementVNode("div",{class:"pbx-fixed pbx-inset-0 pbx-bg-black pbx-opacity-20 pbx-z-40",onClick:o}),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:a[0]||(a[0]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("div",Q7,[i.createElementVNode("span",Z7,i.toDisplayString(r.title),1),i.createElementVNode("span",{onClick:o},[...a[1]||(a[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",$7,[i.renderSlot(n.$slots,"default")])],2)])):i.createCommentVNode("",!0)]),_:3})]))}}),tM={class:"pbx-flex pbx-flex-col pbx-items-center pbx-justify-center pbx-myPrimaryGap"},rM={class:"pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center pbx-relative"},oM={class:"pbx-overflow-y-auto"},iM={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2"},nM={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"},aM={class:"pbx-bg-gray-100 pbx-rounded-full pbx-w-32 pbx-h-32 pbx-flex pbx-items-center pbx-justify-center"},lM={class:"pbx-text-center"},sM={class:"pbx-lg:pbx-text-7xl pbx-text-5xl"},pM={key:0,class:"pbx-w-full pbx-space-y-6"},dM={class:"pbx-text-xl pbx-font-semibold pbx-mb-4 pbx-text-center"},cM={class:"pbx-text-sm pbx-font-semibold pbx-uppercase pbx-tracking-widest pbx-text-gray-400 pbx-mb-3 pbx-px-1"},mM={class:"pbx-space-y-3"},bM={class:"pbx-flex-shrink-0 pbx-mt-1"},xM={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"},gM={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"},uM={class:"pbx-flex-1"},hM={class:"pbx-text-sm pbx-text-gray-600"},fM={key:1,class:"pbx-text-gray-500 pbx-text-center"},yM={class:"pbx-flex pbx-gap-2 pbx-items-center pbx-justify-center"},wM=i.defineComponent({__name:"ComponentTopMenu",setup(r){const{translate:e}=te(),t=me(),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 pe(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),k=i.ref(!1),T=i.computed(()=>{if(!y.value)return[];const M=new Map;for(const C of y.value.checks){const A=C.category??"Other";M.has(A)||M.set(A,[]),M.get(A).push(C)}return Array.from(M.entries()).map(([C,A])=>({title:C,checks:A}))}),L=async function(){k.value=!k.value,k.value&&(y.value=await t.analyzeSEO())},S=function(){k.value=!1};return(M,C)=>(i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",tM,[i.createElementVNode("div",rM,[i.createElementVNode("div",{onClick:L,"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":k.value}])},[...C[4]||(C[4]=[i.createElementVNode("div",{class:"pbx-font-semibold pbx-text-sm"},"SEO",-1)])],2),i.createVNode(eM,{title:"SEO",showSidebarPanel:k.value,onCloseSidebarPanel:S,position:"left"},{default:i.withCtx(()=>[i.createElementVNode("div",oM,[i.createElementVNode("div",null,[i.createElementVNode("div",iM,[i.createElementVNode("div",nM,[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",aM,[i.createElementVNode("div",lM,[i.createElementVNode("span",sM,i.toDisplayString(y.value.score),1),C[5]||(C[5]=i.createElementVNode("span",{class:"pbx-text-xl"},"%",-1))])])],4)):i.createCommentVNode("",!0)])]),T.value.length?(i.openBlock(),i.createElementBlock("div",pM,[i.createElementVNode("h3",dM,i.toDisplayString(i.unref(e)("SEO Check Results")),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(T.value,A=>(i.openBlock(),i.createElementBlock("div",{key:A.title},[i.createElementVNode("h4",cM,i.toDisplayString(i.unref(e)(A.title)),1),i.createElementVNode("ul",mM,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(A.checks,(E,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",E.passed?"pbx-border-emerald-500":"pbx-border-red-600"])},[i.createElementVNode("div",bM,[E.passed?(i.openBlock(),i.createElementBlock("div",xM,[...C[6]||(C[6]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," check ",-1)])])):i.createCommentVNode("",!0),E.passed?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",gM,[...C[7]||(C[7]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," check_indeterminate_small ",-1)])]))]),i.createElementVNode("div",uM,[i.createElementVNode("p",{class:i.normalizeClass(["pbx-text-lg pbx-font-medium",E.passed?"pbx-text-green-700":"pbx-text-red-700"])},i.toDisplayString(i.unref(e)(E.check)),3),i.createElementVNode("p",hM,i.toDisplayString(E.details),1)])],2))),128))])]))),128))])):(i.openBlock(),i.createElementBlock("div",fM,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",yM,[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(xt,{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(Y7)]),_:1},8,["showModalBuilder"])]))}});function Pe(r){this.content=r}Pe.prototype={constructor:Pe,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 Pe(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 Pe(t)},addToStart:function(r,e){return new Pe([r,e].concat(this.remove(r).content))},addToEnd:function(r,e){var t=this.remove(r).content.slice();return t.push(r,e),new Pe(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 Pe(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=Pe.from(r),r.size?new Pe(r.content.concat(this.subtract(r).content)):this},append:function(r){return r=Pe.from(r),r.size?new Pe(this.subtract(r).content.concat(r.content)):this},subtract:function(r){var e=this;r=Pe.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}},Pe.from=function(r){if(r instanceof Pe)return r;var e=[];if(r)for(var t in r)e.push(t,r[t]);return new Pe(e)};function O3(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&&j3(l.charCodeAt(p-1))&&F3(l.charCodeAt(p))&&t--,t}if(n.content.size||a.content.size){let l=O3(n.content,a.content,t+1);if(l!=null)return l}t+=n.nodeSize}}function R3(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&&j3(d.charCodeAt(m-1))&&F3(d.charCodeAt(m))&&(t++,o++),{a:t,b:o}}if(l.content.size||s.content.size){let d=R3(l.content,s.content,t-1,o-1);if(d)return d}t-=p,o-=p}}function F3(r){return r>=56320&&r<57344}function j3(r){return r>=55296&&r<56320}let I=class Ke{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 Ke(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 Ke(o,n)}cutByIndex(e,t){return e==t?Ke.empty:e==0&&t==this.content.length?this:new Ke(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 Ke(n,a)}addToStart(e){return new Ke([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Ke(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 O3(this,e,t)}findDiffEnd(e,t=this.size,o=e.size){return R3(this,e,t,o)}findIndex(e){if(e==0)return ln(0,e);if(e==this.size)return ln(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?ln(t+1,a):ln(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 Ke.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return Ke.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Ke.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 Ke(t||e,o)}static from(e){if(!e)return Ke.empty;if(e instanceof Ke)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Ke([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 sl={index:0,offset:0};function ln(r,e){return sl.index=r,sl.offset=e,sl}function sn(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(!sn(r[o],e[o]))return!1}else{for(let o in r)if(!(o in e)||!sn(r[o],e[o]))return!1;for(let o in e)if(!(o in r))return!1}return!0}let $=class Tp{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&&sn(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 Tp.none;if(e instanceof Tp)return[e];let t=e.slice();return t.sort((o,n)=>o.type.rank-n.type.rank),t}};$.none=[];let jo=class extends Error{},O=class Io{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=U3(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return o&&new Io(o,this.openStart,this.openEnd)}removeBetween(e,t){return new Io(q3(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 Io.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 Io(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 Io(e,o,n)}};O.empty=new O(I.empty,0,0);function q3(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(q3(a.content,e-n-1,t-n-1)))}function U3(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=U3(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 vM(r,e,t){if(t.openStart>r.depth)throw new jo("Inserted content deeper than insertion position");if(r.depth-t.openStart!=e.depth-t.openEnd)throw new jo("Inconsistent open depths");return W3(r,e,t,0)}function W3(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=W3(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 Lr(l,s.cut(0,r.parentOffset).append(t.content).append(s.cut(e.parentOffset)))}else{let{start:l,end:s}=kM(t,r);return Lr(a,J3(r,l,s,e,o))}else return Lr(a,pn(r,e,o))}function G3(r,e){if(!e.type.compatibleContent(r.type))throw new jo("Cannot join "+e.type.name+" onto "+r.type.name)}function pl(r,e,t){let o=r.node(t);return G3(o,e.node(t)),o}function Br(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 qo(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&&(Br(r.nodeAfter,o),a++));for(let s=a;s<l;s++)Br(n.child(s),o);e&&e.depth==t&&e.textOffset&&Br(e.nodeBefore,o)}function Lr(r,e){if(!r.type.validContent(e))throw new jo("Invalid content for node "+r.type.name);return r.copy(e)}function J3(r,e,t,o,n){let a=r.depth>n&&pl(r,e,n+1),l=o.depth>n&&pl(t,o,n+1),s=[];return qo(null,r,n,s),a&&l&&e.index(n)==t.index(n)?(G3(a,l),Br(Lr(a,J3(r,e,t,o,n+1)),s)):(a&&Br(Lr(a,pn(r,e,n+1)),s),qo(e,t,n,s),l&&Br(Lr(l,pn(t,o,n+1)),s)),qo(o,null,n,s),new I(s)}function pn(r,e,t){let o=[];if(qo(null,r,t,o),r.depth>t){let n=pl(r,e,t+1);Br(Lr(n,pn(r,e,t+1)),o)}return qo(e,null,t,o),new I(o)}function kM(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 Uo{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 $.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 dn(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 Uo(t,o,a)}static resolveCached(e,t){let o=K3.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 K3.set(e,o=new SM);let n=o.elts[o.i]=Uo.resolve(e,t);return o.i=(o.i+1)%CM,n}}class SM{constructor(){this.elts=[],this.i=0}}const CM=12,K3=new WeakMap;class dn{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 EM=Object.create(null);let or=class Mp{constructor(e,t,o,n=$.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&&sn(this.attrs,t||e.defaultAttrs||EM)&&$.sameSet(this.marks,o||$.none)}copy(e=null){return e==this.content?this:new Mp(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Mp(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 O.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 O(d,n.depth-l,a.depth-l)}replace(e,t,o){return vM(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 Uo.resolveCached(this,e)}resolveNoCache(e){return Uo.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()+")"),Y3(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=$.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(!$.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}};or.prototype.text=void 0;class cn extends or{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):Y3(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 cn(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new cn(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 Y3(r,e){for(let t=r.length-1;t>=0;t--)e=r[t].type.name+"("+e+")";return e}class Ar{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let o=new TM(e,t);if(o.next==null)return Ar.empty;let n=X3(o);o.next&&o.err("Unexpected trailing text");let a=DM(AM(n));return VM(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
|
`)}}Ar.empty=new Ar(!0);class TM{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 X3(r){let e=[];do e.push(MM(r));while(r.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function MM(r){let e=[];do e.push(NM(r));while(r.next&&r.next!=")"&&r.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function NM(r){let e=LM(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=PM(r,e);else break;return e}function Q3(r){/\D/.test(r.next)&&r.err("Expected number, got '"+r.next+"'");let e=Number(r.next);return r.pos++,e}function PM(r,e){let t=Q3(r),o=t;return r.eat(",")&&(r.next!="}"?o=Q3(r):o=-1),r.eat("}")||r.err("Unclosed braced range"),{type:"range",min:t,max:o,expr:e}}function BM(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 LM(r){if(r.eat("(")){let e=X3(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=BM(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 AM(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 Z3(r,e){return e-r}function $3(r,e){let t=[];return o(e),t.sort(Z3);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 DM(r){let e=Object.create(null);return t($3(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]);$3(r,p).forEach(c=>{d||n.push([s,d=[]]),d.indexOf(c)==-1&&d.push(c)})})});let a=e[o.join(",")]=new Ar(o.indexOf(r.length-1)>-1);for(let l=0;l<n.length;l++){let s=n[l][1].sort(Z3);a.next.push({type:n[l][0],next:e[s.join(",")]||t(s)})}return a}}function VM(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 ek(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 tk(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 rk(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 ok(r,e){let t=Object.create(null);if(e)for(let o in e)t[o]=new IM(r,o,e[o]);return t}let ik=class oE{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=ok(e,o.attrs),this.defaultAttrs=ek(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==Ar.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:tk(this.attrs,e)}create(e=null,t,o){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new or(this,this.computeAttrs(e),I.from(t),$.setFrom(o))}createChecked(e=null,t,o){return t=I.from(t),this.checkContent(t),new or(this,this.computeAttrs(e),t,$.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 or(this,e,t.append(a),$.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){rk(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:$.none:e}static compile(e,t){let o=Object.create(null);e.forEach((a,l)=>o[a]=new oE(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 zM(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 IM{constructor(e,t,o){this.hasDefault=Object.prototype.hasOwnProperty.call(o,"default"),this.default=o.default,this.validate=typeof o.validate=="string"?zM(e,t,o.validate):o.validate}get isRequired(){return!this.hasDefault}}class mn{constructor(e,t,o,n){this.name=e,this.rank=t,this.schema=o,this.spec=n,this.attrs=ok(e,n.attrs),this.excluded=null;let a=ek(this.attrs);this.instance=a?new $(this,a):null}create(e=null){return!e&&this.instance?this.instance:new $(this,tk(this.attrs,e))}static compile(e,t){let o=Object.create(null),n=0;return e.forEach((a,l)=>o[a]=new mn(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){rk(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class nk{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=Pe.from(e.nodes),t.marks=Pe.from(e.marks||{}),this.nodes=ik.compile(this.spec.nodes,this),this.marks=mn.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]=Ar.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?ak(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==""?[]:ak(this,l.split(" "))}this.nodeFromJSON=n=>or.fromJSON(this,n),this.markFromJSON=n=>$.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 ik){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 cn(o,o.defaultAttrs,e,$.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 ak(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 _M(r){return r.tag!=null}function HM(r){return r.style!=null}let Wo=class Np{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let o=this.matchedStyles=[];t.forEach(n=>{if(_M(n))this.tags.push(n);else if(HM(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 dk(this,t,!1);return o.addAll(e,$.none,t.from,t.to),o.finish()}parseSlice(e,t={}){let o=new dk(this,t,!0);return o.addAll(e,$.none,t.from,t.to),O.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(FM(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=ck(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=ck(l)),l.node||l.ignore||l.mark||(l.node=n)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Np(e,Np.schemaRules(e)))}};const lk={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},OM={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},sk={ol:!0,ul:!0},Go=1,dl=2,Jo=4;function pk(r,e,t){return e!=null?(e?Go:0)|(e==="full"?dl:0):r&&r.whitespace=="pre"?Go|dl:t&~Jo}class bn{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=$.none,this.match=a||(l&Jo?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&Go)){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&&!lk.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class dk{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=pk(null,t.preserveWhitespace,0)|(o?Jo:0);n?a=new bn(n.type,n.attrs,$.none,!0,t.topMatch||n.type.contentMatch,l):o?a=new bn(null,null,$.none,!0,null,l):a=new bn(e.schema.topNodeType,null,$.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&dl?"full":this.localPreserveWS||(n.options&Go)>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;sk.hasOwnProperty(l)&&this.parser.normalizeLists&&RM(e);let p=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,o));e:if(p?p.ignore:OM.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(lk.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=$.none;for(let s of n.concat(e.marks))(a.type?a.type.allowsMarkType(s.type):mk(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=pk(e,a,l.options);l.options&Jo&&l.content.length==0&&(s|=Jo);let p=$.none;return o=o.filter(d=>(l.type?l.type.allowsMarkType(d.type):mk(d.type,e))?(p=d.addToSet(p),!1):!0),this.nodes.push(new bn(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|=Go)}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 RM(r){for(let e=r.firstChild,t=null;e;e=e.nextSibling){let o=e.nodeType==1?e.nodeName.toLowerCase():null;o&&sk.hasOwnProperty(o)&&t?(t.appendChild(e),e=t):o=="li"?t=e:o&&(t=null)}}function FM(r,e){return(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,e)}function ck(r){let e={};for(let t in r)e[t]=r[t];return e}function mk(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 Dr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},o){o||(o=xn(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 xn(t).createTextNode(e.text);let{dom:o,contentDOM:n}=gn(xn(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&&gn(xn(o),n(e,t),null,e.attrs)}static renderSpec(e,t,o=null,n){return typeof t=="string"?{dom:e.createTextNode(t)}:gn(e,t,o,n)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Dr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=bk(e.nodes);return t.text||(t.text=o=>o.text),t}static marksFromSchema(e){return bk(e.marks)}}function bk(r){let e={};for(let t in r){let o=r[t].spec.toDOM;o&&(e[t]=o)}return e}function xn(r){return r.document||window.document}const xk=new WeakMap;function jM(r){let e=xk.get(r);return e===void 0&&xk.set(r,e=qM(r)),e}function qM(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 gn(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=jM(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}=gn(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 gk=65535,uk=Math.pow(2,16);function UM(r,e){return r+e*uk}function hk(r){return r&gk}function WM(r){return(r-(r&gk))/uk}const fk=1,yk=2,un=4,wk=8;let cl=class{constructor(e,t,o){this.pos=e,this.delInfo=t,this.recover=o}get deleted(){return(this.delInfo&wk)>0}get deletedBefore(){return(this.delInfo&(fk|un))>0}get deletedAfter(){return(this.delInfo&(yk|un))>0}get deletedAcross(){return(this.delInfo&un)>0}},Vr=class _o{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&_o.empty)return _o.empty}recover(e){let t=0,o=hk(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+WM(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:UM(s/3,e-p),u=e==p?yk:e==m?fk:un;return(t<0?e!=p:e!=m)&&(u|=wk),new cl(x,u,g)}n+=c-d}return o?e+n:new cl(e+n,0,null)}touches(e,t){let o=0,n=hk(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 _o(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?_o.empty:new _o(e<0?[0,-e,0]:[0,0,e])}};Vr.empty=new Vr([]);class Ko{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 Ko(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 Ko;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 cl(e,n,null)}}const ml=Object.create(null);let ze=class{getMap(){return Vr.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let o=ml[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 ml)throw new RangeError("Duplicate use of step JSON ID "+e);return ml[e]=t,t.prototype.jsonID=e,t}},Fe=class Fi{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Fi(e,null)}static fail(e){return new Fi(null,e)}static fromReplace(e,t,o,n){try{return Fi.ok(e.replace(t,o,n))}catch(a){if(a instanceof jo)return Fi.fail(a.message);throw a}}};function bl(r,e,t){let o=[];for(let n=0;n<r.childCount;n++){let a=r.child(n);a.content.size&&(a=a.copy(bl(a.content,e,a))),a.isInline&&(a=e(a,t,n)),o.push(a)}return I.fromArray(o)}let xl=class ji extends ze{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 O(bl(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 Fe.fromReplace(e,this.from,this.to,a)}invert(){return new oo(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 ji(t.pos,o.pos,this.mark)}merge(e){return e instanceof ji&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ji(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 ji(t.from,t.to,e.markFromJSON(t.mark))}};ze.jsonID("addMark",xl);let oo=class qi extends ze{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 O(bl(t.content,n=>n.mark(this.mark.removeFromSet(n.marks)),e),t.openStart,t.openEnd);return Fe.fromReplace(e,this.from,this.to,o)}invert(){return new xl(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 qi(t.pos,o.pos,this.mark)}merge(e){return e instanceof qi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new qi(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 qi(t.from,t.to,e.markFromJSON(t.mark))}};ze.jsonID("removeMark",oo);let gl=class Ui extends ze{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Fe.fail("No node at mark step's position");let o=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new O(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 Ui(this.pos,t.marks[n]);return new Ui(this.pos,this.mark)}}return new hn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Ui(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 Ui(t.pos,e.markFromJSON(t.mark))}};ze.jsonID("addNodeMark",gl);let hn=class Pp extends ze{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Fe.fail("No node at mark step's position");let o=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Fe.fromReplace(e,this.pos,this.pos+1,new O(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 gl(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Pp(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 Pp(t.pos,e.markFromJSON(t.mark))}};ze.jsonID("removeNodeMark",hn);let nt=class Er extends ze{constructor(e,t,o,n=!1){super(),this.from=e,this.to=t,this.slice=o,this.structure=n}apply(e){return this.structure&&ul(e,this.from,this.to)?Fe.fail("Structure replace would overwrite content"):Fe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Vr([this.from,this.to-this.from,this.slice.size])}invert(e){return new Er(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&&Er.MAP_BIAS<0?t:e.mapResult(this.from,1);return o.deletedAcross&&t.deletedAcross?null:new Er(o.pos,Math.max(o.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Er)||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?O.empty:new O(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Er(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?O.empty:new O(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Er(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 Er(t.from,t.to,O.fromJSON(e,t.slice),!!t.structure)}};nt.MAP_BIAS=1,ze.jsonID("replace",nt);let Xe=class Wa extends ze{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&&(ul(e,this.from,this.gapFrom)||ul(e,this.gapTo,this.to)))return Fe.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Fe.fail("Gap is not a flat range");let o=this.slice.insertAt(this.insert,t.content);return o?Fe.fromReplace(e,this.from,this.to,o):Fe.fail("Content does not fit in gap")}getMap(){return new Vr([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 Wa(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 Wa(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 Wa(t.from,t.to,t.gapFrom,t.gapTo,O.fromJSON(e,t.slice),t.insert,!!t.structure)}};ze.jsonID("replaceAround",Xe);function ul(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 GM(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 oo(b,x,m[u])));s&&s.to==b?s.to=x:a.push(s=new xl(b,x,o))}}),n.forEach(p=>r.step(p)),a.forEach(p=>r.step(p))}function JM(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 mn){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 oo(l.from,l.to,l.style)))}function hl(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,O.empty));else{o=m;for(let b=0;b<d.marks.length;b++)t.allowsMarkType(d.marks[b].type)||r.step(new oo(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 O(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 O(p,0,0))}for(let p=l.length-1;p>=0;p--)r.step(l[p])}function KM(r,e,t){return(e==0||r.canReplace(e,r.childCount))&&(t==r.childCount||r.canReplace(0,t))}function io(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||!KM(l,s,p))break;s&&(n=1),p<l.childCount&&(a=1)}return null}function YM(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 Xe(p,d,l,s,new O(c.append(b),m,x),c.size-m,!0))}function fl(r,e,t=null,o=r){let n=XM(r,e),a=n&&QM(o,e);return a?n.map(vk).concat({type:e,attrs:t}).concat(a.map(vk)):null}function vk(r){return{type:r,attrs:null}}function XM(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 QM(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 ZM(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 Xe(n,a,n,a,new O(o,0,0),t.length,!0))}function $M(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)&&eN(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&&Sk(r,l,s,a),hl(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 Xe(m,b,m+1,b-1,new O(I.from(o.create(p,null,l.marks)),0,0),1,!0)),d===!0&&kk(r,l,s,a),!1}})}function kk(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 Sk(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(`
|
|
@@ -390,9 +390,9 @@ ${t}
|
|
|
390
390
|
`,S=document.createElement("a");S.setAttribute("href","data:text/html;charset=utf-8,"+encodeURIComponent(L)),S.setAttribute("download",f),S.style.display="none",document.body.appendChild(S),S.click(),document.body.removeChild(S)},g=function(){const f=document.getElementById("pagebuilder");if(!f)return;let w=X6(f);const y=document.createElement("div");y.innerHTML=w,y.querySelectorAll("[hovered], [selected]").forEach(k=>{k.removeAttribute("hovered"),k.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,k,T,L,S,M,C,A,E,v;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",null,[i.createElementVNode("div",lF,[i.createElementVNode("div",sF,[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",pF,[...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",dF,[u.value==="download"?(i.openBlock(),i.createElementBlock("div",cF,[Array.isArray(d.value)&&d.value.length>=1?(i.openBlock(),i.createElementBlock("div",mF,[i.createElementVNode("p",bF,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",xF,[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",gF,[i.createElementVNode("div",null,[i.createElementVNode("p",uF,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",hF,[i.createElementVNode("div",fF,[i.createElementVNode("div",yF,[i.createElementVNode("p",wF,i.toDisplayString(i.unref(e)("Full-width page")),1),i.createElementVNode("p",vF,i.toDisplayString(i.unref(e)("Stretch all sections across browser width")),1)]),i.createVNode(Ai,{"model-value":l.value,"onUpdate:modelValue":s},null,8,["model-value"])])]),i.createElementVNode("div",kF,[i.createElementVNode("article",SF,[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(oF)]),i.createElementVNode("article",CF,[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(O6,{globalPageLayout:!0})]),i.createElementVNode("article",EF,[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(R6,{globalPageLayout:!0})]),i.createElementVNode("article",TF,[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(G6)]),i.createElementVNode("article",MF,[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(J6)]),i.createElementVNode("article",NF,[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(K6)]),i.createElementVNode("article",PF,[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(Y6)]),i.createElementVNode("article",BF,[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(U6)]),i.createElementVNode("article",LF,[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(W6)]),i.createElementVNode("article",AF,[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(aF)])])])])):i.createCommentVNode("",!0),u.value==="viewHTMLConfig"?(i.openBlock(),i.createElementBlock("div",DF,[i.createElementVNode("p",VF,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",zF,[i.createElementVNode("div",IF,[i.createElementVNode("div",null,[i.createElementVNode("h4",_F,i.toDisplayString(i.unref(e)("Types")),1),i.createElementVNode("div",HF,[i.createElementVNode("div",OF,[i.createElementVNode("div",RF,[i.createElementVNode("div",FF,i.toDisplayString(i.unref(e)("Types")),1)])]),i.createElementVNode("div",jF,[i.createElementVNode("p",qF,[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",UF,[i.createElementVNode("span",null,i.toDisplayString(i.unref(e)("Component type:")),1),i.createTextVNode(" "+i.toDisplayString(typeof p.value),1)]),i.createElementVNode("p",WF,[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",GF,i.toDisplayString(i.unref(e)("Content")),1),i.createElementVNode("div",JF,[i.createElementVNode("div",KF,[i.createElementVNode("div",YF,[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",XF,[c.value==="element"?(i.openBlock(),i.createElementBlock("div",QF,[p.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",ZF,[i.createElementVNode("p",$F,i.toDisplayString(p.value===null?i.unref(e)("No Element selected"):typeof p.value),1)])),n.value?(i.openBlock(),i.createElementBlock("div",ej,[i.createElementVNode("div",tj,[i.createElementVNode("div",rj,[i.createElementVNode("table",oj,[i.createElementVNode("thead",ij,[i.createElementVNode("tr",null,[i.createElementVNode("th",nj,i.toDisplayString(i.unref(e)("Selected HTML:")),1)])]),i.createElementVNode("tbody",aj,[i.createElementVNode("tr",null,[i.createElementVNode("td",lj,i.toDisplayString((y=n.value)==null?void 0:y.outerHTML),1)])])])]),i.createElementVNode("div",sj,[i.createElementVNode("table",pj,[i.createElementVNode("thead",dj,[i.createElementVNode("tr",null,[i.createElementVNode("th",cj,i.toDisplayString(i.unref(e)("Element src:")),1)])]),i.createElementVNode("tbody",mj,[i.createElementVNode("tr",null,[i.createElementVNode("td",bj,i.toDisplayString((k=n.value)!=null&&k.src?(T=n.value)==null?void 0:T.src:typeof((L=n.value)==null?void 0:L.src)),1)])])])])]),i.createElementVNode("div",xj,[i.createElementVNode("table",gj,[i.createElementVNode("thead",uj,[i.createElementVNode("tr",null,[i.createElementVNode("th",hj,i.toDisplayString(i.unref(e)("Element classes:")),1)])]),i.createElementVNode("tbody",fj,[i.createElementVNode("tr",null,[i.createElementVNode("td",yj,i.toDisplayString((S=n.value)!=null&&S.classList?(M=n.value)==null?void 0:M.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",wj,[p.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",vj,[i.createElementVNode("p",kj,i.toDisplayString(p.value===null?i.unref(e)("No Component selected"):typeof p.value),1)])),p.value?(i.openBlock(),i.createElementBlock("div",Sj,[i.createElementVNode("div",Cj,[i.createElementVNode("div",Ej,[i.createElementVNode("table",Tj,[i.createElementVNode("thead",Mj,[i.createElementVNode("tr",null,[i.createElementVNode("th",Nj,i.toDisplayString(i.unref(e)("ID:")),1)])]),i.createElementVNode("tbody",Pj,[i.createElementVNode("tr",null,[i.createElementVNode("td",Bj,i.toDisplayString((A=p.value)==null?void 0:A.id),1)])])])]),i.createElementVNode("div",Lj,[i.createElementVNode("table",Aj,[i.createElementVNode("thead",Dj,[i.createElementVNode("tr",null,[i.createElementVNode("th",Vj,i.toDisplayString(i.unref(e)("Title:")),1)])]),i.createElementVNode("tbody",zj,[i.createElementVNode("tr",null,[i.createElementVNode("td",Ij,i.toDisplayString((E=p.value)==null?void 0:E.title),1)])])])])]),i.createElementVNode("div",_j,[i.createElementVNode("table",Hj,[i.createElementVNode("thead",Oj,[i.createElementVNode("tr",null,[i.createElementVNode("th",Rj,i.toDisplayString(i.unref(e)("HTML Code:")),1)])]),i.createElementVNode("tbody",Fj,[i.createElementVNode("tr",null,[i.createElementVNode("td",jj,[i.createElementVNode("pre",qj,[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,Uj),w[22]||(w[22]=i.createTextVNode(`
|
|
391
391
|
`,-1))])])])])])])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.value==="components"?(i.openBlock(),i.createElementBlock("div",Wj,[Array.isArray(d.value)&&d.value.length===0?(i.openBlock(),i.createElementBlock("div",Gj,[i.createElementVNode("p",Jj,i.toDisplayString(i.unref(e)("No Components added yet")),1)])):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createElementBlock("div",Kj,[(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",Yj,[i.createElementVNode("div",Xj,[i.createElementVNode("table",Qj,[i.createElementVNode("thead",Zj,[i.createElementVNode("tr",null,[i.createElementVNode("th",$j,i.toDisplayString(i.unref(e)("ID:")),1)])]),i.createElementVNode("tbody",eq,[i.createElementVNode("tr",null,[i.createElementVNode("td",tq,i.toDisplayString(D.id),1)])])])]),i.createElementVNode("div",rq,[i.createElementVNode("table",oq,[i.createElementVNode("thead",iq,[i.createElementVNode("tr",null,[i.createElementVNode("th",nq,i.toDisplayString(i.unref(e)("Title:")),1)])]),i.createElementVNode("tbody",aq,[i.createElementVNode("tr",null,[i.createElementVNode("td",lq,i.toDisplayString(D.title),1)])])])])]),i.createElementVNode("div",sq,[i.createElementVNode("table",pq,[i.createElementVNode("thead",dq,[i.createElementVNode("tr",null,[i.createElementVNode("th",cq,i.toDisplayString(i.unref(e)("HTML Code:")),1)])]),i.createElementVNode("tbody",mq,[i.createElementVNode("tr",null,[i.createElementVNode("td",bq,[i.createElementVNode("pre",xq,[w[23]||(w[23]=i.createTextVNode(" ",-1)),i.createElementVNode("code",{class:"pbx-font-sans pbx-w-full",innerHTML:b(D.html_code)},null,8,gq),w[24]||(w[24]=i.createTextVNode(`
|
|
392
392
|
`,-1))])])])])])])]))),128))])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])])])])])):i.createCommentVNode("",!0)]))])])}}}),uq={class:"pbx-flex pbx-h-full pbx-flex-col"},hq={class:"pbx-flex pbx-flex-row pbx-justify-between pbx-pt-7 pbx-pr-4 pbx-pl-4 pbx-items-center pbx-mb-3"},fq={class:"pbx-font-medium pbx-text-sm"},yq={class:"pbx-lowercase"},wq={class:"pbx-mb-1"},vq={class:"pbx-my-1"},kq={class:"pbx-my-1"},Sq={class:"pbx-my-1"},Cq={class:"pbx-my-1"},Eq={class:"pbx-my-1"},Tq={class:"pbx-my-1"},Mq={class:"pbx-my-1"},Nq={class:"pbx-font-medium pbx-my-0 pbx-py-0"},Pq=i.defineComponent({__name:"RightSidebarEditor",emits:["closeEditor"],setup(r){const{translate:e}=te(),t=me(),o=re,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 pe(200),o.setToggleGlobalHtmlMode(!0),await t.globalPageStyles(),c.value=!1},b=async function(){c.value=!0,await pe(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",uq,[i.createElementVNode("div",hq,[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",fq,[i.createTextVNode(i.toDisplayString(i.unref(e)("Editing"))+" ",1),i.createElementVNode("span",yq,"<"+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",wq,[i.createVNode(BH)]),i.createElementVNode("article",vq,[i.createVNode(QH)]),i.createElementVNode("article",kq,[i.createVNode(G6)]),i.createElementVNode("article",Sq,[i.createVNode(J6)]),i.createElementVNode("article",Cq,[i.createVNode(K6)]),i.createElementVNode("article",Eq,[i.createVNode(Y6)]),i.createElementVNode("article",Tq,[i.createVNode(U6)]),i.createElementVNode("article",Mq,[i.createVNode(W6)]),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",Nq,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(Q6,{isLoading:c.value},null,8,["isLoading"])]),_:1},8,["showModalBuilder","title"])],64))}}),Bq={class:"pbx-flex pbx-items-center pbx-justify-center pbx-ml-2"},Lq={class:"pbx-mr-2"},Aq={key:0,class:"pbx-flex pbx-items-center pbx-myPrimaryTag pbx-whitespace-nowrap pbx-py-0 pbx-gap-2"},Dq={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"},Vq={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"},zq={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"},Iq=["src"],_q=i.defineComponent({__name:"ToolbarOption",setup(r){const e=re,t=i.computed(()=>e.getPageBuilderConfig);return(o,n)=>{var a;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Bq,[i.createElementVNode("div",Lq,[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",Aq,[i.createElementVNode("div",Dq,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",Vq,[i.createElementVNode("div",zq,[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,Iq)])])):i.createCommentVNode("",!0)])])])}}});let hp=null;function Hq(){return(r,e=300)=>{hp&&clearTimeout(hp),hp=setTimeout(r,e)}}const Oq={};function Rq(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 Z6=Da(Oq,[["render",Rq]]),Fq={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"},jq=i.defineComponent({__name:"UndoRedo",emits:["toolbar-hide-request"],setup(r,{emit:e}){const t=me(),o=e,n=re,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(Z6,{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",Fq,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))}}),qq=["width","height"],Uq=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,qq))}}),Wq={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"},Gq={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"},Jq=["src"],Kq={class:"pbx-flex pbx-items-center pbx-justify-center"},Yq=["disabled"],Xq={key:0,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},Qq={key:1,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},Zq=["disabled"],$q={key:0,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},eU={key:1,class:"pbx-h-10 pbx-w-4 pbx-cursor-pointer pbx-rounded-full pbx-flex pbx-items-center pbx-justify-center"},tU={class:"lg:pbx-block pbx-hidden"},rU={class:"lg:pbx-hidden pbx-block"},oU={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2 pbx-border-gray-200"},iU={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"},nU={class:"pbx-cursor-pointer lg:pbx-block lg:pbx-pr-4 pbx-hidden"},aU={class:"pbx-flex pbx-items-center pbx-justify-center pbx-mr-2"},lU={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2"},sU={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"},pU={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},dU={class:"lg:pbx-flex pbx-hidden pbx-items-center pbx-justify-center"},cU={class:"pbx-flex pbx-items-center pbx-justify-center pbx-gap-2"},mU={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"},bU={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},xU={class:"pbx-flex-1 pbx-flex gap-2 pbx-items-center pbx-justify-end"},gU={key:0,class:"pbx-flex-1 pbx-ml-2"},uU={key:0,class:"pbx-flex-1 pbx-flex pbx-justify-end pbx-items-center pbx-ml-2 lg:pbx-mr-4 pbx-mr-2"},hU=["value"],fU=["value"],yU={key:2,class:"pbx-flex-1 pbx-ml-2 pbx-mr-2"},wU={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"},vU={class:"pbx-mx-2 pbx-flex pbx-flex-col pbx-myPrimaryGap pbx-items-stretch"},kU={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"},SU={key:0,id:"nolocalstorage"},CU={class:"pbx-flex pbx-justify-center pbx-w-full pbx-absolute pbx-items-center"},EU={class:"pbx-flex pbx-items-center pbx-gap-2"},TU={class:"pbx-font-medium pbx-break-words lg:pbx-text-lg md:pbx-text-lg pbx-text-base pbx-font-sans"},MU={key:1,id:"nolocalstorage"},NU={class:"pbx-flex pbx-justify-end pbx-w-full pbx-h-0 pbx-items-center pbx-rounded-r-full pbx-z-10"},PU={class:"pbx-flex pbx-items-center pbx-gap-1"},BU={class:"lg:pbx-block pbx-hidden"},LU=["innerHTML","onMouseup"],AU={key:1,id:"nolocalstorage"},DU={class:"pbx-flex pbx-justify-end pbx-w-full pbx-h-0 pbx-items-center pbx-rounded-r-full pbx-z-10"},VU=["onClick"],zU={class:"pbx-flex pbx-items-center pbx-gap-1"},IU={class:"lg:pbx-block pbx-hidden"},_U={fill:"currentColor",height:"22",viewBox:"0 0 22 22",width:"22",xmlns:"http://www.w3.org/2000/svg",style:{display:"block"}},HU={class:"pbx-flex pbx-justify-end pbx-min-h-6"},OU={key:0,class:"pbx-myPrimaryParagraphError"},RU={class:"pbx-border-0 pbx-border-solid pbx-border-t pbx-border-gray-200 pbx-flex pbx-items-center pbx-justify-end"},FU={class:"pbx-py-4 pbx-flex sm:pbx-justify-end pbx-justify-center"},jU={class:"sm:pbx-grid-cols-2 sm:pbx-items-end sm:pbx-justify-end pbx-flex pbx-flex-row pbx-myPrimaryGap pbx-w-full"},qU={key:1,class:"pbx-flex pbx-items-center pbx-my-2 pbx-justify-end"},UU={class:"pbx-flex pbx-justify-end pbx-min-h-6"},WU={key:0,class:"pbx-myPrimaryParagraphError"},GU={class:"pbx-border-0 pbx-border-solid pbx-border-t pbx-border-gray-200 pbx-flex pbx-items-center pbx-justify-end"},JU={class:"pbx-py-4 pbx-flex sm:pbx-justify-end pbx-justify-center"},KU={class:"sm:pbx-grid-cols-2 sm:pbx-items-end sm:pbx-justify-end pbx-flex pbx-flex-row pbx-myPrimaryGap pbx-w-full"},YU={key:1,class:"pbx-flex pbx-items-center pbx-my-2 pbx-justify-end"},XU=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=me(),o=r,{translate:n,loadTranslations:a}=te(),l=ll,s=re;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),k=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(){T()},y.value=async function(){}},T=function(){m.value=!1,p("handleClosePageBuilder")},L=async function(){s.setIsLoadingGlobal(!0),await t.handleManualSave(),s.setIsLoadingGlobal(!1),p("handlePublishPageBuilder")},S=()=>{fr.value=!1};i.provide("closeAddComponentModal",S);const M=i.ref("en");let C=!0;const A=i.ref(!1);i.watch(M,async R=>{if(R&&!C){A.value=!0,await pe(200),await a(R),t.changeLanguage(R);const B=JSON.parse(localStorage.getItem("userSettingsPageBuilder")??"{}")||{};B.lang=R,localStorage.setItem("userSettingsPageBuilder",JSON.stringify(B)),A.value=!1}});const E=i.computed(()=>s.getBuilderStarted),v=i.computed(()=>s.getPageBuilderConfig),D=i.computed(()=>{var B,Bt;const R=(Bt=(B=v.value)==null?void 0:B.userSettings)==null?void 0:Bt.fontFamily;return R?R.startsWith("pbx-font-")?R:`pbx-font-${R}`:"pbx-font-sans"}),N=i.computed(()=>s.getCurrentLanguage);i.watch(N,R=>{R&&R!==M.value&&(M.value=R)});const V=i.computed(()=>s.getMenuRight),fe=i.ref(!1),Gt=i.ref(""),tt=i.ref(""),ve=function(){t.previewCurrentDesign()},No=function(){Gt.value=n("Preview"),ve(),fe.value=!0},hr=i.ref(!1),Mt=function(){t.previewCurrentDesign()},Jt=function(){tt.value=n("Mobile"),Mt(),hr.value=!0},bt=i.ref(!1),Fa=function(){bt.value=!1},ja=function(){fe.value=!1},Di=function(){hr.value=!1},fr=i.ref(!1),Vi=i.ref(""),zi=i.ref(""),Zr=i.ref(null),qa=async function(){await t.clearHtmlSelection(),Vi.value=n("Add Components to Page"),zi.value=n("Close"),fr.value=!0,Zr.value=function(){fr.value=!1}},yr=function(R){s.setAddComponentAddIndex(R),s.setComponentArrayAddMethod("insert"),qa()},rt=i.computed(()=>s.getElement),ot=i.computed(()=>s.getComponents),Kt=i.computed(()=>s.getHasLocalDraftForUpdate),wr=i.computed(()=>s.getToggleGlobalHtmlMode);i.watch(Kt,R=>{R&&vp()});const fp=i.computed(()=>!rt.value||!(rt.value instanceof HTMLElement)?null:{src:rt.value.getAttribute("src"),href:rt.value.getAttribute("href"),style:rt.value.getAttribute("style"),class:rt.value.getAttribute("class"),dataImage:rt.value.getAttribute("data-image")}),yp=Hq();i.watch(fp,async(R,B)=>{((R==null?void 0:R.src)!==(B==null?void 0:B.src)||(R==null?void 0:R.href)!==(B==null?void 0:B.href)||(R==null?void 0:R.style)!==(B==null?void 0:B.style)||(R==null?void 0:R.class)!==(B==null?void 0:B.class)||(R==null?void 0:R.dataImage)!==(B==null?void 0:B.dataImage))&&yp(async()=>{await t.initializeElementStyles()},200)});const Yt=function(R){s.setComponent(R)},wp=i.computed(()=>s.getIsLoadingGlobal),Ii=i.computed(()=>s.getIsSaving),Xt=i.computed(()=>s.getIsLoadingResumeEditing),vr=i.computed(()=>s.getIsRestoring),_i=i.ref(1),$r=i.ref(""),Qt=i.ref(!1),Po=i.ref(""),Bo=i.ref(""),Lo=i.ref(""),kr=i.ref(null),Ao=i.ref(null),Nt=i.ref(null),Do=i.ref(null),Vo=i.ref(null),vp=async function(){$r.value="warning",Qt.value=!0,Po.value=n("Continue Your Work?"),Bo.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?"),Lo.value=n("Use Saved Version"),kr.value=null,Ao.value=n("Continue Where I Left Off"),Nt.value=async function(){s.setHasLocalDraftForUpdate(!1),Qt.value=!1},Do.value=function(){},Vo.value=async function(){await t.resumeEditingFromDraft(),s.setHasLocalDraftForUpdate(!1),Qt.value=!1}},Hi=i.ref(1),H=i.ref(""),P=i.ref(!1),_=i.ref(""),X=i.ref(""),ee=i.ref(""),ae=i.ref(null),Je=i.ref(null),Re=i.ref(null),Me=i.ref(null),ft=i.ref(null),Sr=async function(){await t.clearHtmlSelection(),H.value="success",P.value=!0,_.value=n("Do you want to reset this page?"),X.value=n("Are you sure you want to reset this page? This will overwrite your current changes."),ee.value=n("Close"),ae.value=null,Je.value=n("Reset changes"),Re.value=function(){P.value=!1},Me.value=async function(){},ft.value=async function(){await t.restoreOriginalContent(),P.value=!1}},xe=i.computed(()=>s.getShowModalHTMLEditor),ge=i.computed(()=>!rt.value||!(rt.value instanceof HTMLElement)?"":rt.value.outerHTML),U=i.ref(""),Pt=i.ref("");i.watch(xe,async R=>{if(R){if(!wr.value){U.value=ge.value;return}Pt.value=await t.generateHtmlFromComponents()}});const yt=()=>{s.setShowModalHTMLEditor(!1)},Ne=i.ref(!1),De=i.ref(null),Zt=i.ref(!1),$t=i.ref(!1),rW=async()=>{Zt.value=!0,$t.value=!0,Cp(),await pe(200),s.setToggleGlobalHtmlMode(!0),await t.globalPageStyles(),Cp(),$t.value=!1},oW=async()=>{$t.value=!0,await pe(200),await t.handleManualSave(),t.stopGlobalStylesSync();const R=document.querySelector("[data-pagebuilder-content]");R&&R.removeAttribute("data-global-selected"),Zt.value=!1,$t.value=!1},iW=async()=>{De.value=null,Ne.value=!0,await pe(300);const R=await t.applyModifiedHTML(U.value);if(R){De.value=R,Ne.value=!1;return}s.setShowModalHTMLEditor(!1),Ne.value=!1},nW=async()=>{De.value=null,Ne.value=!0,De.value=null,await pe(300);const R=await t.applyModifiedComponents(Pt.value);if(R){De.value=R,Ne.value=!1;return}s.setShowModalHTMLEditor(!1),Ne.value=!1},kp=function(){E.value||(bt.value=!0)},Sp=i.ref(null),Cp=function(){const R=document.querySelector("#pbxEditToolbar");R&&(R.classList.remove("is-visible"),R.removeAttribute("style"))};function Ua(){const R=Sp.value,B=R&&R.querySelector("#pbxEditToolbar");if(!R||!B)return;const Bt=R.querySelector("[selected]");if(Bt&&typeof Bt.getBoundingClientRect=="function"){const Cr=(Bt.closest("[data-pb-no-select]")||Bt).getBoundingClientRect(),Ri=R.getBoundingClientRect();let zo=Cr.left-Ri.left+Cr.width/2-B.offsetWidth/2;const rE=20;zo=Math.max(rE,Math.min(zo,R.offsetWidth-B.offsetWidth-rE));const aW=Cr.top-Ri.top+R.scrollTop-B.offsetHeight-20,lW=Math.max(0,aW);B.style.position="absolute",B.style.left=`${zo}px`,B.style.top=`${lW}px`,B.classList.add("is-visible")}else B.classList.remove("is-visible"),B.removeAttribute("style")}const Ep=JSON.parse(localStorage.getItem("userSettingsPageBuilder")??"null");return i.onMounted(async()=>{await t.completeBuilderInitialization(void 0),Ep&&Ep.lang&&(M.value=Ep.lang),await a(M.value),C=!1,Ua();const R=Sp.value;if(!R)return;new MutationObserver(Ua).observe(R,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["selected"]}),window.addEventListener("scroll",Ua),window.addEventListener("resize",Ua),await pe(1e4),kp(),await pe(1e4),kp(),await pe(1e4),kp()}),(R,B)=>{var Bt;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",Wq,[wp.value&&!bt.value||A.value?(i.openBlock(),i.createBlock(Z6,{key:0})):i.createCommentVNode("",!0),i.createVNode($e,{title:"The builder hasn’t started yet",showModalBuilder:bt.value,onCloseMainModalBuilder:Fa,type:"delete",maxWidth:"2xl",noBackgroundOpacity:!0},{default:i.withCtx(()=>[...B[33]||(B[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"]),fr.value?(i.openBlock(),i.createBlock(oH,{key:1,show:fr.value,firstButtonText:zi.value,title:Vi.value,CustomBuilderComponents:o.CustomBuilderComponents,onFirstModalButtonSearchComponentsFunction:B[0]||(B[0]=()=>{var q;return(q=Zr.value)==null?void 0:q.call(Zr)})},null,8,["show","firstButtonText","title","CustomBuilderComponents"])):i.createCommentVNode("",!0),i.createVNode(xt,{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:B[1]||(B[1]=()=>{var q;return(q=f.value)==null?void 0:q.call(f)}),onSecondModalButtonFunctionDynamicModalBuilder:B[2]||(B[2]=()=>{var q;return(q=w.value)==null?void 0:q.call(w)}),onThirdModalButtonFunctionDynamicModalBuilder:B[3]||(B[3]=()=>{var q;return(q=y.value)==null?void 0:q.call(y)})},{default:i.withCtx(()=>[...B[34]||(B[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:Gt.value,showModalBuilder:fe.value,onCloseMainModalBuilder:ja,maxWidth:"screen"},{default:i.withCtx(()=>[i.createVNode(Qa)]),_:1},8,["title","showModalBuilder"]),i.createVNode($e,{title:tt.value,showModalBuilder:hr.value,onCloseMainModalBuilder:Di,maxWidth:"lg"},{default:i.withCtx(()=>[i.createVNode(Qa,{mobile:!0})]),_:1},8,["title","showModalBuilder"]),i.createVNode(xt,{showDynamicModalBuilder:Qt.value,isLoading:Xt.value,type:$r.value,gridColumnAmount:_i.value,title:Po.value,description:Bo.value,firstButtonText:Lo.value,secondButtonText:kr.value??void 0,thirdButtonText:Ao.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:B[4]||(B[4]=()=>{var q;return(q=Nt.value)==null?void 0:q.call(Nt)}),onSecondModalButtonFunctionDynamicModalBuilder:B[5]||(B[5]=()=>{var q;return(q=Do.value)==null?void 0:q.call(Do)}),onThirdModalButtonFunctionDynamicModalBuilder:B[6]||(B[6]=()=>{var q;return(q=Vo.value)==null?void 0:q.call(Vo)})},{default:i.withCtx(()=>[...B[35]||(B[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(xt,{showDynamicModalBuilder:P.value,isLoading:vr.value,type:H.value,gridColumnAmount:Hi.value,title:_.value,description:X.value,firstButtonText:ee.value,secondButtonText:ae.value??void 0,thirdButtonText:Je.value??void 0,onFirstModalButtonFunctionDynamicModalBuilder:B[7]||(B[7]=()=>{var q;return(q=Re.value)==null?void 0:q.call(Re)}),onSecondModalButtonFunctionDynamicModalBuilder:B[8]||(B[8]=()=>{var q;return(q=Me.value)==null?void 0:q.call(Me)}),onThirdModalButtonFunctionDynamicModalBuilder:B[9]||(B[9]=()=>{var q;return(q=ft.value)==null?void 0:q.call(ft)})},{default:i.withCtx(()=>[...B[36]||(B[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",Gq,[v.value&&v.value.pageBuilderLogo&&v.value.pageBuilderLogo.src?(i.openBlock(),i.createElementBlock("div",{key:0,onClick:B[10]||(B[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,Jq)])):i.createCommentVNode("",!0),i.createVNode(jq,{onToolbarHideRequest:Cp}),i.createElementVNode("div",{onClick:B[13]||(B[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",Kq,[i.createElementVNode("button",{class:"pbx-mySecondaryButton pbx-h-6 pbx-flex pbx-gap-2 pbx-mr-2",onClick:B[11]||(B[11]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection(),await i.unref(t).handleManualSave()},["stop"])),type:"button",disabled:Ii.value},[Ii.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Xq,[...B[37]||(B[37]=[i.createElementVNode("span",{class:"material-symbols-outlined"},"save",-1)])])),Ii.value?(i.openBlock(),i.createElementBlock("div",Qq,[...B[38]||(B[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,Yq),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:B[12]||(B[12]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection(),await Sr()},["stop"])),type:"button",disabled:vr.value},[vr.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",$q,[...B[39]||(B[39]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," settings_backup_restore ",-1)])])),vr.value?(i.openBlock(),i.createElementBlock("div",eU,[...B[40]||(B[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",tU,[i.createElementVNode("span",null,i.toDisplayString(i.unref(n)("Reset Page")),1)]),i.createElementVNode("div",rU,[i.createElementVNode("span",null,i.toDisplayString(i.unref(n)("Reset")),1)])],8,Zq)):i.createCommentVNode("",!0)])]),i.createElementVNode("div",{onClick:B[18]||(B[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:B[17]||(B[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:B[14]||(B[14]=()=>{i.unref(s).setComponentArrayAddMethod("unshift"),qa()})},[i.createElementVNode("div",oU,[i.createElementVNode("span",iU,[i.createVNode(Uq)]),i.createElementVNode("span",nU,i.toDisplayString(i.unref(n)("Add")),1)])]),i.createElementVNode("div",aU,[i.createElementVNode("div",{onClick:B[15]||(B[15]=async()=>{i.unref(s).setMenuRight(!1),i.unref(s).setElement(null),await i.unref(t).clearHtmlSelection(),No()})},[i.createElementVNode("div",lU,[i.createElementVNode("span",sU,[i.createElementVNode("span",null,[(i.openBlock(),i.createElementBlock("svg",pU,[...B[41]||(B[41]=[i.createElementVNode("path",{"clip-rule":"evenodd",d:"M2 3h18v13h-8v2h3v2H7v-2h3v-2H2V3zm2 2v9h14V5H4z","fill-rule":"evenodd"},null,-1)])]))])])])])]),i.createElementVNode("div",dU,[i.createElementVNode("div",{onClick:B[16]||(B[16]=async()=>{i.unref(s).setMenuRight(!1),i.unref(s).setElement(null),await i.unref(t).clearHtmlSelection(),Jt()})},[i.createElementVNode("div",cU,[i.createElementVNode("span",mU,[(i.openBlock(),i.createElementBlock("svg",bU,[...B[42]||(B[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",xU,[i.createElementVNode("div",{onClick:B[19]||(B[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(_q)],2),r.showPublishButton?(i.openBlock(),i.createElementBlock("div",gU,[i.createElementVNode("button",{class:"pbx-myPrimaryButton",onClick:B[20]||(B[20]=async()=>{L()})},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",uU,[i.withDirectives(i.createElementVNode("select",{id:"pbx-lang",class:"pbx-myPrimarySelect pbx-min-w-20","onUpdate:modelValue":B[21]||(B[21]=q=>M.value=q)},[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(q=>{var Oi,Cr,Ri,zo;return((zo=(Ri=(Cr=(Oi=v.value)==null?void 0:Oi.userSettings)==null?void 0:Cr.language)==null?void 0:Ri.enable)==null?void 0:zo.includes(q))??!1}),q=>(i.openBlock(),i.createElementBlock("option",{key:q,value:q},i.toDisplayString(q),9,hU))),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(),q=>(i.openBlock(),i.createElementBlock("option",{key:q,value:q},i.toDisplayString(q),9,fU))),128)):i.createCommentVNode("",!0)],512),[[i.vModelSelect,M.value]])])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),r.showCloseButton?(i.openBlock(),i.createElementBlock("div",yU,[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:B[22]||(B[22]=async()=>{k(),await i.unref(t).clearHtmlSelection()})},[...B[43]||(B[43]=[i.createElementVNode("span",{class:"material-symbols-outlined"}," close ",-1)])])])):i.createCommentVNode("",!0)])]),i.createElementVNode("div",wU,[i.createElementVNode("div",{onClick:B[24]||(B[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",vU,[i.createElementVNode("div",{onClick:B[23]||(B[23]=i.withModifiers(async()=>{await i.unref(t).clearHtmlSelection()},["self"]))},[i.createVNode(wM)])])]),i.createElementVNode("main",{ref_key:"pbxBuilderWrapper",ref:Sp,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",kU,[rt.value?(i.openBlock(),i.createBlock(r_,{key:0,onOpenGlobalPageSettings:rW})):i.createCommentVNode("",!0)]),i.createElementVNode("div",{id:"pagebuilder","data-builder-canvas":"",class:i.normalizeClass([D.value,"pbx-text-black"])},[Array.isArray(ot.value)&&ot.value.length===0?(i.openBlock(),i.createElementBlock("div",SU,[i.createElementVNode("div",CU,[i.createElementVNode("div",{onClick:B[25]||(B[25]=q=>yr(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",EU,[i.createElementVNode("span",TU,i.toDisplayString(i.unref(n)("Add new Components")),1)])])])])):i.createCommentVNode("",!0),Array.isArray(ot.value)&&ot.value.length!=0?(i.openBlock(),i.createElementBlock("div",MU,[i.createElementVNode("div",NU,[i.createElementVNode("div",{onClick:B[26]||(B[26]=q=>yr(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",PU,[B[44]||(B[44]=i.createElementVNode("span",{class:"material-symbols-outlined"}," add ",-1)),i.createElementVNode("span",BU,i.toDisplayString(i.unref(n)("Add")),1)])])])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(ot.value,(q,Oi)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:q.id},[q.html_code?(i.openBlock(),i.createElementBlock("div",{key:0,"data-pagebuilder-content":"",innerHTML:q.html_code,onMouseup:Cr=>Yt(q)},null,40,LU)):i.createCommentVNode("",!0),Array.isArray(ot.value)&&ot.value.length!=0?(i.openBlock(),i.createElementBlock("div",AU,[i.createElementVNode("div",DU,[i.createElementVNode("div",{onClick:Cr=>yr(Oi+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",zU,[B[45]||(B[45]=i.createElementVNode("span",{class:"material-symbols-outlined"}," add ",-1)),i.createElementVNode("span",IU,i.toDisplayString(i.unref(n)("Add")),1)])],8,VU)])])):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(Pq,{onCloseEditor:B[27]||(B[27]=q=>i.unref(s).setMenuRight(!1))})],2)):(i.openBlock(),i.createElementBlock("div",{key:1,onClick:B[30]||(B[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:B[29]||(B[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:B[28]||(B[28]=q=>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",_U,[...B[46]||(B[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:Zt.value,title:i.unref(n)("Global Page Styles"),onCloseMainModalBuilder:oW,minHeight:"",maxHeight:""},{default:i.withCtx(()=>[i.createVNode(Q6,{isLoading:$t.value},null,8,["isLoading"])]),_:1},8,["showModalBuilder","title"]),i.createVNode($e,{maxWidth:"7xl",showModalBuilder:xe.value,title:i.unref(n)("HTML Editor"),onCloseMainModalBuilder:yt},{default:i.withCtx(()=>[wr.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.withDirectives(i.createElementVNode("textarea",{id:"html-editor","onUpdate:modelValue":B[31]||(B[31]=q=>U.value=q),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,U.value]]),i.createElementVNode("div",HU,[De.value?(i.openBlock(),i.createElementBlock("p",OU," Error: "+i.toDisplayString(De.value),1)):i.createCommentVNode("",!0)]),i.createElementVNode("div",RU,[i.createElementVNode("div",FU,[i.createElementVNode("div",jU,[Ne.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("button",{onClick:yt,type:"button",class:"pbx-mySecondaryButton"},i.toDisplayString(i.unref(n)("Close")),1),i.createElementVNode("button",{onClick:iW,type:"button",class:"pbx-myPrimaryButton"},i.toDisplayString(i.unref(n)("Save")),1)],64)),Ne.value?(i.openBlock(),i.createElementBlock("div",qU,[...B[47]||(B[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)),wr.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.withDirectives(i.createElementVNode("textarea",{id:"html-editor","onUpdate:modelValue":B[32]||(B[32]=q=>Pt.value=q),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,Pt.value]]),i.createElementVNode("div",UU,[De.value?(i.openBlock(),i.createElementBlock("p",WU," Error: "+i.toDisplayString(De.value),1)):i.createCommentVNode("",!0)]),i.createElementVNode("div",GU,[i.createElementVNode("div",JU,[i.createElementVNode("div",KU,[Ne.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("button",{onClick:yt,type:"button",class:"pbx-mySecondaryButton"},i.toDisplayString(i.unref(n)("Close")),1),i.createElementVNode("button",{onClick:nW,type:"button",class:"pbx-myPrimaryButton"},i.toDisplayString(i.unref(n)("Save")),1)],64)),Ne.value?(i.openBlock(),i.createElementBlock("div",YU,[...B[48]||(B[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 Mo{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(Mo,"HISTORY_KEY_SUFFIX","-history"),Q(Mo,"MAX_HISTORY_SIZE",10);let Oa;const QU=new Uint8Array(16);function ZU(){if(!Oa&&(Oa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Oa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oa(QU)}const Ae=[];for(let r=0;r<256;++r)Ae.push((r+256).toString(16).slice(1));function $U(r,e=0){return Ae[r[e+0]]+Ae[r[e+1]]+Ae[r[e+2]]+Ae[r[e+3]]+"-"+Ae[r[e+4]]+Ae[r[e+5]]+"-"+Ae[r[e+6]]+Ae[r[e+7]]+"-"+Ae[r[e+8]]+Ae[r[e+9]]+"-"+Ae[r[e+10]]+Ae[r[e+11]]+Ae[r[e+12]]+Ae[r[e+13]]+Ae[r[e+14]]+Ae[r[e+15]]}const $6={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eE(r,e,t){if($6.randomUUID&&!r)return $6.randomUUID();r=r||{};const o=r.random||(r.rng||ZU)();return o[6]=o[6]&15|64,o[8]=o[8]&63|128,$U(o)}const eW=["en","zh-Hans","fr","ja","ru","es","pt","de","ar","hi","da","it"],Ra="pbx-full-width-component";class tE{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)=>{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 pe(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 pe(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 pe(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}=te();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 eW}changeLanguage(e){this.pageBuilderStateStore.setCurrentLanguage(e)}async clearHtmlSelection(){this.pageBuilderStateStore.setComponent(null),this.pageBuilderStateStore.setElement(null),await this.removeHoveredAndSelected()}ensureUpdateOrCreateConfig(e){if(!e.updateOrCreate||e.updateOrCreate&&rr(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||rr(a)||!l||rr(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 pe(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 pe(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 pe(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
|
-
`)}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,Ut.fontWeight,"setFontWeight")}handleFontSizeBase(e){this.applyElementClassChanges(e,ko.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=ko.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(Ra))??!1}async setSelectedComponentFullWidth(e){const t=this.getSelectedComponentSection();t&&(t.classList.toggle(Ra,e),await this.handleAutoSave())}isGlobalFullWidth(){const e=document.querySelector("[data-pagebuilder-content]");return(e==null?void 0:e.classList.contains(Ra))??!1}async setGlobalFullWidth(e){document.querySelectorAll("[data-pagebuilder-content]").forEach(t=>{t.classList.toggle(Ra,e)}),this.saveDomComponentsToLocalStorage(),await this.handleAutoSave()}getHistoryBaseKey(){return this.getLocalStorageItemName.value}initializeHistory(){const e=this.getHistoryBaseKey();if(e){const t=Mo.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=eE(),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,Ut.fontFamily,"setFontFamily")}handleFontStyle(e){this.applyElementClassChanges(e,Ut.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([K.topPadding,K.bottomPadding]),this.applyElementClassChanges(e,K.verticalPadding,"setFontVerticalPadding")}handleHorizontalPadding(e){e!==void 0&&this.purgeConflictingClasses([K.leftPadding,K.rightPadding]),this.applyElementClassChanges(e,K.horizontalPadding,"setFontHorizontalPadding")}handleTopPadding(e){e!==void 0&&this.purgeConflictingClasses([K.verticalPadding]),this.applyElementClassChanges(e,K.topPadding,"setFontTopPadding")}handleRightPadding(e){e!==void 0&&this.purgeConflictingClasses([K.horizontalPadding]),this.applyElementClassChanges(e,K.rightPadding,"setFontRightPadding")}handleBottomPadding(e){e!==void 0&&this.purgeConflictingClasses([K.verticalPadding]),this.applyElementClassChanges(e,K.bottomPadding,"setFontBottomPadding")}handleLeftPadding(e){e!==void 0&&this.purgeConflictingClasses([K.horizontalPadding]),this.applyElementClassChanges(e,K.leftPadding,"setFontLeftPadding")}handleVerticalMargin(e){e!==void 0&&this.purgeConflictingClasses([K.topMargin,K.bottomMargin]),this.applyElementClassChanges(e,K.verticalMargin,"setFontVerticalMargin")}handleHorizontalMargin(e){e!==void 0&&this.purgeConflictingClasses([K.leftMargin,K.rightMargin]),this.applyElementClassChanges(e,K.horizontalMargin,"setFontHorizontalMargin")}handleTopMargin(e){e!==void 0&&this.purgeConflictingClasses([K.verticalMargin]),this.applyElementClassChanges(e,K.topMargin,"setFontTopMargin")}handleRightMargin(e){e!==void 0&&this.purgeConflictingClasses([K.horizontalMargin]),this.applyElementClassChanges(e,K.rightMargin,"setFontRightMargin")}handleBottomMargin(e){e!==void 0&&this.purgeConflictingClasses([K.verticalMargin]),this.applyElementClassChanges(e,K.bottomMargin,"setFontBottomMargin")}handleLeftMargin(e){e!==void 0&&this.purgeConflictingClasses([K.horizontalMargin]),this.applyElementClassChanges(e,K.leftMargin,"setFontLeftMargin")}handleBorderStyle(e){this.applyElementClassChanges(e,To.borderStyle,"setBorderStyle")}handleBorderWidth(e){this.applyElementClassChanges(e,To.borderWidth,"setBorderWidth")}handleBorderColor(e){this.applyElementClassChanges(e,To.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,Co.backgroundColorVariables,"setBackgroundColor")}handleCustomBackgroundColor(e){const t=this.getElement.value;!t||!e||(this.removeElementClassesFromArray(t,Co.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,Co.textColorVariables,"setTextColor")}handleCustomTextColor(e){const t=this.getElement.value;!t||!e||(this.removeElementClassesFromArray(t,Co.textColorVariables),t.style.setProperty("color",e),this.pageBuilderStateStore.setTextColor(`custom:${e}`),this.pageBuilderStateStore.setElement(t))}handleBorderRadiusGlobal(e){this.applyElementClassChanges(e,Tt.roundedGlobal,"setBorderRadiusGlobal")}handleBorderRadiusTopLeft(e){this.applyElementClassChanges(e,Tt.roundedTopLeft,"setBorderRadiusTopLeft")}handleBorderRadiusTopRight(e){this.applyElementClassChanges(e,Tt.roundedTopRight,"setBorderRadiusTopRight")}handleBorderRadiusBottomleft(e){this.applyElementClassChanges(e,Tt.roundedBottomLeft,"setBorderRadiusBottomleft")}handleBorderRadiusBottomRight(e){this.applyElementClassChanges(e,Tt.roundedBottomRight,"setBorderRadiusBottomRight")}handleFontSizeTablet(e){this.applyElementClassChanges(e,ko.fontTablet,"setFontTablet")}handleFontSizeMobile(e){this.applyElementClassChanges(e,ko.fontMobile,"setFontMobile")}handleBackgroundOpacity(e){this.applyElementClassChanges(e,Ha.backgroundOpacities,"setBackgroundOpacity")}handleOpacity(e){this.applyElementClassChanges(e,Ha.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 pe(300);const e=this.getHistoryBaseKey();if(!e)return;const t=Mo.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 pe(300);const e=this.getHistoryBaseKey();if(!e)return;const t=Mo.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]),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(){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)];this.pageBuilderStateStore.setComponents(a),await i.nextTick(),await this.addListenersToEditableElements(),this.pageBuilderStateStore.setComponent(n),this.pageBuilderStateStore.setElement(null),await this.handleAutoSave()}async deleteComponentFromDOM(){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)];this.pageBuilderStateStore.setComponents(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);const o=e.closest("section");if(o){const n=o.getAttribute("data-componentid");if(n){const a=this.pageBuilderStateStore.getComponents;if(a){const l=a.findIndex(s=>s.id===n);if(l!==-1){const s={...a[l],html_code:o.outerHTML},p=[...a.slice(0,l),s,...a.slice(l+1)];this.pageBuilderStateStore.setComponents(p)}}}}this.syncDomToStoreOnly(),await i.nextTick(),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");if(e.tagName==="SECTION")await this.deleteComponentFromDOM();else if(e.remove(),this.syncDomToStoreOnly(),t&&this.isSectionEmpty(t)){const o=t.getAttribute("data-componentid");if(o){const n=this.pageBuilderStateStore.getComponents;if(n){const a=n.findIndex(l=>l.id===o);if(a!==-1){const l=[...n.slice(0,a),...n.slice(a+1)];this.pageBuilderStateStore.setComponents(l),t.remove(),this.syncDomToStoreOnly(),this.saveDomComponentsToLocalStorage()}}}}else if(t){const o=t.getAttribute("data-componentid");if(o){const n=this.pageBuilderStateStore.getComponents;if(n){const a=n.findIndex(l=>l.id===o);if(a!==-1){const l={...n[a],html_code:t.outerHTML},s=[...n.slice(0,a),l,...n.slice(a+1)];this.pageBuilderStateStore.setComponents(s),this.syncDomToStoreOnly(),this.saveDomComponentsToLocalStorage()}}}}else 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=X6(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}syncDomToStoreOnly(){const e=document.querySelector("#pagebuilder");if(!e)return;const t=document.querySelector("[data-pagebuilder-content]"),o=(t==null?void 0:t.getAttribute("class"))||"",n=(t==null?void 0:t.getAttribute("style"))||"",a=[];e.querySelectorAll("section[data-componentid]").forEach(l=>{const s=this.cloneAndRemoveSelectionAttributes(l);a.push({html_code:s.outerHTML,id:s.getAttribute("data-componentid"),title:s.getAttribute("data-component-title")||"Untitled Component"})}),this.pageBuilderStateStore.setComponents(a),(o||n)&&i.nextTick(()=>{document.querySelectorAll("[data-pagebuilder-content]").forEach(l=>{o?l.setAttribute("class",o):l.removeAttribute("class"),n?l.setAttribute("style",n):l.removeAttribute("style")})})}async generateHtmlFromComponents(){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=Mo.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}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 pe(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 pe(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 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(`
|
|
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,Ut.fontWeight,"setFontWeight")}handleFontSizeBase(e){this.applyElementClassChanges(e,ko.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=ko.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(Ra))??!1}async setSelectedComponentFullWidth(e){const t=this.getSelectedComponentSection();t&&(t.classList.toggle(Ra,e),await this.handleAutoSave())}isGlobalFullWidth(){const e=document.querySelector("[data-pagebuilder-content]");return(e==null?void 0:e.classList.contains(Ra))??!1}async setGlobalFullWidth(e){document.querySelectorAll("[data-pagebuilder-content]").forEach(t=>{t.classList.toggle(Ra,e)}),this.saveDomComponentsToLocalStorage(),await this.handleAutoSave()}getHistoryBaseKey(){return this.getLocalStorageItemName.value}initializeHistory(){const e=this.getHistoryBaseKey();if(e){const t=Mo.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=eE(),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,Ut.fontFamily,"setFontFamily")}handleFontStyle(e){this.applyElementClassChanges(e,Ut.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([K.topPadding,K.bottomPadding]),this.applyElementClassChanges(e,K.verticalPadding,"setFontVerticalPadding")}handleHorizontalPadding(e){e!==void 0&&this.purgeConflictingClasses([K.leftPadding,K.rightPadding]),this.applyElementClassChanges(e,K.horizontalPadding,"setFontHorizontalPadding")}handleTopPadding(e){e!==void 0&&this.purgeConflictingClasses([K.verticalPadding]),this.applyElementClassChanges(e,K.topPadding,"setFontTopPadding")}handleRightPadding(e){e!==void 0&&this.purgeConflictingClasses([K.horizontalPadding]),this.applyElementClassChanges(e,K.rightPadding,"setFontRightPadding")}handleBottomPadding(e){e!==void 0&&this.purgeConflictingClasses([K.verticalPadding]),this.applyElementClassChanges(e,K.bottomPadding,"setFontBottomPadding")}handleLeftPadding(e){e!==void 0&&this.purgeConflictingClasses([K.horizontalPadding]),this.applyElementClassChanges(e,K.leftPadding,"setFontLeftPadding")}handleVerticalMargin(e){e!==void 0&&this.purgeConflictingClasses([K.topMargin,K.bottomMargin]),this.applyElementClassChanges(e,K.verticalMargin,"setFontVerticalMargin")}handleHorizontalMargin(e){e!==void 0&&this.purgeConflictingClasses([K.leftMargin,K.rightMargin]),this.applyElementClassChanges(e,K.horizontalMargin,"setFontHorizontalMargin")}handleTopMargin(e){e!==void 0&&this.purgeConflictingClasses([K.verticalMargin]),this.applyElementClassChanges(e,K.topMargin,"setFontTopMargin")}handleRightMargin(e){e!==void 0&&this.purgeConflictingClasses([K.horizontalMargin]),this.applyElementClassChanges(e,K.rightMargin,"setFontRightMargin")}handleBottomMargin(e){e!==void 0&&this.purgeConflictingClasses([K.verticalMargin]),this.applyElementClassChanges(e,K.bottomMargin,"setFontBottomMargin")}handleLeftMargin(e){e!==void 0&&this.purgeConflictingClasses([K.horizontalMargin]),this.applyElementClassChanges(e,K.leftMargin,"setFontLeftMargin")}handleBorderStyle(e){this.applyElementClassChanges(e,To.borderStyle,"setBorderStyle")}handleBorderWidth(e){this.applyElementClassChanges(e,To.borderWidth,"setBorderWidth")}handleBorderColor(e){this.applyElementClassChanges(e,To.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,Co.backgroundColorVariables,"setBackgroundColor")}handleCustomBackgroundColor(e){const t=this.getElement.value;!t||!e||(this.removeElementClassesFromArray(t,Co.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,Co.textColorVariables,"setTextColor")}handleCustomTextColor(e){const t=this.getElement.value;!t||!e||(this.removeElementClassesFromArray(t,Co.textColorVariables),t.style.setProperty("color",e),this.pageBuilderStateStore.setTextColor(`custom:${e}`),this.pageBuilderStateStore.setElement(t))}handleBorderRadiusGlobal(e){this.applyElementClassChanges(e,Tt.roundedGlobal,"setBorderRadiusGlobal")}handleBorderRadiusTopLeft(e){this.applyElementClassChanges(e,Tt.roundedTopLeft,"setBorderRadiusTopLeft")}handleBorderRadiusTopRight(e){this.applyElementClassChanges(e,Tt.roundedTopRight,"setBorderRadiusTopRight")}handleBorderRadiusBottomleft(e){this.applyElementClassChanges(e,Tt.roundedBottomLeft,"setBorderRadiusBottomleft")}handleBorderRadiusBottomRight(e){this.applyElementClassChanges(e,Tt.roundedBottomRight,"setBorderRadiusBottomRight")}handleFontSizeTablet(e){this.applyElementClassChanges(e,ko.fontTablet,"setFontTablet")}handleFontSizeMobile(e){this.applyElementClassChanges(e,ko.fontMobile,"setFontMobile")}handleBackgroundOpacity(e){this.applyElementClassChanges(e,Ha.backgroundOpacities,"setBackgroundOpacity")}handleOpacity(e){this.applyElementClassChanges(e,Ha.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 pe(300);const e=this.getHistoryBaseKey();if(!e)return;const t=Mo.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 pe(300);const e=this.getHistoryBaseKey();if(!e)return;const t=Mo.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=X6(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=Mo.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 pe(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 pe(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(T=>T.html_code).filter(T=>T&&T.trim()!=="").join(`
|
|
398
|
-
`);if(!t)return{score:0,checks:[]};const n=new DOMParser().parseFromString(t,"text/html"),a=[],s=[...n.querySelectorAll("p")].map(T=>{var L;return((L=T.textContent)==null?void 0:L.trim())??""}).join(" ").split(/\s+/).filter(T=>T.length>0).length;a.push({check:"At least 300 words of content",passed:s>=300,details:`Found ${s} words`,category:"Content"});const p=n.querySelectorAll("h2").length;a.push({check:"Has at least one H2",passed:p>0,details:`Found ${p} H2 headings`,category:"Headings"});const d=n.querySelectorAll("h3").length;a.push({check:"Has at least one H3",passed:d>0,details:`Found ${d} H3 headings`,category:"Headings"});const c=n.querySelectorAll("h4").length;a.push({check:"Has at least one H4",passed:c>0,details:`Found ${c} H4 headings`,category:"Headings"});const m=n.querySelectorAll("h5").length;a.push({check:"Has at least one H5",passed:m>0,details:`Found ${m} H5 headings`,category:"Headings"});const b=n.querySelectorAll("h6").length;a.push({check:"Has at least one H6",passed:b>0,details:`Found ${b} H6 headings`,category:"Headings"});const x=[2,3,4,5,6];let g=!0,u="Heading hierarchy is correct";for(let T=1;T<x.length;T++){const L=x[T],S=x[T-1];if(n.querySelectorAll(`h${L}`).length>0&&n.querySelectorAll(`h${S}`).length===0){g=!1,u=`H${L} found but H${S} is missing — heading levels should not be skipped`;break}}a.push({check:"Heading levels are not skipped",passed:g,details:u,category:"Headings"});const h=[...n.querySelectorAll("img")];a.push({check:"Page contains at least one image",passed:h.length>0,details:`Found ${h.length} image(s)`,category:"Media"});const f=h.filter(T=>!T.getAttribute("alt")||T.getAttribute("alt").trim()==="");a.push({check:"All images have alt text",passed:h.length===0||f.length===0,details:h.length===0?"No images found":f.length===0?`All ${h.length} image(s) have alt text`:`${f.length} of ${h.length} image(s) are missing alt text`,category:"Media"});const w=[...n.querySelectorAll("a[href]")].filter(T=>(T.getAttribute("href")||"").trim()!=="");a.push({check:"Page contains at least one link",passed:w.length>0,details:`Found ${w.length} link(s)`,category:"Links"});const y=a.filter(T=>T.passed).length;return{score:Math.round(y/a.length*100),checks:a}}async addComponent(e){var o,n,a,l,s;const t=this.pageBuilderStateStore.getAddComponentAddIndex??0;try{const p=this.cloneCompObjForDOMInsertion({html_code:e.html_code,id:e.id,title:e.title});let d=t;if(this.getComponentArrayAddMethod.value==="insert"&&typeof t=="number"&&t>=0){const m=document.querySelector("[data-pagebuilder-content]"),b=(m==null?void 0:m.getAttribute("class"))||((o=this._lastKnownPageSettings)==null?void 0:o.classes)||"",x=(m==null?void 0:m.getAttribute("style"))||((n=this._lastKnownPageSettings)==null?void 0:n.style)||"";(a=this.globalStylesObserver)==null||a.disconnect(),this.syncDomToStoreOnly(),await i.nextTick();const g=this.pageBuilderStateStore.getComponents||[],u=[...g.slice(0,t),p,...g.slice(t)];this.pageBuilderStateStore.setComponents(u),d=t,await i.nextTick(),await i.nextTick(),(b||x)&&document.querySelectorAll("[data-pagebuilder-content]").forEach(f=>{b?f.setAttribute("class",b):f.removeAttribute("class"),x?f.setAttribute("style",x):f.removeAttribute("style")});const h=document.querySelector("[data-pagebuilder-content]");if(h&&this.globalStylesObserver!==null){const f=document.querySelectorAll("[data-pagebuilder-content]");this.globalStylesObserver=new MutationObserver(()=>{const w=h.getAttribute("class")??"",y=h.getAttribute("style")??"";f.forEach(k=>{k!==h&&(w?k.setAttribute("class",w):k.removeAttribute("class"),y?k.setAttribute("style",y):k.removeAttribute("style"))})}),this.globalStylesObserver.observe(h,{attributes:!0,attributeFilter:["class","style"]})}}else{const m=document.querySelector("[data-pagebuilder-content]"),b=(m==null?void 0:m.getAttribute("class"))||((l=this._lastKnownPageSettings)==null?void 0:l.classes)||"",x=(m==null?void 0:m.getAttribute("style"))||((s=this._lastKnownPageSettings)==null?void 0:s.style)||"";this.pageBuilderStateStore.setPushComponents({component:p,componentArrayAddMethod:this.getComponentArrayAddMethod.value?this.getComponentArrayAddMethod.value:"push"}),(b||x)&&(await i.nextTick(),await i.nextTick(),document.querySelectorAll("[data-pagebuilder-content]").forEach(g=>{b?g.setAttribute("class",b):g.removeAttribute("class"),x?g.setAttribute("style",x):g.removeAttribute("style")}))}const c=document.querySelector("#page-builder-wrapper");if(c&&(this.getComponentArrayAddMethod.value==="push"&&c.scrollTo({top:c.scrollHeight+50,behavior:"smooth"}),this.getComponentArrayAddMethod.value==="insert"&&typeof d=="number")){this.saveDomComponentsToLocalStorage(),await i.nextTick(),await i.nextTick();const m=c.querySelectorAll("section[data-componentid]");if(m.length>0){const b=Math.max(0,Math.min(d,m.length-1)),x=m[b];x&&x.scrollIntoView({behavior:"smooth",block:"center"})}}await i.nextTick(),await this.addListenersToEditableElements(),await this.handleAutoSave()}catch(p){console.error("Error adding component:",p)}finally{this.pageBuilderStateStore.setAddComponentAddIndex(null)}}addTailwindPrefixToClasses(e,t="pbx-"){return e.split(/\s+/).map(o=>{if(!o||o.startsWith(t))return o;const n=o.split(":"),a=n.pop();return a.startsWith(t)?o:[...n,t+a].join(":")}).join(" ")}convertStyleObjectToString(e){return e?typeof e=="string"?e:Object.entries(e).map(([t,o])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`).join(" "):""}parsePageBuilderHTML(e){const o=new DOMParser().parseFromString(e,"text/html");o.querySelectorAll("[class]").forEach(d=>{const c=d.getAttribute("class")||"",m=this.addTailwindPrefixToClasses(c);d.setAttribute("class",m)});const n=o.querySelector("#pagebuilder");let a={classes:"",style:{}};if(n){const d=n.getAttribute("style")||"";a={classes:n.className||"",style:this.parseStyleString(d)}}let l=o.querySelectorAll("section");n&&(l=n.querySelectorAll("section"));const s=Array.from(l).filter(d=>!d.parentElement||d.parentElement.tagName.toLowerCase()!=="section");let p=[];if(s.length>0&&(p=s.map(d=>({id:null,html_code:d.outerHTML.trim(),title:d.getAttribute("data-component-title")||"Untitled Component"}))),s.length===0){const d=n||o.body,c=Array.from(d.children);if(c.length>0&&(p=c.map(m=>{const b=o.createElement("section");return b.setAttribute("data-component-title","Untitled Component"),b.innerHTML=m.outerHTML.trim(),{id:null,html_code:b.outerHTML.trim(),title:"Untitled Component"}})),c.length===0){const m=o.createElement("section");m.setAttribute("data-component-title","Untitled Component"),m.innerHTML=d.innerHTML.trim(),p=[{id:null,html_code:m.outerHTML.trim(),title:"Untitled Component"}]}}return{components:p,pageSettings:a}}async applyModifiedHTML(e){if(!e||typeof e=="string"&&e.length===0)return this.translate("No HTML content was provided. Please ensure a valid HTML string is passed.");if(/<section[\s>]/i.test(e))return this.translate("Error: The <section> tag cannot be used as it is already included inside this component.");const t=document.createElement("div");t.innerHTML=e.trim();const o=t.firstElementChild;if(!o)return this.translate("Could not parse element from HTML string.");const n=this.pageBuilderStateStore.getElement;return n&&n.parentElement&&(n.replaceWith(o),this.pageBuilderStateStore.setElement(o)),await this.addListenersToEditableElements(),await i.nextTick(),null}validateMountingHTML(e,t){const o=e.trim(),n=e.match(/<section\b[^>]*>/gi)||[],a=e.match(/<\/section>/gi)||[];if(!e||e.trim().length===0){const p=this.translate("No HTML content was provided. Please ensure a valid HTML string is passed.");return t&&t.logError&&console.error(p),p}if(n.length!==a.length){const p=this.translate("Uneven <section> tags detected in the provided HTML. Each component must be wrapped in its own properly paired <section>...</section>. Ensure that all <section> tags have a matching closing </section> tag.");return t&&t.logError&&console.error(p),p}const l=document.createElement("div");if(l.innerHTML=o,l.querySelector("section section")){const p=this.translate("Nested <section> tags are not allowed. Please ensure that no <section> is placed inside another <section>.");return t&&t.logError&&console.error(p),p}if(o.startsWith("[")||o.startsWith("{")){const p=this.translate("Brackets [] or curly braces {} are not valid HTML. They are used for data formats like JSON.");return t&&t.logError&&console.error(p),p}return null}async applyModifiedComponents(e){const t=e.trim();if((e.match(/<section\b[^>]*>/gi)||[]).length===0){const a=this.translate("No <section> tags found. Each component must be wrapped in a <section> tag.");if(a)return a}const n=this.validateMountingHTML(t);return n||(await this.mountComponentsToDOM(t),await this.addListenersToEditableElements(),await i.nextTick(),null)}async mountComponentsToDOM(e,t,o){var l,s;const n=e.trim();if(!this.validateMountingHTML(n,{logError:!0}))try{const d=new DOMParser().parseFromString(e,"text/html"),c=d.querySelector("#pagebuilder");let m=null;const b=document.querySelector("[data-pagebuilder-content]"),x=b?{classes:b.getAttribute("class")||"",style:this.parseStyleString(b.getAttribute("style")||"")}:null;t&&(m=((l=this.pageBuilderStateStore.getPageBuilderConfig)==null?void 0:l.pageSettings)||x),!o&&!m&&c&&(m={classes:c.className||"",style:this.parseStyleString(c.getAttribute("style")||"")}),m||(m=((s=this.pageBuilderStateStore.getPageBuilderConfig)==null?void 0:s.pageSettings)||null),!o&&m&&(this._pendingPageSettings=m),o&&(this._pendingPageSettings=o);const g=d.querySelectorAll("section"),u=[];if(g.forEach(h=>{h.querySelectorAll("[class]").forEach(k=>{k.setAttribute("class",this.addTailwindPrefixToClasses(k.getAttribute("class")||"","pbx-"))});const f=h;f.hasAttribute("data-componentid")||f.setAttribute("data-componentid",eE());const w=f.getAttribute("data-componentid"),y=f.getAttribute("data-component-title")||"Untitled Component";f.setAttribute("data-component-title",y),u.push({html_code:f.outerHTML,id:w,title:y})}),this.pageBuilderStateStore.setComponents(u),await this.clearHtmlSelection(),await i.nextTick(),this._pendingPageSettings){const h=this._pendingPageSettings;this._pendingPageSettings=null;const f=document.querySelectorAll("[data-pagebuilder-content]");f.length>0?f.forEach(w=>{w.removeAttribute("class"),w.removeAttribute("style"),h.classes&&w.setAttribute("class",h.classes);const y=this.convertStyleObjectToString(h.style);y&&w.setAttribute("style",y)}):this._lastKnownPageSettings={classes:h.classes||"",style:this.convertStyleObjectToString(h.style)||""}}await this.addListenersToEditableElements()}catch(p){console.error("Error parsing HTML components:",p),this.deleteAllComponentsFromDOM(),await this.clearHtmlSelection(),await i.nextTick(),await this.addListenersToEditableElements()}}updateLocalStorageItemName(){const e=this.pageBuilderStateStore.getPageBuilderConfig&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate.formType,t=this.pageBuilderStateStore.getPageBuilderConfig&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate.formName,o=this.pageBuilderStateStore.getPageBuilderConfig&&this.pageBuilderStateStore.getPageBuilderConfig.resourceData;if(e==="create"){if(t&&t.length>0){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-create-resource-${this.sanitizeForLocalStorage(t)}`);return}this.pageBuilderStateStore.setLocalStorageItemName("page-builder-create-resource");return}if(e==="update"){if(typeof t=="string"&&t.length>0){if(o&&o!=null&&!o.title&&(!o.id||typeof o.id=="string")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(t)}`);return}if(o&&o!=null&&o.title&&typeof o.title=="string"&&o.title.length>0&&(!o.id||typeof o.id=="string")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(t)}-${this.sanitizeForLocalStorage(o.title)}`);return}if(o&&o!=null&&!o.title&&typeof o.title!="string"&&(o.id||typeof o.id=="number")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(t)}-${this.sanitizeForLocalStorage(String(o.id))}`);return}if(o&&o!=null&&o.title&&typeof o.title=="string"&&o.title.length>0&&(o.id||typeof o.id=="number")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(t)}-${this.sanitizeForLocalStorage(o.title)}-${this.sanitizeForLocalStorage(String(o.id))}`);return}}if(!t||typeof t=="string"&&t.length===0){if(o&&o!=null&&!o.title&&(!o.id||typeof o.id=="string")){this.pageBuilderStateStore.setLocalStorageItemName("page-builder-update-resource");return}if(o&&o!=null&&o.title&&typeof o.title=="string"&&o.title.length>0&&(!o.id||typeof o.id=="string")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(o.title)}`);return}if(o&&o!=null&&!o.title&&typeof o.title!="string"&&(o.id||typeof o.id=="number")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(String(o.id))}`);return}if(o&&o!=null&&o.title&&typeof o.title=="string"&&o.title.length>0&&(o.id||typeof o.id=="number")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(o.title)}-${this.sanitizeForLocalStorage(String(o.id))}`);return}}}}async initializeElementStyles(){await i.nextTick(),this.setBasePrimaryImageFromSelectedElement(),this.handleHyperlink(void 0,null,!1),this.handleOpacity(void 0),this.handleBackgroundOpacity(void 0),this.handleBackgroundColor(void 0),this.handleTextColor(void 0),this.handleBorderStyle(void 0),this.handleBorderWidth(void 0),this.handleBorderColor(void 0),this.handleBorderRadiusGlobal(void 0),this.handleBorderRadiusTopLeft(void 0),this.handleBorderRadiusTopRight(void 0),this.handleBorderRadiusBottomleft(void 0),this.handleBorderRadiusBottomRight(void 0),this.handleFontSizeBase(void 0),this.handleFontSizeDesktop(void 0),this.handleFontSizeTablet(void 0),this.handleFontSizeMobile(void 0),this.handleFontWeight(void 0),this.handleFontFamily(void 0),this.handleFontStyle(void 0),this.handleVerticalPadding(void 0),this.handleHorizontalPadding(void 0),this.handleTopPadding(void 0),this.handleRightPadding(void 0),this.handleBottomPadding(void 0),this.handleLeftPadding(void 0),this.handleVerticalMargin(void 0),this.handleHorizontalMargin(void 0),this.handleTopMargin(void 0),this.handleRightMargin(void 0),this.handleBottomMargin(void 0),this.handleLeftMargin(void 0),await this.syncCurrentClasses(),await this.syncCurrentStyles()}}const tW={install:r=>{const e=re,t=new tE(e);ME(t),r.config.globalProperties.$pageBuilder=t}};ie.PageBuilder=XU,ie.PageBuilderService=tE,ie.Preview=Qa,ie.buildStorageKey=dp,ie.createPinia=L3,ie.getPageBuilder=me,ie.pageBuilder=tW,ie.resetThemeColorPresets=bz,ie.sharedPageBuilderPinia=ll,ie.sharedPageBuilderStore=re,ie.usePageBuilderModal=j6,ie.usePageBuilderStateStore=H3,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})}));
|
|
398
|
+
`);if(!t)return{score:0,checks:[]};const n=new DOMParser().parseFromString(t,"text/html"),a=[],s=[...n.querySelectorAll("p")].map(T=>{var L;return((L=T.textContent)==null?void 0:L.trim())??""}).join(" ").split(/\s+/).filter(T=>T.length>0).length;a.push({check:"At least 300 words of content",passed:s>=300,details:`Found ${s} words`,category:"Content"});const p=n.querySelectorAll("h2").length;a.push({check:"Has at least one H2",passed:p>0,details:`Found ${p} H2 headings`,category:"Headings"});const d=n.querySelectorAll("h3").length;a.push({check:"Has at least one H3",passed:d>0,details:`Found ${d} H3 headings`,category:"Headings"});const c=n.querySelectorAll("h4").length;a.push({check:"Has at least one H4",passed:c>0,details:`Found ${c} H4 headings`,category:"Headings"});const m=n.querySelectorAll("h5").length;a.push({check:"Has at least one H5",passed:m>0,details:`Found ${m} H5 headings`,category:"Headings"});const b=n.querySelectorAll("h6").length;a.push({check:"Has at least one H6",passed:b>0,details:`Found ${b} H6 headings`,category:"Headings"});const x=[2,3,4,5,6];let g=!0,u="Heading hierarchy is correct";for(let T=1;T<x.length;T++){const L=x[T],S=x[T-1];if(n.querySelectorAll(`h${L}`).length>0&&n.querySelectorAll(`h${S}`).length===0){g=!1,u=`H${L} found but H${S} is missing — heading levels should not be skipped`;break}}a.push({check:"Heading levels are not skipped",passed:g,details:u,category:"Headings"});const h=[...n.querySelectorAll("img")];a.push({check:"Page contains at least one image",passed:h.length>0,details:`Found ${h.length} image(s)`,category:"Media"});const f=h.filter(T=>!T.getAttribute("alt")||T.getAttribute("alt").trim()==="");a.push({check:"All images have alt text",passed:h.length===0||f.length===0,details:h.length===0?"No images found":f.length===0?`All ${h.length} image(s) have alt text`:`${f.length} of ${h.length} image(s) are missing alt text`,category:"Media"});const w=[...n.querySelectorAll("a[href]")].filter(T=>(T.getAttribute("href")||"").trim()!=="");a.push({check:"Page contains at least one link",passed:w.length>0,details:`Found ${w.length} link(s)`,category:"Links"});const y=a.filter(T=>T.passed).length;return{score:Math.round(y/a.length*100),checks:a}}async addComponent(e){var o,n,a,l,s;const t=this.pageBuilderStateStore.getAddComponentAddIndex??0;try{const p=this.cloneCompObjForDOMInsertion({html_code:e.html_code,id:e.id,title:e.title});let d=t;if(this.getComponentArrayAddMethod.value==="insert"&&typeof t=="number"&&t>=0){const m=document.querySelector("[data-pagebuilder-content]"),b=(m==null?void 0:m.getAttribute("class"))||((o=this._lastKnownPageSettings)==null?void 0:o.classes)||"",x=(m==null?void 0:m.getAttribute("style"))||((n=this._lastKnownPageSettings)==null?void 0:n.style)||"";(a=this.globalStylesObserver)==null||a.disconnect(),await this.syncDomToStoreOnly(),await i.nextTick();const g=this.pageBuilderStateStore.getComponents||[],u=[...g.slice(0,t),p,...g.slice(t)];this.pageBuilderStateStore.setComponents(u),d=t,await i.nextTick(),await i.nextTick(),(b||x)&&document.querySelectorAll("[data-pagebuilder-content]").forEach(f=>{b?f.setAttribute("class",b):f.removeAttribute("class"),x?f.setAttribute("style",x):f.removeAttribute("style")});const h=document.querySelector("[data-pagebuilder-content]");if(h&&this.globalStylesObserver!==null){const f=document.querySelectorAll("[data-pagebuilder-content]");this.globalStylesObserver=new MutationObserver(()=>{const w=h.getAttribute("class")??"",y=h.getAttribute("style")??"";f.forEach(k=>{k!==h&&(w?k.setAttribute("class",w):k.removeAttribute("class"),y?k.setAttribute("style",y):k.removeAttribute("style"))})}),this.globalStylesObserver.observe(h,{attributes:!0,attributeFilter:["class","style"]})}}else{const m=document.querySelector("[data-pagebuilder-content]"),b=(m==null?void 0:m.getAttribute("class"))||((l=this._lastKnownPageSettings)==null?void 0:l.classes)||"",x=(m==null?void 0:m.getAttribute("style"))||((s=this._lastKnownPageSettings)==null?void 0:s.style)||"";this.pageBuilderStateStore.setPushComponents({component:p,componentArrayAddMethod:this.getComponentArrayAddMethod.value?this.getComponentArrayAddMethod.value:"push"}),(b||x)&&(await i.nextTick(),await i.nextTick(),document.querySelectorAll("[data-pagebuilder-content]").forEach(g=>{b?g.setAttribute("class",b):g.removeAttribute("class"),x?g.setAttribute("style",x):g.removeAttribute("style")}))}const c=document.querySelector("#page-builder-wrapper");if(c&&(this.getComponentArrayAddMethod.value==="push"&&c.scrollTo({top:c.scrollHeight+50,behavior:"smooth"}),this.getComponentArrayAddMethod.value==="insert"&&typeof d=="number")){this.saveDomComponentsToLocalStorage(),await i.nextTick(),await i.nextTick();const m=c.querySelectorAll("section[data-componentid]");if(m.length>0){const b=Math.max(0,Math.min(d,m.length-1)),x=m[b];x&&x.scrollIntoView({behavior:"smooth",block:"center"})}}await i.nextTick(),await this.addListenersToEditableElements(),await this.handleAutoSave()}catch(p){console.error("Error adding component:",p)}finally{this.pageBuilderStateStore.setAddComponentAddIndex(null)}}addTailwindPrefixToClasses(e,t="pbx-"){return e.split(/\s+/).map(o=>{if(!o||o.startsWith(t))return o;const n=o.split(":"),a=n.pop();return a.startsWith(t)?o:[...n,t+a].join(":")}).join(" ")}convertStyleObjectToString(e){return e?typeof e=="string"?e:Object.entries(e).map(([t,o])=>`${t.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${o};`).join(" "):""}parsePageBuilderHTML(e){const o=new DOMParser().parseFromString(e,"text/html");o.querySelectorAll("[class]").forEach(d=>{const c=d.getAttribute("class")||"",m=this.addTailwindPrefixToClasses(c);d.setAttribute("class",m)});const n=o.querySelector("#pagebuilder");let a={classes:"",style:{}};if(n){const d=n.getAttribute("style")||"";a={classes:n.className||"",style:this.parseStyleString(d)}}let l=o.querySelectorAll("section");n&&(l=n.querySelectorAll("section"));const s=Array.from(l).filter(d=>!d.parentElement||d.parentElement.tagName.toLowerCase()!=="section");let p=[];if(s.length>0&&(p=s.map(d=>({id:null,html_code:d.outerHTML.trim(),title:d.getAttribute("data-component-title")||"Untitled Component"}))),s.length===0){const d=n||o.body,c=Array.from(d.children);if(c.length>0&&(p=c.map(m=>{const b=o.createElement("section");return b.setAttribute("data-component-title","Untitled Component"),b.innerHTML=m.outerHTML.trim(),{id:null,html_code:b.outerHTML.trim(),title:"Untitled Component"}})),c.length===0){const m=o.createElement("section");m.setAttribute("data-component-title","Untitled Component"),m.innerHTML=d.innerHTML.trim(),p=[{id:null,html_code:m.outerHTML.trim(),title:"Untitled Component"}]}}return{components:p,pageSettings:a}}async applyModifiedHTML(e){if(!e||typeof e=="string"&&e.length===0)return this.translate("No HTML content was provided. Please ensure a valid HTML string is passed.");if(/<section[\s>]/i.test(e))return this.translate("Error: The <section> tag cannot be used as it is already included inside this component.");const t=document.createElement("div");t.innerHTML=e.trim();const o=t.firstElementChild;if(!o)return this.translate("Could not parse element from HTML string.");const n=this.pageBuilderStateStore.getElement;return n&&n.parentElement&&(n.replaceWith(o),this.pageBuilderStateStore.setElement(o)),await this.addListenersToEditableElements(),await i.nextTick(),null}validateMountingHTML(e,t){const o=e.trim(),n=e.match(/<section\b[^>]*>/gi)||[],a=e.match(/<\/section>/gi)||[];if(!e||e.trim().length===0){const p=this.translate("No HTML content was provided. Please ensure a valid HTML string is passed.");return t&&t.logError&&console.error(p),p}if(n.length!==a.length){const p=this.translate("Uneven <section> tags detected in the provided HTML. Each component must be wrapped in its own properly paired <section>...</section>. Ensure that all <section> tags have a matching closing </section> tag.");return t&&t.logError&&console.error(p),p}const l=document.createElement("div");if(l.innerHTML=o,l.querySelector("section section")){const p=this.translate("Nested <section> tags are not allowed. Please ensure that no <section> is placed inside another <section>.");return t&&t.logError&&console.error(p),p}if(o.startsWith("[")||o.startsWith("{")){const p=this.translate("Brackets [] or curly braces {} are not valid HTML. They are used for data formats like JSON.");return t&&t.logError&&console.error(p),p}return null}async applyModifiedComponents(e){const t=e.trim();if((e.match(/<section\b[^>]*>/gi)||[]).length===0){const a=this.translate("No <section> tags found. Each component must be wrapped in a <section> tag.");if(a)return a}const n=this.validateMountingHTML(t);return n||(await this.mountComponentsToDOM(t),await this.addListenersToEditableElements(),await i.nextTick(),null)}async mountComponentsToDOM(e,t,o){var l,s;const n=e.trim();if(!this.validateMountingHTML(n,{logError:!0}))try{const d=new DOMParser().parseFromString(e,"text/html"),c=d.querySelector("#pagebuilder");let m=null;const b=document.querySelector("[data-pagebuilder-content]"),x=b?{classes:b.getAttribute("class")||"",style:this.parseStyleString(b.getAttribute("style")||"")}:null;t&&(m=((l=this.pageBuilderStateStore.getPageBuilderConfig)==null?void 0:l.pageSettings)||x),!o&&!m&&c&&(m={classes:c.className||"",style:this.parseStyleString(c.getAttribute("style")||"")}),m||(m=((s=this.pageBuilderStateStore.getPageBuilderConfig)==null?void 0:s.pageSettings)||null),!o&&m&&(this._pendingPageSettings=m),o&&(this._pendingPageSettings=o);const g=d.querySelectorAll("section"),u=[];if(g.forEach(h=>{h.querySelectorAll("[class]").forEach(k=>{k.setAttribute("class",this.addTailwindPrefixToClasses(k.getAttribute("class")||"","pbx-"))});const f=h;f.hasAttribute("data-componentid")||f.setAttribute("data-componentid",eE());const w=f.getAttribute("data-componentid"),y=f.getAttribute("data-component-title")||"Untitled Component";f.setAttribute("data-component-title",y),u.push({html_code:f.outerHTML,id:w,title:y})}),this.pageBuilderStateStore.setComponents(u),await this.clearHtmlSelection(),await i.nextTick(),this._pendingPageSettings){const h=this._pendingPageSettings;this._pendingPageSettings=null;const f=document.querySelectorAll("[data-pagebuilder-content]");f.length>0?f.forEach(w=>{w.removeAttribute("class"),w.removeAttribute("style"),h.classes&&w.setAttribute("class",h.classes);const y=this.convertStyleObjectToString(h.style);y&&w.setAttribute("style",y)}):this._lastKnownPageSettings={classes:h.classes||"",style:this.convertStyleObjectToString(h.style)||""}}await this.addListenersToEditableElements()}catch(p){console.error("Error parsing HTML components:",p),this.deleteAllComponentsFromDOM(),await this.clearHtmlSelection(),await i.nextTick(),await this.addListenersToEditableElements()}}updateLocalStorageItemName(){const e=this.pageBuilderStateStore.getPageBuilderConfig&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate.formType,t=this.pageBuilderStateStore.getPageBuilderConfig&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate&&this.pageBuilderStateStore.getPageBuilderConfig.updateOrCreate.formName,o=this.pageBuilderStateStore.getPageBuilderConfig&&this.pageBuilderStateStore.getPageBuilderConfig.resourceData;if(e==="create"){if(t&&t.length>0){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-create-resource-${this.sanitizeForLocalStorage(t)}`);return}this.pageBuilderStateStore.setLocalStorageItemName("page-builder-create-resource");return}if(e==="update"){if(typeof t=="string"&&t.length>0){if(o&&o!=null&&!o.title&&(!o.id||typeof o.id=="string")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(t)}`);return}if(o&&o!=null&&o.title&&typeof o.title=="string"&&o.title.length>0&&(!o.id||typeof o.id=="string")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(t)}-${this.sanitizeForLocalStorage(o.title)}`);return}if(o&&o!=null&&!o.title&&typeof o.title!="string"&&(o.id||typeof o.id=="number")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(t)}-${this.sanitizeForLocalStorage(String(o.id))}`);return}if(o&&o!=null&&o.title&&typeof o.title=="string"&&o.title.length>0&&(o.id||typeof o.id=="number")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(t)}-${this.sanitizeForLocalStorage(o.title)}-${this.sanitizeForLocalStorage(String(o.id))}`);return}}if(!t||typeof t=="string"&&t.length===0){if(o&&o!=null&&!o.title&&(!o.id||typeof o.id=="string")){this.pageBuilderStateStore.setLocalStorageItemName("page-builder-update-resource");return}if(o&&o!=null&&o.title&&typeof o.title=="string"&&o.title.length>0&&(!o.id||typeof o.id=="string")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(o.title)}`);return}if(o&&o!=null&&!o.title&&typeof o.title!="string"&&(o.id||typeof o.id=="number")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(String(o.id))}`);return}if(o&&o!=null&&o.title&&typeof o.title=="string"&&o.title.length>0&&(o.id||typeof o.id=="number")){this.pageBuilderStateStore.setLocalStorageItemName(`page-builder-update-resource-${this.sanitizeForLocalStorage(o.title)}-${this.sanitizeForLocalStorage(String(o.id))}`);return}}}}async initializeElementStyles(){await i.nextTick(),this.setBasePrimaryImageFromSelectedElement(),this.handleHyperlink(void 0,null,!1),this.handleOpacity(void 0),this.handleBackgroundOpacity(void 0),this.handleBackgroundColor(void 0),this.handleTextColor(void 0),this.handleBorderStyle(void 0),this.handleBorderWidth(void 0),this.handleBorderColor(void 0),this.handleBorderRadiusGlobal(void 0),this.handleBorderRadiusTopLeft(void 0),this.handleBorderRadiusTopRight(void 0),this.handleBorderRadiusBottomleft(void 0),this.handleBorderRadiusBottomRight(void 0),this.handleFontSizeBase(void 0),this.handleFontSizeDesktop(void 0),this.handleFontSizeTablet(void 0),this.handleFontSizeMobile(void 0),this.handleFontWeight(void 0),this.handleFontFamily(void 0),this.handleFontStyle(void 0),this.handleVerticalPadding(void 0),this.handleHorizontalPadding(void 0),this.handleTopPadding(void 0),this.handleRightPadding(void 0),this.handleBottomPadding(void 0),this.handleLeftPadding(void 0),this.handleVerticalMargin(void 0),this.handleHorizontalMargin(void 0),this.handleTopMargin(void 0),this.handleRightMargin(void 0),this.handleBottomMargin(void 0),this.handleLeftMargin(void 0),await this.syncCurrentClasses(),await this.syncCurrentStyles()}}const tW={install:r=>{const e=re,t=new tE(e);ME(t),r.config.globalProperties.$pageBuilder=t}};ie.PageBuilder=XU,ie.PageBuilderService=tE,ie.Preview=Qa,ie.buildStorageKey=dp,ie.createPinia=L3,ie.getPageBuilder=me,ie.pageBuilder=tW,ie.resetThemeColorPresets=bz,ie.sharedPageBuilderPinia=ll,ie.sharedPageBuilderStore=re,ie.usePageBuilderModal=j6,ie.usePageBuilderStateStore=H3,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED