@venite/components 0.16.49 → 0.16.51

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.
@@ -0,0 +1 @@
1
+ import{r as t,c as i,w as e,h as o,H as n,d as l,f as s}from"./p-814a5a13.js";import{c as a,g as r}from"./p-b7c33573.js";import{q as d,b as c,e as h}from"./p-4aeedb04.js";import{i as u}from"./p-506221fe.js";import{c as p,h as v}from"./p-0e4de1d0.js";import{f as b,l as f,m as g,t as m}from"./p-011c0279.js";import{R as y,L as x,d as k}from"./p-619c1cd7.js";import{B as w,L as $,M as C,P as S,R as j,a as O}from"./p-c88be1ca.js";import{H as z}from"./p-d6b725e9.js";import{v as _,O as L}from"./p-8e59a930.js";import{C as N}from"./p-991c0877.js";import{g as T}from"./p-546bb0de.js";import{u as M}from"./p-ae13ac48.js";import{I as D,P as R}from"./p-2535778d.js";import{D as A}from"./p-e911e60d.js";import{R as V}from"./p-3f3b5ab1.js";import"./p-add30d46.js";import"./p-3e8ff66b.js";const E=class{constructor(e){t(this,e),this.ionChange=i(this,"ionChange",7),this.ionSelect=i(this,"ionSelect",7),this.ionStyle=i(this,"ionStyle",7),this.didInit=!1,this.activated=!1,this.disabled=!1,this.scrollable=!1,this.swipeGesture=!0,this.selectOnFocus=!1,this.onClick=t=>{const i=t.target,e=this.checked;"ION-SEGMENT"!==i.tagName&&(this.value=i.value,!this.scrollable&&this.swipeGesture||(e?this.checkButton(e,i):this.setCheckedClasses()),this.checked=i)},this.getSegmentButton=t=>{const i=this.getButtons().filter((t=>!t.disabled)),e=i.findIndex((t=>t===document.activeElement));switch(t){case"first":return i[0];case"last":return i[i.length-1];case"next":return i[e+1]||i[0];case"previous":return i[e-1]||i[i.length-1];default:return null}}}colorChanged(t,i){(void 0===i&&void 0!==t||void 0!==i&&void 0===t)&&this.emitStyle()}swipeGestureChanged(){this.gestureChanged()}valueChanged(t,i){this.ionSelect.emit({value:t}),(""!==i||this.didInit)&&(this.activated?this.valueAfterGesture=t:this.ionChange.emit({value:t}))}disabledChanged(){this.gestureChanged();const t=this.getButtons();for(const i of t)i.disabled=this.disabled}gestureChanged(){this.gesture&&this.gesture.enable(!this.scrollable&&!this.disabled&&this.swipeGesture)}connectedCallback(){this.emitStyle()}componentWillLoad(){this.emitStyle()}async componentDidLoad(){this.setCheckedClasses(),this.ensureFocusable(),this.gesture=(await import("./p-e9431eeb.js")).createGesture({el:this.el,gestureName:"segment",gesturePriority:100,threshold:0,passive:!1,onStart:t=>this.onStart(t),onMove:t=>this.onMove(t),onEnd:t=>this.onEnd(t)}),this.gestureChanged(),this.disabled&&this.disabledChanged(),this.didInit=!0}onStart(t){this.activate(t)}onMove(t){this.setNextIndex(t)}onEnd(t){this.setActivated(!1);const i=this.setNextIndex(t,!0);t.event.stopImmediatePropagation(),i&&this.addRipple(t);const e=this.valueAfterGesture;void 0!==e&&(this.ionChange.emit({value:e}),this.valueAfterGesture=void 0)}getButtons(){return Array.from(this.el.querySelectorAll("ion-segment-button"))}addRipple(t){if(!a.getBoolean("animated",!0)||!a.getBoolean("rippleEffect",!0))return;const i=this.getButtons().find((t=>t.value===this.value)),e=(i.shadowRoot||i).querySelector("ion-ripple-effect");if(!e)return;const{x:o,y:n}=d(t.event);e.addRipple(o,n).then((t=>t()))}setActivated(t){this.getButtons().forEach((i=>{t?i.classList.add("segment-button-activated"):i.classList.remove("segment-button-activated")})),this.activated=t}activate(t){const i=t.event.target,e=this.getButtons().find((t=>t.value===this.value));"ION-SEGMENT-BUTTON"===i.tagName&&(e||(this.value=i.value,this.setCheckedClasses()),this.value===i.value&&this.setActivated(!0))}getIndicator(t){return(t.shadowRoot||t).querySelector(".segment-button-indicator")}checkButton(t,i){const o=this.getIndicator(t),n=this.getIndicator(i);if(null===o||null===n)return;const l=o.getBoundingClientRect(),s=n.getBoundingClientRect(),a=`translate3d(${l.left-s.left}px, 0, 0) scaleX(${l.width/s.width})`;e((()=>{n.classList.remove("segment-button-indicator-animated"),n.style.setProperty("transform",a),n.getBoundingClientRect(),n.classList.add("segment-button-indicator-animated"),n.style.setProperty("transform","")})),this.value=i.value,this.setCheckedClasses()}setCheckedClasses(){const t=this.getButtons(),i=t.findIndex((t=>t.value===this.value))+1;this.checked=t.find((t=>t.value===this.value));for(const i of t)i.classList.remove("segment-button-after-checked");i<t.length&&t[i].classList.add("segment-button-after-checked")}setNextIndex(t,i=!1){const e=u(this.el),o=this.activated,n=this.getButtons(),l=n.findIndex((t=>t.value===this.value)),s=n[l];let a,r;if(-1===l)return;const d=s.getBoundingClientRect(),c=d.left,h=d.width,p=t.currentX,v=d.top+d.height/2,b=this.el.getRootNode().elementFromPoint(p,v);if(o&&!i){if(e?p>c+h:p<c){const t=l-1;t>=0&&(r=t)}else if((e?p<c:p>c+h)&&o&&!i){const t=l+1;t<n.length&&(r=t)}void 0===r||n[r].disabled||(a=n[r])}if(!o&&i&&(a=b),null!=a){if("ION-SEGMENT"===a.tagName)return!1;s!==a&&this.checkButton(s,a)}return!0}emitStyle(){this.ionStyle.emit({segment:!0})}onKeyDown(t){const i=u(this.el);let e,o=this.selectOnFocus;switch(t.key){case"ArrowRight":t.preventDefault(),e=this.getSegmentButton(i?"previous":"next");break;case"ArrowLeft":t.preventDefault(),e=this.getSegmentButton(i?"next":"previous");break;case"Home":t.preventDefault(),e=this.getSegmentButton("first");break;case"End":t.preventDefault(),e=this.getSegmentButton("last");break;case" ":case"Enter":t.preventDefault(),e=document.activeElement,o=!0}e&&(o&&this.checkButton(this.checked||e,e),e.focus())}ensureFocusable(){var t;void 0===this.value&&(null===(t=this.getButtons()[0])||void 0===t||t.setAttribute("tabindex","0"))}render(){const t=r(this);return o(n,{role:"tablist",onClick:this.onClick,class:p(this.color,{[t]:!0,"in-toolbar":v("ion-toolbar",this.el),"in-toolbar-color":v("ion-toolbar[color]",this.el),"segment-activated":this.activated,"segment-disabled":this.disabled,"segment-scrollable":this.scrollable})},o("slot",null))}get el(){return l(this)}static get watchers(){return{color:["colorChanged"],swipeGesture:["swipeGestureChanged"],value:["valueChanged"],disabled:["disabledChanged"]}}};E.style={ios:":host{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:stretch;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint;user-select:none}:host(.segment-scrollable){justify-content:start;width:auto;overflow-x:auto}:host(.segment-scrollable::-webkit-scrollbar){display:none}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.065);border-radius:8px;overflow:hidden;z-index:0}:host(.ion-color){background:rgba(var(--ion-color-base-rgb), 0.065)}:host(.in-toolbar){margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;width:auto}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.in-toolbar){margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}:host(.in-toolbar:not(.ion-color)){background:var(--ion-toolbar-segment-background, var(--background))}:host(.in-toolbar-color:not(.ion-color)){background:rgba(var(--ion-color-contrast-rgb), 0.11)}",md:":host{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:stretch;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint;user-select:none}:host(.segment-scrollable){justify-content:start;width:auto;overflow-x:auto}:host(.segment-scrollable::-webkit-scrollbar){display:none}:host{--background:transparent}:host(.segment-scrollable) ::slotted(ion-segment-button){min-width:auto}"};let B=0;const I=class{constructor(i){t(this,i),this.segmentEl=null,this.checked=!1,this.disabled=!1,this.layout="icon-top",this.type="button",this.value="ion-sb-"+B++,this.updateStyle=()=>{s(this)},this.updateState=()=>{this.segmentEl&&(this.checked=this.segmentEl.value===this.value)}}connectedCallback(){const t=this.segmentEl=this.el.closest("ion-segment");t&&(this.updateState(),c(t,"ionSelect",this.updateState),c(t,"ionStyle",this.updateStyle))}disconnectedCallback(){const t=this.segmentEl;t&&(h(t,"ionSelect",this.updateState),h(t,"ionStyle",this.updateStyle),this.segmentEl=null)}get hasLabel(){return!!this.el.querySelector("ion-label")}get hasIcon(){return!!this.el.querySelector("ion-icon")}get tabIndex(){return this.checked&&!this.disabled?0:-1}render(){const{checked:t,type:i,disabled:e,hasIcon:l,hasLabel:s,layout:a,segmentEl:d,tabIndex:c}=this,h=r(this);return o(n,{role:"tab","aria-selected":t?"true":"false","aria-disabled":e?"true":null,tabIndex:c,class:{[h]:!0,"in-toolbar":v("ion-toolbar",this.el),"in-toolbar-color":v("ion-toolbar[color]",this.el),"in-segment":v("ion-segment",this.el),"in-segment-color":void 0!==(null==d?void 0:d.color),"segment-button-has-label":s,"segment-button-has-icon":l,"segment-button-has-label-only":s&&!l,"segment-button-has-icon-only":l&&!s,"segment-button-disabled":e,"segment-button-checked":t,[`segment-button-layout-${a}`]:!0,"ion-activatable":!0,"ion-activatable-instant":!0,"ion-focusable":!0}},o("button",{type:i,tabIndex:-1,class:"button-native",part:"native",disabled:e},o("span",{class:"button-inner"},o("slot",null)),"md"===h&&o("ion-ripple-effect",null)),o("div",{part:"indicator",class:{"segment-button-indicator":!0,"segment-button-indicator-animated":!0}},o("div",{part:"indicator-background",class:"segment-button-indicator-background"})))}get el(){return l(this)}};I.style={ios:':host{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:flex;position:relative;flex:1 1 auto;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;font-kerning:none;cursor:pointer}.button-native{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:var(--margin-start);margin-right:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);transform:translate3d(0, 0, 0);display:flex;position:relative;flex-direction:inherit;flex-grow:1;align-items:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end)}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{display:flex;position:relative;flex-flow:inherit;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.segment-button-checked){background:var(--background-checked);color:var(--color-checked)}:host(.segment-button-disabled){cursor:default;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(:focus){outline:none}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.segment-button-checked:hover) .button-native{color:var(--color-checked)}}::slotted(ion-icon){flex-shrink:0;order:-1;pointer-events:none}::slotted(ion-label){display:block;align-self:center;line-height:22px;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;pointer-events:none}:host(.segment-button-layout-icon-top) .button-native{flex-direction:column}:host(.segment-button-layout-icon-start) .button-native{flex-direction:row}:host(.segment-button-layout-icon-end) .button-native{flex-direction:row-reverse}:host(.segment-button-layout-icon-bottom) .button-native{flex-direction:column-reverse}:host(.segment-button-layout-icon-hide) ::slotted(ion-icon){display:none}:host(.segment-button-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color, var(--color-checked))}.segment-button-indicator{transform-origin:left;position:absolute;opacity:0;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}.segment-button-indicator-background{width:100%;height:var(--indicator-height);transform:var(--indicator-transform);box-shadow:var(--indicator-box-shadow);pointer-events:none}.segment-button-indicator-animated{transition:var(--indicator-transition)}:host(.segment-button-checked) .segment-button-indicator{opacity:1}@media (prefers-reduced-motion: reduce){.segment-button-indicator-background{transform:none}.segment-button-indicator-animated{transition:none}}:host{--background:none;--background-checked:none;--background-hover:none;--background-hover-opacity:0;--background-focused:none;--background-focused-opacity:0;--border-radius:7px;--border-width:1px;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--border-style:solid;--indicator-box-shadow:0 0 5px rgba(0, 0, 0, 0.16);--indicator-color:var(--ion-color-step-350, var(--ion-background-color, #fff));--indicator-height:100%;--indicator-transition:transform 260ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--transition:100ms all linear;--padding-top:0;--padding-end:13px;--padding-bottom:0;--padding-start:13px;margin-top:2px;margin-bottom:2px;position:relative;flex-basis:0;flex-direction:row;min-width:70px;min-height:28px;transform:translate3d(0, 0, 0);font-size:13px;font-weight:450;line-height:37px}:host::before{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px;transition:160ms opacity ease-in-out;transition-delay:100ms;border-left:var(--border-width) var(--border-style) var(--border-color);content:"";opacity:1;will-change:opacity}:host(:first-of-type)::before{border-left-color:transparent}:host(.segment-button-disabled){opacity:0.3}::slotted(ion-icon){font-size:24px}:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:2px;margin-right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:0;margin-inline-end:0}}:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:0;margin-right:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:2px;margin-inline-end:2px}}.segment-button-indicator{padding-left:2px;padding-right:2px;left:0;right:0;top:0;bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.segment-button-indicator{padding-left:unset;padding-right:unset;-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:2px;padding-inline-end:2px}}.segment-button-indicator-background{border-radius:var(--border-radius);background:var(--indicator-color)}.segment-button-indicator-background{transition:var(--indicator-transition)}:host(.segment-button-checked)::before,:host(.segment-button-after-checked)::before{opacity:0}:host(.segment-button-checked){z-index:-1}:host(.segment-button-activated){--indicator-transform:scale(0.95)}:host(.ion-focused) .button-native{opacity:0.7}@media (any-hover: hover){:host(:hover) .button-native{opacity:0.5}:host(.segment-button-checked:hover) .button-native{opacity:1}}:host(.in-segment-color){background:none;color:var(--ion-text-color, #000)}:host(.in-segment-color) .segment-button-indicator-background{background:var(--ion-color-step-350, var(--ion-background-color, #fff))}@media (any-hover: hover){:host(.in-segment-color:hover) .button-native,:host(.in-segment-color.segment-button-checked:hover) .button-native{color:var(--ion-text-color, #000)}}:host(.in-toolbar:not(.in-segment-color)){--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, var(--ion-toolbar-color), initial);--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-toolbar-color), initial);--indicator-color:var(--ion-toolbar-segment-indicator-color, var(--ion-color-step-350, var(--ion-background-color, #fff)))}:host(.in-toolbar-color) .segment-button-indicator-background{background:#fff}:host(.in-toolbar-color:not(.in-segment-color)) .button-native{color:var(--ion-color-contrast)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native{color:var(--ion-color-base)}@media (any-hover: hover){:host(.in-toolbar-color:not(.in-segment-color):hover) .button-native{color:var(--ion-color-contrast)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color):hover) .button-native{color:var(--ion-color-base)}}',md:':host{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:flex;position:relative;flex:1 1 auto;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;font-kerning:none;cursor:pointer}.button-native{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:var(--margin-start);margin-right:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);transform:translate3d(0, 0, 0);display:flex;position:relative;flex-direction:inherit;flex-grow:1;align-items:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end)}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{display:flex;position:relative;flex-flow:inherit;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.segment-button-checked){background:var(--background-checked);color:var(--color-checked)}:host(.segment-button-disabled){cursor:default;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(:focus){outline:none}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.segment-button-checked:hover) .button-native{color:var(--color-checked)}}::slotted(ion-icon){flex-shrink:0;order:-1;pointer-events:none}::slotted(ion-label){display:block;align-self:center;line-height:22px;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;pointer-events:none}:host(.segment-button-layout-icon-top) .button-native{flex-direction:column}:host(.segment-button-layout-icon-start) .button-native{flex-direction:row}:host(.segment-button-layout-icon-end) .button-native{flex-direction:row-reverse}:host(.segment-button-layout-icon-bottom) .button-native{flex-direction:column-reverse}:host(.segment-button-layout-icon-hide) ::slotted(ion-icon){display:none}:host(.segment-button-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color, var(--color-checked))}.segment-button-indicator{transform-origin:left;position:absolute;opacity:0;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}.segment-button-indicator-background{width:100%;height:var(--indicator-height);transform:var(--indicator-transform);box-shadow:var(--indicator-box-shadow);pointer-events:none}.segment-button-indicator-animated{transition:var(--indicator-transition)}:host(.segment-button-checked) .segment-button-indicator{opacity:1}@media (prefers-reduced-motion: reduce){.segment-button-indicator-background{transform:none}.segment-button-indicator-animated{transition:none}}:host{--background:none;--background-checked:none;--background-hover:var(--color-checked);--background-focused:var(--color-checked);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--color-checked:var(--ion-color-primary, #3880ff);--indicator-box-shadow:none;--indicator-color:var(--color-checked);--indicator-height:2px;--indicator-transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--padding-top:0;--padding-end:16px;--padding-bottom:0;--padding-start:16px;--transition:color 0.15s linear 0s, opacity 0.15s linear 0s;min-width:90px;max-width:360px;min-height:48px;border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);font-size:14px;font-weight:500;letter-spacing:0.06em;line-height:40px;text-transform:uppercase}:host(.segment-button-disabled){opacity:0.3}:host(.in-segment-color){background:none;color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}:host(.in-segment-color) ion-ripple-effect{color:var(--ion-color-base)}:host(.in-segment-color) .segment-button-indicator-background{background:var(--ion-color-base)}:host(.in-segment-color.segment-button-checked) .button-native{color:var(--ion-color-base)}:host(.in-segment-color.ion-focused) .button-native::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.in-segment-color:hover) .button-native{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}:host(.in-segment-color:hover) .button-native::after{background:var(--ion-color-base)}:host(.in-segment-color.segment-button-checked:hover) .button-native{color:var(--ion-color-base)}}:host(.in-toolbar:not(.in-segment-color)){--background:var(--ion-toolbar-segment-background, none);--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6));--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-color-primary, #3880ff));--indicator-color:var(--ion-toolbar-segment-color-checked, var(--color-checked))}:host(.in-toolbar-color:not(.in-segment-color)) .button-native{color:rgba(var(--ion-color-contrast-rgb), 0.6)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native{color:var(--ion-color-contrast)}@media (any-hover: hover){:host(.in-toolbar-color:not(.in-segment-color)) .button-native::after{background:var(--ion-color-contrast)}}::slotted(ion-icon){margin-top:12px;margin-bottom:12px;font-size:24px}::slotted(ion-label){margin-top:12px;margin-bottom:12px}:host(.segment-button-layout-icon-top) ::slotted(ion-label),:host(.segment-button-layout-icon-bottom) ::slotted(ion-icon){margin-top:0}:host(.segment-button-layout-icon-top) ::slotted(ion-icon),:host(.segment-button-layout-icon-bottom) ::slotted(ion-label){margin-bottom:0}:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:8px;margin-right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:0;margin-inline-end:0}}:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:0;margin-right:8px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}:host(.segment-button-has-icon-only) ::slotted(ion-icon){margin-top:12px;margin-bottom:12px}:host(.segment-button-has-label-only) ::slotted(ion-label){margin-top:12px;margin-bottom:12px}.segment-button-indicator{left:0;right:0;bottom:0}.segment-button-indicator-background{background:var(--indicator-color)}:host(.in-toolbar:not(.in-segment-color)) .segment-button-indicator-background{background:var(--ion-toolbar-segment-indicator-color, var(--indicator-color))}:host(.in-toolbar-color:not(.in-segment-color)) .segment-button-indicator-background{background:var(--ion-color-contrast)}'};const J=class{constructor(i){t(this,i),this.animated=!1}render(){const t=this.animated&&a.getBoolean("animated",!0),i=v("ion-avatar",this.el)||v("ion-thumbnail",this.el),e=r(this);return o(n,{class:{[e]:!0,"skeleton-text-animated":t,"in-media":i}},o("span",null," "))}get el(){return l(this)}};J.style=":host{--background:rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065);border-radius:var(--border-radius, inherit);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--background);line-height:10px;user-select:none;pointer-events:none}span{display:inline-block}:host(.in-media){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;height:100%}:host(.skeleton-text-animated){position:relative;background:linear-gradient(to right, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135) 18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 33%);background-size:800px 104px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer;animation-timing-function:linear}@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}";const P={en:{amen:"Amen.",book:"Book",chapter:"Chapter",citation:"Citation (e.g., John 1:1)",label:"Label",loading:"Loading...",verse:"Verse",changeReading:"Change Reading",newCitation:"Biblical citation.",cancel:"Cancel",ok:"OK"},es:{amen:"Amen.",book:"Book",chapter:"Chapter",citation:"Citation (e.g., John 1:1)",label:"Label",loading:"Loading...",verse:"Verse",changeReading:"Change Reading",newCitation:"Biblical citation.",cancel:"Cancel",ok:"OK"}},W=class{constructor(e){t(this,e),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7)}docChanged(t){try{this.obj=new w("string"==typeof t?JSON.parse(t):t),this.processIntro()}catch(t){console.warn(t),this.obj=new w}this.loadVerses()}async componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings(),this.loadVerses(),this.processIntro()}processIntro(){var t,i;if(null===(i=null===(t=this.obj)||void 0===t?void 0:t.metadata)||void 0===i?void 0:i.intro)try{this.obj.compileIntro(),this.obj=new w(Object.assign({},this.obj))}catch(t){console.warn(t),console.warn(this.obj)}}async loadLocaleStrings(){try{this.localeStrings=P[T(this.element)]}catch(t){console.warn(t)}}async changeReading(){var t;const i=this.localeStrings||{},e=await b.create({header:i.changeReading,inputs:[{name:"citation",type:"text",value:null===(t=this.obj)||void 0===t?void 0:t.citation,placeholder:i.newCitation}],buttons:[{text:i.cancel,role:"cancel",cssClass:"secondary"},{text:i.ok,handler:async t=>{var e,o,n;this.ldfDocShouldChange.emit(new N({path:this.path,op:[{type:"set",index:"citation",oldValue:null===(e=this.obj)||void 0===e?void 0:e.citation,value:null==t?void 0:t.citation}]}));const l=await f.create({message:i.loading});await l.present();const s=await async function(t,i="NRSV",e="https://us-central1-venite-2.cloudfunctions.net"){const o=new URL(`${e}/bible`);o.searchParams.append("citation",t),["NRSV","NRSVAE","ESV","CEB","KJV"].includes(i)?o.searchParams.append("version",i):o.searchParams.append("version","NRSV");const n=await fetch(o.toString()),l=await n.text();try{return JSON.parse(l)}catch(t){throw new Error(l)}}(t.citation,_(null===(o=this.obj)||void 0===o?void 0:o.version));await l.dismiss(),this.ldfDocShouldChange.emit(new N({path:this.path,op:[{type:"set",index:"value",oldValue:null===(n=this.obj)||void 0===n?void 0:n.value,value:(null==s?void 0:s.value)||[]}]})),this.obj=new w(Object.assign(Object.assign({},this.obj),{citation:null==t?void 0:t.citation,value:(null==s?void 0:s.value)||[]})),this.loadVerses()}}]});await e.present()}loadVerses(){this.verses=this.obj.value||[]}paragraphs(){const t=new Array;let i=new Array;return this.verses.forEach((e=>{e.hasOwnProperty("type")&&"heading"===e.type?(t.push(i),i=new Array):i.push(e)})),t.push(i),t}render(){var t,i,e,l,s,a,r,d,c,h,u,p,v,b,f,g,m,y,x,k,w,$,C,S;const j=this.localeStrings||{};if(this.verses){if(this.editable){const n=Object.assign(Object.assign({},this.verses[0]),{text:""}),r=t=>Object.assign(Object.assign({},n),{text:t});return o("div",{lang:null===(t=this.obj)||void 0===t?void 0:t.language,class:`editable bible-reading ${(null===(i=this.obj)||void 0===i?void 0:i.display_format)||"default"}`},this.editable&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"},o("ion-buttons",null,o("ion-button",{onClick:()=>this.changeReading()},o("ion-icon",{name:"swap-horizontal",slot:"start"}),o("ion-label",null,j.changeReading))))),o("ldf-label-bar",null,o("h3",{class:"editable-label",slot:"start"},o("ldf-editable-text",{id:"label",text:null===(e=this.obj)||void 0===e?void 0:e.label,path:`${this.path}/label`,placeholder:j.label})),(null===(l=this.obj)||void 0===l?void 0:l.citation)&&o("button",{class:"citation-button",slot:"end",onClick:()=>this.changeReading()},this.obj.citation)),(null===(a=null===(s=this.obj)||void 0===s?void 0:s.metadata)||void 0===a?void 0:a.compiled_intro)&&o("ldf-liturgical-document",{editable:!0,doc:this.obj.metadata.intro,path:`${this.path}/metadata/intro`}),o("section",{class:"verses"},this.verses.map(((t,i)=>[t.hasOwnProperty("type")&&"heading"===t.type?o("ldf-heading",{editable:!0,doc:t,path:`${this.path}/value/${i}`}):o("div",{class:"editable-verse"},o("div",{class:"editable-citation"},o("ldf-editable-text",{class:"book",id:`verse-${i}-book`,text:t.book,path:`${this.path}/value/${i}/book`,placeholder:j.book,short:!0}),o("ldf-editable-text",{id:`verse-${i}-chapter`,text:t.chapter,path:`${this.path}/value/${i}/chapter`,placeholder:j.chapter,short:!0})," :",o("ldf-editable-text",{id:`verse-${i}-verse`,text:t.verse,path:`${this.path}/value/${i}/verse`,placeholder:j.verse,short:!0})),o("ldf-editable-text",{id:`verse-${i}-text`,text:t.text,path:`${this.path}/value/${i}/text`,placeholder:j.text,short:!1,template:n,templateMaker:r}))]))))}if("short"==this.obj.style){const t=(null===(c=(null===(d=null===(r=this.obj)||void 0===r?void 0:r.metadata)||void 0===d?void 0:d.response)||(null==j?void 0:j.amen))||void 0===c?void 0:c.length)<=5;let i;return i=(null===(u=null===(h=this.obj)||void 0===h?void 0:h.metadata)||void 0===u?void 0:u.response)?o("span",{class:"response"}," ",null===(v=null===(p=this.obj)||void 0===p?void 0:p.metadata)||void 0===v?void 0:v.response):o("span",{class:"response"}," ",null==j?void 0:j.amen),o(n,null,(null===(b=this.obj)||void 0===b?void 0:b.label)&&o("ldf-heading",{doc:new z({type:"heading",metadata:{level:3},value:[this.obj.label]})}),o("div",{lang:null===(f=this.obj)||void 0===f?void 0:f.language,class:`bible-reading ${(null===(g=this.obj)||void 0===g?void 0:g.display_format)||"default"}`},o("p",null,this.verses.map(((t,i)=>{var e,n;return t.hasOwnProperty("type")&&"heading"===t.type?o("ldf-heading",{doc:new z(t)}):o("ldf-string",{citation:{book:t.book,chapter:t.chapter,verse:t.verse},id:this.obj.uid,text:t.text,fragment:this.path,dropcap:M(null===(e=this.obj)||void 0===e?void 0:e.language,null===(n=this.obj)||void 0===n?void 0:n.display_format,i)})})),t&&!(null===(y=null===(m=this.obj)||void 0===m?void 0:m.metadata)||void 0===y?void 0:y.omit_response)&&i,o("span",{class:"citation"},this.obj.citation)),!t&&!(null===(k=null===(x=this.obj)||void 0===x?void 0:x.metadata)||void 0===k?void 0:k.omit_response)&&o("p",null,i)))}{const t=this.paragraphs();return o("div",{lang:null===(w=this.obj)||void 0===w?void 0:w.language,class:`bible-reading ${(null===($=this.obj)||void 0===$?void 0:$.display_format)||"default"}`},o("ldf-heading",{doc:new z({type:"heading",metadata:{level:3},value:[this.obj.label],citation:this.obj.citation})}),(null===(S=null===(C=this.obj)||void 0===C?void 0:C.metadata)||void 0===S?void 0:S.compiled_intro)&&o("ldf-liturgical-document",{doc:this.obj.metadata.compiled_intro}),t.map(((t,i)=>o("p",{lang:this.obj.language},t.map(((t,e)=>{var n,l;return t.hasOwnProperty("type")&&"heading"===t.type?o("ldf-heading",{doc:new z(t)}):[o("sup",null,t.verse),o("ldf-string",{citation:t,dropcap:M(null===(n=this.obj)||void 0===n?void 0:n.language,null===(l=this.obj)||void 0===l?void 0:l.display_format,i+e),id:`${t.chapter}-${t.book}-${t.verse}`,text:t.text,index:e,fragment:this.path})]}))))))}}return this.loadingError?o("pre",null,this.loadingError):o("p",null,j.loading)}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};W.style='ldf-bible-reading.sc-ldf-bible-reading,.sc-ldf-bible-reading-h{font-family:var(--ldf-font-face);text-align:var(--ldf-text-align)}.bible-reading[lang=he].sc-ldf-bible-reading{text-align:right;direction:rtl;font-size:1.5em;font-family:"Times New Roman" !important}.bible-reading[lang=he].sc-ldf-bible-reading .drop.sc-ldf-bible-reading{float:right !important;font-family:"Times New Roman" !important}.bible-reading.omit.sc-ldf-bible-reading .verses.sc-ldf-bible-reading{display:none}.editable.bible-reading.sc-ldf-bible-reading .verses.sc-ldf-bible-reading{display:block;color:var(--ldf-greyed-out-text-color)}sup.sc-ldf-bible-reading{display:var(--ldf-bible-reading-verse-number-display);margin-left:0;margin-right:0.25em}.citation.sc-ldf-bible-reading{font-size:80%;font-style:italic;margin-left:1em;float:var(--ldf-bible-reading-citation-float)}.response.sc-ldf-bible-reading{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.verses.sc-ldf-bible-reading .verse.sc-ldf-bible-reading{display:flex;flex-direction:row}sup.sc-ldf-bible-reading:first-of-type{display:var(--ldf-drop-early-verses-display)}.editable-verse.sc-ldf-bible-reading{display:inline}.editable-citation.sc-ldf-bible-reading{display:inline;width:100%}.editable-citation.sc-ldf-bible-reading ldf-editable-text.sc-ldf-bible-reading{display:inline-block;width:25px}.editable-citation.sc-ldf-bible-reading ldf-editable-text.book.sc-ldf-bible-reading{width:75px}h3.editable-label.sc-ldf-bible-reading{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}.citation-button.sc-ldf-bible-reading{background:none;border:0;font-family:var(--ldf-font-face);font-size:inherit}';const H={en:{add:"Add",label:"Label",citation:"Citation"}},F=class{constructor(e){t(this,e),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.ldfDocShouldAdd=i(this,"ldfDocShouldAdd",7)}async componentWillLoad(){this.loadLocaleStrings()}async loadLocaleStrings(){try{this.localeStrings=H[T(this.element)]}catch(t){console.warn(t)}}render(){const t=this.localeStrings||{};return o(n,null,o("div",{class:{button:!0,hidden:!this.visible}},o("ion-button",{"aria-role":"button",fill:"outline",onClick:()=>this.ldfDocShouldAdd.emit({base:this.base,index:this.index})},o("ion-icon",{name:"add",slot:"icon-only"}),o("ion-label",{class:"visually-hidden"},t.add))))}get element(){return l(this)}};F.style=".sc-ldf-editable-add-block-h{display:flex;flex-direction:column;align-items:center;width:100%}.sc-ldf-editable-add-block-h .button-container.sc-ldf-editable-add-block{display:flex;align-items:center;height:0;justify-content:center;width:100%}.sc-ldf-editable-add-block-h button.sc-ldf-editable-add-block{background-color:var(--ldf-background-color);color:var(--ldf-color);font-family:var(--ldf-controls-font-family);font-weight:lighter}.sc-ldf-editable-add-block-h button.sc-ldf-editable-add-block:hover{cursor:pointer}.sc-ldf-editable-add-block-h .visible.sc-ldf-editable-add-block{height:0;opacity:1;transition:0.25s}.sc-ldf-editable-add-block-h .hidden.sc-ldf-editable-add-block{height:0;opacity:0;transition:2s}.sc-ldf-editable-add-block-h .underlying.sc-ldf-editable-add-block{width:100%;border-top:1px solid #a0a0a0;border-bottom:1px solid #a0a0a0;min-height:1em;position:relative;bottom:0.5em;z-index:-1}.sc-ldf-editable-add-block-h .underlying.visible.sc-ldf-editable-add-block{opacity:0.5;transition:0.25s}.sc-ldf-editable-add-block-h .underlying.visible.expanded.sc-ldf-editable-add-block{z-index:1}.sc-ldf-editable-add-block-h .underlying.collapsed.sc-ldf-editable-add-block{height:1em}.sc-ldf-editable-add-block-h .underlying.hidden.sc-ldf-editable-add-block{opacity:0;transition:1s}.sc-ldf-editable-add-block-h .underlying.hidden.sc-ldf-editable-add-block button.sc-ldf-editable-add-block{z-index:-1}.sc-ldf-editable-add-block-h .visually-hidden.sc-ldf-editable-add-block{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);white-space:nowrap}.button.sc-ldf-editable-add-block{position:absolute;display:flex;flex-direction:row;align-items:center;justify-content:center;opacity:1;transition:all 0.25s}.hidden.sc-ldf-editable-add-block{display:none;height:0;opacity:0;transition:all 0.25s}";const G={en:{abbreviated:"Abbreviated",addOption:"Add an Option",cancel:"Cancel",condition:"Conditions",copy:"Copy",copied:"Copied to Clipboard",default:"Default",displayFormat:"Display",halfverse:"By Half Verse",heading:"Heading Level",heading1:"1. Title",heading2:"2. Section Title",heading3:"3. Label",heading4:"4. Sub-Section Label",move_down:"Move Down",move_up:"Move Up",ok:"OK",omit:"Omit",preferences:"Preferences",settings:"Settings",edit:"Edit",preview:"Preview",responsive:"Responsive Display Settings",responsiveMsg:"What size devices should this appear on?",responsiveAll:"All devices",responsiveSmallOnly:"Only on small screens",responsiveSmallHidden:"Not on small screens",unison:"Unison",wholeverse:"By Whole Verse"}},K=class{constructor(e){t(this,e),this.ldfAddOptionToDoc=i(this,"ldfAddOptionToDoc",7),this.ldfTogglePreview=i(this,"ldfTogglePreview",7),this.ldfDocShouldMove=i(this,"ldfDocShouldMove",7),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.preview=!1}objChange(t){this.modal&&(this.modal.componentProps=Object.assign(Object.assign({},this.modal.componentProps),{obj:t}))}componentWillLoad(){this.loadLocaleStrings()}async loadLocaleStrings(){try{this.localeStrings=G[T(this.element)]}catch(t){console.warn(t)}}async openResponsive(){var t;const i=await b.create({header:this.localeStrings.responsive,message:this.localeStrings.responsiveMsg,inputs:[{name:"value",type:"radio",value:y.AllSizes,label:this.localeStrings.responsiveAll},{name:"value",type:"radio",value:y.SmallOnly,label:this.localeStrings.responsiveSmallOnly},{name:"value",type:"radio",value:y.SmallHidden,label:this.localeStrings.responsiveSmallHidden}],buttons:[{role:"cancel",text:this.localeStrings.cancel},this.localeStrings.ok]});await i.present();const{data:e}=await i.onDidDismiss(),{values:o}=e;o&&this.ldfDocShouldChange.emit(new N({path:`${this.base}/${this.index}/responsive`,op:[{type:"set",oldValue:null===(t=this.obj)||void 0===t?void 0:t.responsive,value:o}]}))}async openSettings(){this.modal=await this.openModal("ldf-editable-metadata")}async openCondition(){this.modal=await this.openModal("ldf-editable-condition",`${this.base}/${this.index}/condition`,{obj:this.obj})}async openPreferences(){const t=this.base&&this.index?`${this.base}/${this.index}`:"";this.modal=await this.openModal("ldf-editable-preferences",`${t}/metadata`,{obj:this.obj})}async openModal(t,i,e){const o=await g.create({component:t}),n=i||(this.base&&this.index>=0?`${this.base}/${this.index}`:"/");return o.componentProps=Object.assign(Object.assign({},e),{modal:o,doc:this.obj,path:n,visible:!0,collapsed:!1}),await o.present(),o}addOption(){this.ldfAddOptionToDoc.emit({base:this.base,index:this.index,obj:this.obj})}move(t){this.ldfDocShouldMove.emit({base:this.base,oldIndex:this.index,diff:t})}async headingLevel(){var t,i,e,o,n,l,s,a,r,d;const c=await b.create({header:null===(t=this.localeStrings)||void 0===t?void 0:t.heading,inputs:[{name:"level",type:"radio",value:1,label:null===(i=this.localeStrings)||void 0===i?void 0:i.heading1},{name:"level",type:"radio",value:2,label:null===(e=this.localeStrings)||void 0===e?void 0:e.heading2},{name:"level",type:"radio",value:3,label:null===(o=this.localeStrings)||void 0===o?void 0:o.heading3},{name:"level",type:"radio",value:4,label:null===(n=this.localeStrings)||void 0===n?void 0:n.heading4}],buttons:[{text:null===(l=this.localeStrings)||void 0===l?void 0:l.cancel,role:"cancel",cssClass:"secondary"},{text:null===(s=this.localeStrings)||void 0===s?void 0:s.ok}]});await c.present();const{data:h}=await c.onDidDismiss(),{values:u}=h;(null===(a=this.obj)||void 0===a?void 0:a.metadata)?this.ldfDocShouldChange.emit(new N({path:`${this.base}/${this.index}/metadata/level`,op:[{type:"set",value:u,oldValue:null===(d=null===(r=this.obj)||void 0===r?void 0:r.metadata)||void 0===d?void 0:d.level}]})):this.ldfDocShouldChange.emit(new N({path:`${this.base}/${this.index}/metadata`,op:[{type:"set",value:{level:u}}]}))}async copyDoc(){try{navigator.clipboard.writeText(JSON.stringify(this.obj));const t=await m.create({message:this.localeStrings.copied,duration:1e3,color:"success"});await t.present()}catch(t){console.warn("Clipboard operation not allowed.",t)}}render(){var t,i,e,l,s,a,r,d,c,h,u;const p=this.localeStrings||{},v=void 0!==this.index&&this.index>=0;return o(n,null,o("div",{class:{buttons:!0,hidden:!this.visible||!this.preview}},o("ion-buttons",{slot:"end"},(null===navigator||void 0===navigator?void 0:navigator.clipboard)&&o("ion-button",{onClick:()=>this.copyDoc(),"aria-role":"button","aria-label":p.copy},o("ion-label",{class:"sm-hidden"},p.copy),o("ion-icon",{slot:"end",name:"clipboard"})),o("ion-button",{onClick:()=>this.ldfTogglePreview.emit(!1)},o("ion-label",{class:"sm-hidden"},null===(t=this.localeStrings)||void 0===t?void 0:t.edit),o("ion-icon",{slot:"end",name:"create"})))),o("div",{class:{buttons:!0,hidden:!this.visible||this.preview}},o("ion-buttons",{slot:"end"},o("ion-button",{onClick:()=>this.ldfTogglePreview.emit(!0)},o("ion-label",{class:"sm-hidden"},null===(i=this.localeStrings)||void 0===i?void 0:i.preview),o("ion-icon",{slot:"end",name:"eye"})),"option"!==(null===(e=this.obj)||void 0===e?void 0:e.type)&&"option"!==this.parentType&&this.base&&o("ion-button",{onClick:()=>this.addOption(),"aria-role":"button","aria-label":p.addOption},o("ion-icon",{slot:"icon-only",name:"add"})),"liturgy"==(null===(l=this.obj)||void 0===l?void 0:l.type)&&o("ion-button",{onClick:()=>this.openPreferences(),"aria-role":"button","aria-label":p.preferences},o("ion-icon",{slot:"icon-only",name:"list"})),"heading"==(null===(s=this.obj)||void 0===s?void 0:s.type)&&o("ion-button",{onClick:()=>this.headingLevel()},o("ion-label",null,p[`heading${(null===(r=null===(a=this.obj)||void 0===a?void 0:a.metadata)||void 0===r?void 0:r.level)||3}`]||"Heading")),(null===(c=null===(d=this.obj)||void 0===d?void 0:d.availableDisplayFormats())||void 0===c?void 0:c.length)>0&&o("ldf-editable-select",{placeholder:p.displayFormat,value:this.obj.display_format,path:`${this.base}/${this.index}`,property:"display_format",options:this.obj.availableDisplayFormats().map((t=>({value:t,label:p[t]||t})))}),(this.base&&v||"liturgy"!==(null===(h=this.obj)||void 0===h?void 0:h.type))&&o("ion-button",{onClick:()=>this.openCondition(),"aria-role":"button","aria-label":p.condition},o("ion-icon",{slot:"icon-only",name:"calendar"})),(this.base&&v||"liturgy"!==(null===(u=this.obj)||void 0===u?void 0:u.type))&&o("ion-button",{onClick:()=>this.openResponsive(),"aria-role":"button","aria-label":p.responsive},o("ion-icon",{slot:"icon-only",name:"phone-portrait"})),(null===navigator||void 0===navigator?void 0:navigator.clipboard)&&o("ion-button",{onClick:()=>this.copyDoc(),"aria-role":"button","aria-label":p.copy},o("ion-icon",{slot:"icon-only",name:"clipboard"})),o("ion-button",{onClick:()=>this.openSettings(),"aria-role":"button","aria-label":p.settings},o("ion-icon",{slot:"icon-only",name:"cog"})),this.base&&v&&this.index>0&&o("ion-button",{onClick:()=>this.move(-1),"aria-role":"button","aria-label":p.move_up},o("ion-icon",{slot:"icon-only",name:"arrow-up"})),this.base&&v&&o("ion-button",{onClick:()=>this.move(1),"aria-role":"button","aria-label":p.move_down},o("ion-icon",{slot:"icon-only",name:"arrow-down"})),v&&o("ldf-editable-delete",{base:this.base,index:this.index,obj:this.obj}))))}get element(){return l(this)}static get watchers(){return{obj:["objChange"]}}};K.style=".buttons.sc-ldf-editable-metadata-buttons{position:absolute;height:0;width:100%;display:flex;flex-direction:row;align-items:center;justify-content:flex-end;opacity:1;transition:all 0.25s}.buttons.sc-ldf-editable-metadata-buttons ion-buttons.sc-ldf-editable-metadata-buttons{background-color:var(--ion-color-light, #f4f5f8);border-radius:3px;flex-wrap:wrap;max-width:100%}.hidden.sc-ldf-editable-metadata-buttons{display:none;height:0;opacity:0;transition:all 0.25s}@media (max-width: 767px){.sm-hidden.sc-ldf-editable-metadata-buttons{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}";const U=class{constructor(e){t(this,e),this.ldfChange=i(this,"ldfChange",7),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7)}onChange(t){const i=this.value,e=t.detail.value;e!==i&&(this.ldfDocShouldChange.emit(new N({path:this.path,op:[{type:"set",index:this.property,oldValue:i,value:e}]})),this.ldfChange.emit(e))}render(){return o("ion-select",{value:this.value,placeholder:this.placeholder},this.options.map((t=>o("ion-select-option",{value:t.value},t.label))))}get element(){return l(this)}};U.style="";const X={en:{close:"Return to Bulletin",url:"URL"}},q=class{constructor(e){t(this,e),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.isResizing=!1,this.resizingStartPoint=null,this.resizingCorner=null}docChanged(t){var i,e,o,n;try{this.obj=new D("string"==typeof t?JSON.parse(t):t),this.height=(null===(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)||void 0===e?void 0:e.height)||null,this.width=(null===(n=null===(o=this.obj)||void 0===o?void 0:o.metadata)||void 0===n?void 0:n.width)||null}catch(t){console.warn(t),this.obj=new D}}componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings()}async loadLocaleStrings(){try{this.localeStrings=X[T(this.element)]}catch(t){console.warn(t)}}async showZoomed(){const t=await g.create({component:"ldf-image"});t.componentProps={modal:t,doc:this.obj},await t.present()}startResizing(t,i,e){this.resizingCorner=t,this.resizingStartPoint={x:i,y:e}}stopResizing(){console.log("stopResizing"),this.resizingCorner=null}resizingMove(t){this.resizingCorner&&this.resizingStartPoint&&this.processResizingMove(this.resizingCorner,t.clientX,t.clientY)}processResizingMove(t,i,e){const{x:o}=this.resizingStartPoint,n="nw"===t||"sw"===t?i-o:o-i;this.resizingStartPoint={x:i,y:e},this.width=this.imgElement.clientWidth-n,this.height=null,this.updateDoc()}touchStart(t,i){i.preventDefault();const e=i.touches[0];e&&this.startResizing(t,e.clientX,e.clientY)}touchMove(t,i){i.preventDefault();const e=i.touches[0];e&&this.processResizingMove(t,e.clientX,e.clientY)}updateDoc(){var t,i,e,o,n,l;(null===(t=this.obj)||void 0===t?void 0:t.metadata)||this.ldfDocShouldChange.emit(new N({path:this.path,op:[{type:"set",index:"metadata",oldValue:null===(i=this.obj)||void 0===i?void 0:i.metadata,value:{}}]})),this.ldfDocShouldChange.emit(new N({path:`${this.path}/metadata`,op:[{type:"set",index:"height",oldValue:null===(o=null===(e=this.obj)||void 0===e?void 0:e.metadata)||void 0===o?void 0:o.height,value:this.imgElement.clientHeight},{type:"set",index:"width",oldValue:null===(l=null===(n=this.obj)||void 0===n?void 0:n.metadata)||void 0===l?void 0:l.width,value:this.imgElement.clientWidth}]}))}render(){var t,i,e,l,s;const a=this.localeStrings||{},r=[this.editable&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"})),o("div",{class:`${(null===(t=this.obj)||void 0===t?void 0:t.style)||""} ${(null===(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)||void 0===e?void 0:e.align)||"center"}`},this.obj.value&&this.obj.value.map(((t,i)=>{var e;return this.editable?o("figure",null,o("div",{class:"img-wrapper"},o("img",{src:t,ref:t=>this.imgElement=t,alt:null===(e=this.obj)||void 0===e?void 0:e.label,style:{height:this.height?`${this.height}px`:"auto",width:this.width?`${this.width}px`:"auto"},class:"editable"}),o("button",{class:"resize top-left",onMouseDown:t=>this.startResizing("nw",t.clientX,t.clientY),onTouchStart:t=>this.touchStart("nw",t),onTouchMove:t=>this.touchMove("nw",t),onTouchEnd:()=>this.stopResizing()}),o("button",{class:"resize bottom-left",onMouseDown:t=>this.startResizing("sw",t.clientX,t.clientY),onTouchStart:t=>this.touchStart("sw",t),onTouchMove:t=>this.touchMove("sw",t),onTouchEnd:()=>this.stopResizing()}),o("button",{class:"resize top-right",onMouseDown:t=>this.startResizing("ne",t.clientX,t.clientY),onTouchStart:t=>this.touchStart("ne",t),onTouchMove:t=>this.touchMove("ne",t),onTouchEnd:()=>this.stopResizing()}),o("button",{class:"resize bottom-right",onMouseDown:t=>this.startResizing("se",t.clientX,t.clientY),onTouchStart:t=>this.touchStart("se",t),onTouchMove:t=>this.touchMove("se",t),onTouchEnd:()=>this.stopResizing()})),o("figcaption",null,o("code",null,a.url),o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}`,text:t,path:`${this.path}/value/${i}`}))):o("img",{src:t,onClick:()=>this.showZoomed(),style:{height:this.height?`${this.height}px`:"auto",width:this.width?`${this.width}px`:"auto"}})})))];return this.modal?[o("ion-header",null,o("ion-toolbar",null,o("ion-buttons",{slot:"end"},o("ion-button",{onClick:()=>this.modal.dismiss()},o("ion-label",{slot:"start"},a.close),o("ion-icon",{slot:"end",name:"close"}))))),o("ion-content",{class:"ion-padding",scrollX:!0,lang:null===(s=this.obj)||void 0===s?void 0:s.language},r)]:o(n,{lang:null===(l=this.obj)||void 0===l?void 0:l.language},r)}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};(function(t,i,e,o){var n,l=arguments.length,s=l<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,e,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(l<3?n(s):l>3?n(i,e,s):n(i,e))||s);l>3&&s&&Object.defineProperty(i,e,s)})([A(250)],q.prototype,"updateDoc",null),q.style="img.sc-ldf-image{height:auto;max-width:100%;z-index:1}figcaption.sc-ldf-image{background-color:var(--ldf-editable-lookup-background-color);border-radius:4px;color:var(--ldf-editable-lookup-color);display:block;margin:auto;text-align:center}.left.sc-ldf-image{text-align:left}.center.sc-ldf-image{text-align:center}.right.sc-ldf-image{text-align:right}.img-wrapper.sc-ldf-image{margin:0;padding:12px;display:inline-block;position:relative}img.editable.sc-ldf-image{border:3px solid var(--ldf-color)}button.resize.sc-ldf-image{height:30px;width:30px;margin:0;padding:0;background-color:var(--ldf-editable-lookup-background-color);border-radius:50%;border:3px solid var(--ldf-color)}.resize.top-left.sc-ldf-image{position:absolute;left:0;top:-3px;cursor:nwse-resize}.resize.bottom-left.sc-ldf-image{position:absolute;left:-3px;bottom:0;cursor:nesw-resize}.resize.top-right.sc-ldf-image{position:absolute;right:-6px;top:-3px;cursor:nesw-resize}.resize.bottom-right.sc-ldf-image{position:absolute;right:-6px;bottom:0;cursor:nwse-resize}";const Z=({doc:t,localeStrings:i},e)=>o("div",{class:"condition"},o("p",null,i.condition,o("code",null,i[t.condition.mode]),i.of_the_following),o("ul",null,t.condition.conditions.map((t=>o(Q,{condition:t,localeStrings:i})))),e),Q=({condition:t,localeStrings:i})=>{let e=[];return t.day&&(e=e.concat(o(Y,{condition:t,field:"day",localeStrings:i}))),t.season&&(e=e.concat(o(Y,{condition:t,field:"season",localeStrings:i}))),t.week&&(e=e.concat(o(Y,{condition:t,field:"week",localeStrings:i}))),t.weekday&&(e=e.concat(o(Y,{condition:t,field:"weekday",localeStrings:i}))),t.day_of_month&&e.push([i.day_of_month_1,(n=Number(t.day_of_month),l=n%10,s=n%100,1==l&&11!=s?n+"st":2==l&&12!=s?n+"nd":3==l&&13!=s?n+"rd":n+"th"),i.day_of_month_2]),t.hasOwnProperty("feastDay")&&e.push([i.the_day,t.feastDay?i.is:i.is_not,i.feastDay]),t.preference&&e.push([i.the_preference,o("code",null,t.preference.key),t.preference.is?i.is:i.is_not,o("code",null,t.preference.value)]),t.date&&e.push([i.the_date,t.date.lt&&`${i.lt} ${t.date.lt}`,t.date.lte&&`${i.lte} ${t.date.lte}`,t.date.gte&&`${i.gte} ${t.date.gte}`,t.date.gt&&`${i.gt} ${t.date.gt}`]),e.map((t=>o("li",null,t)));var n,l,s},Y=({condition:t,field:i,localeStrings:e})=>{var o,n;const l=[];return(null===(o=t[i].except)||void 0===o?void 0:o.length)>0&&l.push([e[i],e.is,t[i].except.length>1?e.except:e.except_1,t[i].except.join(", ")]),(null===(n=t[i].only)||void 0===n?void 0:n.length)>0&&l.push([e[i],e.is,t[i].only.length>1?e.only:e.only_1,t[i].only.join(", ")]),l};const tt=(t,i)=>"object"==typeof t?o("span",null,i.definedByPreference," ",o("code",null,t.preference)):o("code",null,t),it=({doc:t,localeStrings:i})=>{var e,n,l,s,a,r,d,c,h,u,p,v,b,f,g,m,y,x,k,w,$,C,S,j,O,z,_,L,N;let T;if(t.lookup)switch(null===(e=t.lookup)||void 0===e?void 0:e.type){case"lectionary":T=[i.lectionaryReading,tt(null===(n=t.lookup)||void 0===n?void 0:n.item,i),i.fromLectionary,tt(null===(l=t.lookup)||void 0===l?void 0:l.table,i),"."];break;case"canticle":T=[i[`canticle-${null===(s=t.lookup)||void 0===s?void 0:s.item}`],i.fromCanticleTable,tt(null===(a=t.lookup)||void 0===a?void 0:a.table,i),"."];break;case"category":T=[i.category,t.category.map((t=>o("code",null,t))),(null===(r=t.lookup)||void 0===r?void 0:r.filter)&&"seasonal"==(null===(d=t.lookup)||void 0===d?void 0:d.filter)&&i["filter-seasonal"],(null===(c=t.lookup)||void 0===c?void 0:c.filter)&&"evening"==(null===(h=t.lookup)||void 0===h?void 0:h.filter)&&i[`filter-evening-${(null===(u=t.lookup)||void 0===u?void 0:u.item)||!0}`],(null===(p=t.lookup)||void 0===p?void 0:p.filter)&&"day"==(null===(v=t.lookup)||void 0===v?void 0:v.filter)&&i["filter-day"],(null===(b=t.lookup)||void 0===b?void 0:b.filter)&&"day"==(null===(f=t.lookup)||void 0===f?void 0:f.filter)&&o("code",null,null===(g=t.lookup)||void 0===g?void 0:g.item),(null===(m=t.lookup)||void 0===m?void 0:m.hasOwnProperty("rotate"))&&i[`rotate-${null===(y=t.lookup)||void 0===y?void 0:y.rotate}`],"."];break;case"slug":T=[i.slug,o("code",null,t.slug),(null===(x=t.lookup)||void 0===x?void 0:x.filter)&&"seasonal"==(null===(k=t.lookup)||void 0===k?void 0:k.filter)&&i["filter-seasonal"],(null===(w=t.lookup)||void 0===w?void 0:w.filter)&&"evening"==(null===($=t.lookup)||void 0===$?void 0:$.filter)&&i[`filter-evening-${(null===(C=t.lookup)||void 0===C?void 0:C.item)||!0}`],(null===(S=t.lookup)||void 0===S?void 0:S.filter)&&"day"==(null===(j=t.lookup)||void 0===j?void 0:j.filter)&&i["filter-day"],(null===(O=t.lookup)||void 0===O?void 0:O.filter)&&"day"==(null===(z=t.lookup)||void 0===z?void 0:z.filter)&&o("code",null,null===(_=t.lookup)||void 0===_?void 0:_.item),(null===(L=t.lookup)||void 0===L?void 0:L.hasOwnProperty("rotate"))&&i[`rotate-${null===(N=t.lookup)||void 0===N?void 0:N.rotate}`],"."];break;case"collect":T=o("code",null,i.collect);break;default:T=JSON.stringify(t.lookup)}else"bible-reading"===t.type&&t.citation&&(T=[o("code",null,t.citation),i.bible_version,..."string"==typeof t.version?[o("code",null,t.version)]:[i.the_preference_specified,o("code",null,"bibleVersion")]]);return o("article",{class:"lookup"},T)},et={en:{bible_version:" in the version ","canticle-1":"The first canticle ","canticle-2":"The second canticle ",category:"All items that match the category ",collect:"The Collect of the Day.",day_of_month_1:"It is the ",day_of_month_2:" day of the month",definedByPreference:" defined by the preference ",fromCanticleTable:" from the canticle table ",fromLectionary:" from the lectionary ",lectionaryReading:"The lectionary reading ","filter-seasonal":" and the current season","filter-evening-true":" and are in the evening ","filter-evening-false":" and are not in the evening ","filter-day":" and the liturgical day ","rotate-true":" (rotating by day)","rotate-false":" (including all possibilities)",slug:"All items with the slug ",condition:"Included when ",and:"all",or:"any",the_day:" the day ",of_the_following:" of the following are true: ",day:"the liturgical day",season:"the liturgical season",week:"the liturgical week",weekday:"the day of the week",feastDay:"a Sunday or Holy Day",is:" is ",is_not:" is not ",only:" one of: ",only_1:"",except:" anything but: ",except_1:" not ",the_preference:"the preference ",the_preference_specified:"chosen in the preference ",the_date:"the date ",lte:" ≤ ",lt:" < ",gt:" > ",gte:" ≥ ",smallOnly:"Only appears on small screens",smallHidden:"Doesn't appear on small screens"}},ot=class{constructor(e){t(this,e),this.focusPath=i(this,"focusPath",7),this.focusObj=i(this,"focusObj",7),this.ldfSelectionChange=i(this,"ldfSelectionChange",7),this.hasFocus=!1,this.buttonsSelected=!1,this.interrupt=!1,this.parentType=null,this.preview=!1,this.padding=void 0}async docChanged(t){let i;try{i=new x("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),i=new x}this.obj=i||new x}onDragOver(){"/"!==this.path&&(this.hasFocus=!0,this.focusPath.emit(this.path),this.focusObj.emit({obj:this.obj,path:this.path}),console.log("dragged over",this.path))}selectionChangeHandler(t){var i,e;t.preventDefault();const o=document.getSelection(),n=o.anchorNode,l=null===(e=null===(i=null==n?void 0:n.parentElement)||void 0===i?void 0:i.closest("ldf-string"))||void 0===e?void 0:e.citation;if(this.element.contains(n)){const t=o.toString();this.ldfSelectionChange.emit({target:this.element,text:t,citation:l,fragment:this.path})}}componentWillLoad(){this.loadLocaleStrings(),this.docChanged(this.doc)}onMouseOver(){this.hasFocus=!0,this.focusPath.emit(this.path)}onMouseOut(t){const i=this.element.querySelector("div.container");t.relatedTarget==i&&setTimeout((()=>{this.hasFocus=!1,this.focusPath.emit(this.path)}),500)}onClick(){this.hasFocus=!0,this.focusPath.emit(this.path),this.focusObj.emit({obj:this.obj,path:this.path})}async loadLocaleStrings(){try{this.localeStrings=et[T(this.element)]}catch(t){console.warn(t)}}nodeFromDoc(t,i){return null==t?(null===customElements||void 0===customElements?void 0:customElements.get("ion-skeleton-text"))?o("ion-skeleton-text",null):o("p",null,"..."):this.editable||i?this.editableNode(t):this.chooseComponent(t)}editableNode(t){var i;const e=this.localeStrings||{};return(null===(i=t.value)||void 0===i?void 0:i.length)>0&&Boolean(t.value[0])?t.condition?o(Z,{doc:t,localeStrings:e},this.chooseComponent(t)):this.chooseComponent(t):t.condition&&!t.lookup?o(Z,{doc:t,localeStrings:e},this.chooseComponent(t)):t.condition&&t.lookup?o(Z,{doc:t,localeStrings:e},o(it,{doc:t,localeStrings:e})):!t.condition&&t.lookup||"bible-reading"===t.type?o(it,{doc:t,localeStrings:e}):this.chooseComponent(t)}chooseComponent(t){var i,e;let n;const l=this.editable&&!this.preview;switch(null==t?void 0:t.type){case"liturgy":n=o("ldf-liturgy",{path:this.path,editable:l,preview:this.preview,doc:t});break;case"heading":n=o("ldf-heading",{path:this.path,editable:l,doc:t});break;case"image":n=o("ldf-image",{path:this.path,editable:l,doc:t});break;case"meditation":const s=null===(e=null===(i=this.obj)||void 0===i?void 0:i.day)||void 0===e?void 0:e.color,a=(null==s?void 0:s.hasOwnProperty("hex"))?s.hex:s||"#3489eb";n=o("ldf-meditation",{path:this.path,editable:this.editable||this.preview,doc:t,color:a});break;case"option":n=o("ldf-option",{path:this.path,editable:l,preview:this.preview,doc:t});break;case"parallel":n=o("ldf-parallel",{path:this.path,editable:l,preview:this.preview,doc:t});break;case"refrain":n=o("ldf-refrain",{path:this.path,editable:l,doc:t});break;case"rubric":n=o("ldf-rubric",{path:this.path,editable:l,doc:t});break;case"text":n=o("ldf-text",{path:this.path,editable:l,doc:t});break;case"responsive":n=o("ldf-responsive-prayer",{path:this.path,editable:l,doc:t});break;case"bible-reading":n=o("ldf-bible-reading",{path:this.path,editable:l,doc:t});break;case"psalm":n=o("ldf-psalm",{path:this.path,editable:l,doc:t});break;default:console.warn("invalid type for document",t)}return n}setPreview(t){this.preview=t,this.editable=!0}render(){var t,i,e,l,s,a,r,d,c,h,u,p;const v=this.nodeFromDoc(this.obj);return v&&o(n,{lang:(null===(t=this.obj)||void 0===t?void 0:t.language)||"en"},(null===(i=this.obj)||void 0===i?void 0:i.audio)?o("audio",{controls:!0,src:this.obj.audio}):null,o("div",{class:{container:!0,editable:this.editable||this.preview,"small-only":!this.editable&&!this.preview&&void 0!==(null===(e=this.obj)||void 0===e?void 0:e.responsive)&&(null===(l=this.obj)||void 0===l?void 0:l.responsive)==y.SmallOnly,"small-hidden":!this.editable&&!this.preview&&void 0!==(null===(s=this.obj)||void 0===s?void 0:s.responsive)&&(null===(a=this.obj)||void 0===a?void 0:a.responsive)==y.SmallHidden}},(this.editable||this.preview)&&o("ldf-editable-metadata-buttons",{visible:this.hasFocus,base:this.base,index:this.index,obj:this.obj,parentType:this.parentType,preview:this.preview,onLdfTogglePreview:t=>this.setPreview(t.detail),class:{"top-level":"liturgy"===(null===(r=this.obj)||void 0===r?void 0:r.type)||"option"===(null===(d=this.obj)||void 0===d?void 0:d.type)}}),(this.editable||this.preview)&&((null===(c=this.obj)||void 0===c?void 0:c.responsive)===y.SmallHidden||(null===(h=this.obj)||void 0===h?void 0:h.responsive)===y.SmallOnly)&&o("ion-chip",{class:"responsive-banner"},o("ion-icon",{name:"phone-portrait-outline"}),(null===(u=this.obj)||void 0===u?void 0:u.responsive)===y.SmallOnly&&o("ion-label",null,this.localeStrings.smallOnly),(null===(p=this.obj)||void 0===p?void 0:p.responsive)===y.SmallHidden&&o("ion-label",null,this.localeStrings.smallHidden)),o("div",{id:(this.path||"").replace(/\//g,"-"),class:{doc:!0,editable:this.editable||this.preview},style:{padding:this.padding}},v)))}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};ot.style="ldf-liturgical-document.sc-ldf-liturgical-document,.sc-ldf-liturgical-document-h{font-family:var(--ldf-font-face);display:block}.container.editable.sc-ldf-liturgical-document{padding-top:0}.lookup.sc-ldf-liturgical-document{background-color:var(--ldf-editable-lookup-background-color);color:var(--ldf-editable-lookup-color);border-radius:4px;margin-bottom:1.5em;padding:1em;width:calc(100% - 2em)}.lookup.sc-ldf-liturgical-document code.sc-ldf-liturgical-document{font-weight:bold}.condition.sc-ldf-liturgical-document{background-color:var(--ldf-editable-condition-background-color);color:var(--ldf-editable-condition-color);border-radius:4px;padding:1em;width:calc(100% - 2em)}.condition.sc-ldf-liturgical-document code.sc-ldf-liturgical-document{font-weight:bold}.doc.sc-ldf-liturgical-document{margin-top:var(--ldf-liturgical-document-margin-top)}ldf-editable-metadata-buttons.sc-ldf-liturgical-document{height:none;display:block;z-index:10;background:var(--ldf-background);opacity:0.8;width:100%;position:sticky;top:2em;padding-top:1em;padding-bottom:1em}ldf-editable-metadata-buttons.top-level.sc-ldf-liturgical-document{position:relative;top:0}.small-only.sc-ldf-liturgical-document{display:block}.small-hidden.sc-ldf-liturgical-document{display:none}@media (min-width: 415px){.small-only.sc-ldf-liturgical-document{display:none}.small-hidden.sc-ldf-liturgical-document{display:block}}";const nt=class{constructor(i){t(this,i),this.preview=!1}docChanged(t){try{this.obj=new $("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new $}}componentWillLoad(){this.docChanged(this.doc)}onFocusPath(t){this.hasFocus=t.detail}render(){const t=("/"==this.path?"":`${this.path}/`)+"/value";return o(n,{lang:this.obj.language},(this.editable||this.preview)&&o("ldf-editable-add-block",{visible:!0,base:t,index:0}),this.obj.value.map(((i,e)=>{var n,l,s;const a=`${t}/${e}`,r=this.hasFocus==a||e==((null===(l=null===(n=this.obj)||void 0===n?void 0:n.value)||void 0===l?void 0:l.length)||0)-1||"option"===(null==i?void 0:i.type)&&(null===(s=this.hasFocus)||void 0===s?void 0:s.startsWith(a));return o("article",{style:{padding:this.editable?"1em":"0"}},o("ldf-liturgical-document",{doc:i,path:a,base:t,index:e,editable:this.editable,preview:this.preview,parentType:"liturgy"}),(this.editable||this.preview)&&o("ldf-editable-add-block",{visible:r,base:t,index:e+1}))})))}static get watchers(){return{doc:["docChanged"]}}},lt={en:{start:"Start",pause:"Pause",resume:"Resume",meditate:"Meditate for",minutes:"minutes.",seconds:" seconds. "}},st=class{constructor(e){t(this,e),this.timerChanged=i(this,"timerChanged",7),this.started=!1,this.paused=!1,this.startingDuration=void 0,this.color="#3333ff"}docChanged(t){try{this.obj=new C("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new C}}async componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings(),this.autostart&&(this.secondsRemaining=this.obj.metadata.length,this.start())}async start(t){var i,e;const o=null!==(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)&&void 0!==e?e:{length:300,delay:0},n=t||o.length,l=o.delay;this.secondsRemaining=n,this.startingDuration=n,setTimeout((()=>{this.startTimer(),this.started=!0}),l),setTimeout((()=>{this.timerChanged.emit("start")}),l)}async pause(){this.paused=!0,this.stopTimer()}async resume(){this.paused=!1,this.startTimer(),this.timerChanged.emit("resume")}async rewind(){this.pause(),this.stopTimer(),this.start(),this.timerChanged.emit("rewind")}async duration(){return this.startingDuration}async reset(){await this.pause(),this.secondsRemaining=void 0}async loadLocaleStrings(){try{this.localeStrings=lt[T(this.element)]}catch(t){console.warn(t)}}minutesSeconds(t){const i=t<0,e=Math.floor(Math.abs(t/60));return`${i?"-":""}${e.toString().padStart(2,"0")}:${Math.abs(t-60*e).toString().padStart(2,"0")}`}startTimer(){this.timerId=setInterval((()=>{this.secondsRemaining--,0==this.secondsRemaining?(this.timerChanged.emit("complete"),this.startingDuration=void 0):this.timerChanged.emit(this.secondsRemaining)}),1e3)}stopTimer(){this.timerId&&clearInterval(this.timerId),this.timerChanged.emit("pause")}handleControlSubmit(t){t.preventDefault()}handleControlValue(t){var i,e,o;let n=t.target.value;""==n&&(n="0"),Object.assign(this.obj,{metadata:Object.assign(Object.assign({},this.obj.metadata),{length:60*parseInt(n)})}),this.obj=new C(this.obj),this.secondsRemaining=null!==(o=null===(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)||void 0===e?void 0:e.length)&&void 0!==o?o:0}buttonNode(t,i,e,n="clear",l="large"){const s=this.localeStrings||{};return customElements&&customElements.get("ion-button")?o("ion-button",{onClick:t,fill:n,size:l},o("ion-icon",{name:e,slot:"start"}),o("ion-label",null,s[i])):o("button",{onClick:t,class:n,style:{color:this.color}},s[i])}render(){var t,i,e,l,s,a,r;const d=this.localeStrings||{},c=null!==(e=null===(i=null===(t=this.obj)||void 0===t?void 0:t.metadata)||void 0===i?void 0:i.length)&&void 0!==e?e:300,h=this.secondsRemaining/c*100;return this.editable?o(n,null,o("form",{class:"controls",onSubmit:t=>this.handleControlSubmit(t)},o("span",null,d.meditate),o("ldf-editable-text",{inputType:"number",short:!0,path:`${this.path}/metadata/length`,text:null===(r=null!==(a=null===(s=null===(l=this.obj)||void 0===l?void 0:l.metadata)||void 0===s?void 0:s.length)&&void 0!==a?a:300)||void 0===r?void 0:r.toString()}),o("span",null,d.seconds),o("span",null,"(",Math.floor(c/60),":",Math.floor(c%60).toString().padStart(2,"0"),")"))):o(n,null,o("div",{class:{"control-container":!0,hidden:!!this.secondsRemaining}},o("form",{class:"controls",onSubmit:t=>this.handleControlSubmit(t)},this.buttonNode((()=>this.start()),"meditate","sunny","solid","small"),o("input",{type:"number",value:c/60,onInput:t=>this.handleControlValue(t)}),o("span",null,d.minutes))),o("div",{class:{hidden:!this.secondsRemaining}},o("div",{class:"progress-circle-container"},o("div",{class:"progress-circle",style:{background:`conic-gradient(${this.color} ${100-h}%, 0, #ecf0f1 ${h}%)`}},o("div",{class:"circle-overlay"},o("div",{class:"seconds"},this.minutesSeconds(this.secondsRemaining)),o("div",{class:"controls"},!this.started&&this.buttonNode((()=>this.start()),"start","start"),this.started&&!this.paused&&this.buttonNode((()=>this.pause()),"pause","pause"),this.started&&this.paused&&this.buttonNode((()=>this.resume()),"resume","play")))))))}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};st.style="ldf-heading.sc-ldf-meditation .control-container.sc-ldf-meditation,.sc-ldf-meditation-h .control-container.sc-ldf-meditation{display:block;margin:auto}ldf-heading.sc-ldf-meditation .controls.sc-ldf-meditation,.sc-ldf-meditation-h .controls.sc-ldf-meditation{display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;width:100%}ldf-heading.sc-ldf-meditation .controls.sc-ldf-meditation input.sc-ldf-meditation,.sc-ldf-meditation-h .controls.sc-ldf-meditation input.sc-ldf-meditation{text-align:center}@media (min-width: 767px){ldf-heading.sc-ldf-meditation .controls.sc-ldf-meditation,.sc-ldf-meditation-h .controls.sc-ldf-meditation{flex-direction:row}}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation{display:flex;align-items:center;justify-content:center;padding:1em}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation{width:300px;height:300px;display:flex;align-items:center;justify-content:center;border-radius:50%}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .circle-overlay.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .circle-overlay.sc-ldf-meditation{background-color:var(--ldf-background-color);display:flex;align-items:center;flex-direction:column;justify-content:center;height:92%;width:92%;border-radius:50%}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .seconds.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .seconds.sc-ldf-meditation{font-family:var(--ldf-font-face);font-size:3em}ldf-heading.sc-ldf-meditation button.clear.sc-ldf-meditation,.sc-ldf-meditation-h button.clear.sc-ldf-meditation{background-color:var(--ldf-background-color);border:none;font-size:1em}.hidden.sc-ldf-meditation{height:0;opacity:0;transition:0.25s}";const at={en:{option:"Option"}},rt=class{constructor(e){t(this,e),this.ldfAddOptionToDoc=i(this,"ldfAddOptionToDoc",7),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.ldfOptionAskForStoredSelection=i(this,"ldfOptionAskForStoredSelection",7),this.ldfOptionMakeSelection=i(this,"ldfOptionMakeSelection",7)}docChanged(t){var i,e,o,n,l,s,a,r,d,c;try{this.obj=new L("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new L}const h=this.editable?null!==(s=null!==(o=null===(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)||void 0===e?void 0:e.editor_selected)&&void 0!==o?o:null===(l=null===(n=this.obj)||void 0===n?void 0:n.metadata)||void 0===l?void 0:l.selected)&&void 0!==s?s:0:null!==(d=null===(r=null===(a=this.obj)||void 0===a?void 0:a.metadata)||void 0===r?void 0:r.selected)&&void 0!==d?d:0;this.select(h),(null===(c=this.obj)||void 0===c?void 0:c.value)&&this.obj.value[h]&&this.obj.value[h].value||this.selectFirstDefined(),this.filterOptions()}componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings(),this.ldfOptionAskForStoredSelection.emit({el:this.el})}async loadLocaleStrings(){try{this.localeStrings=at[T(this.el)]}catch(t){console.warn(t)}}async select(t,i=!1){var e,o,n,l,s,a,r,d;(null===(e=this.obj)||void 0===e?void 0:e.slug)&&"number"==typeof t&&i&&this.ldfOptionMakeSelection.emit({slug:null===(o=this.obj)||void 0===o?void 0:o.slug,index:t});const c=Boolean(null===(n=this.obj)||void 0===n?void 0:n.metadata),h=null===(s=null===(l=this.obj)||void 0===l?void 0:l.metadata)||void 0===s?void 0:s.editor_selected;Number(t)>=0?((null===(a=this.obj)||void 0===a?void 0:a.metadata)?(this.obj.metadata.selected=Number(t),this.obj.metadata.editor_selected=Number(t)):this.obj.metadata={selected:Number(t),editor_selected:Number(t)},this.obj=new L(Object.assign({},this.obj)),i&&!this.editable&&this.ldfDocShouldChange.emit(new N({path:`${this.path}/metadata`,op:[{type:"set",index:"selected",oldValue:h,value:Number(t)}]})),this.editable&&(c&&t!==h?this.ldfDocShouldChange.emit(new N({path:`${this.path}/metadata`,op:[{type:"set",index:"editor_selected",oldValue:h,value:Number(t)}]})):c||t===h||this.ldfDocShouldChange.emit(new N({path:`${this.path}`,op:[{type:"set",index:"metadata",value:{editor_selected:Number(t)}}]}))),Object.assign(this.obj,{metadata:Object.assign(Object.assign({},this.obj.metadata),{selected:t})}),Object.assign(this.obj,{metadata:Object.assign(Object.assign({},this.obj.metadata),{editor_selected:t})})):"add"===t&&this.ldfAddOptionToDoc.emit({base:this.path,index:null===(d=null===(r=this.obj)||void 0===r?void 0:r.value)||void 0===d?void 0:d.length,obj:this.obj})}onSelectChange(t){const i=parseInt(t.target.value);this.select(i,!0)}selectFirstDefined(){const t=this.obj.value.find((t=>void 0!==(null==t?void 0:t.value))),i=this.obj.value.filter((t=>Boolean(t))).indexOf(t);this.select(i)}filterOptions(){var t;this.obj&&(this.obj=new L(Object.assign(Object.assign({},this.obj),{value:((null===(t=this.obj)||void 0===t?void 0:t.value)||[]).filter((t=>this.editable||Boolean(t)&&(Boolean(t.value)||Boolean("bible-reading"===(null==t?void 0:t.type)&&t.citation))))})))}selectNode(){var t,i,e,n,l,s,a,r,d,c,h,u,p,v,b,f;const g=this.editable?null!==(s=null!==(e=null===(i=null===(t=this.obj)||void 0===t?void 0:t.metadata)||void 0===i?void 0:i.editor_selected)&&void 0!==e?e:null===(l=null===(n=this.obj)||void 0===n?void 0:n.metadata)||void 0===l?void 0:l.selected)&&void 0!==s?s:0:null!==(d=null===(r=null===(a=this.obj)||void 0===a?void 0:a.metadata)||void 0===r?void 0:r.selected)&&void 0!==d?d:0;return(null===(h=null===(c=this.obj)||void 0===c?void 0:c.value)||void 0===h?void 0:h.length)>1||this.editable?customElements&&customElements.get("ion-select")?!((null===(u=this.obj)||void 0===u?void 0:u.value)||[]).map(((t,i)=>{var e;return(null===(e=this.versionLabel(t,i))||void 0===e?void 0:e.length)>20})).reduce(((t,i)=>t||i),!1)&&(null===(p=this.obj)||void 0===p?void 0:p.value.length)<=3?o("ion-segment",{color:"primary",value:g.toString()},null===(v=this.obj)||void 0===v?void 0:v.value.map(((t,i)=>o("ion-segment-button",{value:i.toString(),onClick:()=>this.select(i,!0)},o("ion-label",null,this.versionLabel(t,i))))),this.editable&&o("ion-segment-button",{value:"add",class:"add",onClick:()=>this.select("add",!0)},o("ion-label",null,"+"))):(console.log(">2 or longish"),o("ion-toolbar",null,o("ion-select",{value:g,slot:this.editable?"start":"end",onIonChange:t=>this.select(Number(t.detail.value),!0)},null===(b=this.obj)||void 0===b?void 0:b.value.map(((t,i)=>o("ion-select-option",{value:i},o("ion-label",null,this.versionLabel(t,i)))))),this.editable&&o("ion-buttons",{slot:"end"},o("ion-button",{onClick:()=>this.select("add",!0)},o("ion-icon",{slot:"icon-only",name:"add"}))))):o("ldf-label-bar",null,o("select",{onInput:t=>this.onSelectChange(t),slot:this.editable?"start":"end"},null===(f=this.obj)||void 0===f?void 0:f.value.map(((t,i)=>o("option",{value:i,selected:i==g},this.versionLabel(t,i))))),this.editable&&o("button",{slot:"end",onClick:()=>this.select("add",!0)},"+")):[]}versionLabel(t,i){try{return this.obj.getVersionLabel(t)}catch(t){return console.warn(t),`${(this.localeStrings||{}).option} ${i+1}`}}render(){var t;const i=this.editable&&null!==(t=this.obj.metadata.editor_selected)&&void 0!==t?t:this.obj.metadata.selected;return o(n,{lang:this.obj.language},o("div",{class:"select-control"},o("ldf-label-bar",null,this.selectNode())),(this.obj.value||this.editable)&&o("ldf-liturgical-document",{doc:this.obj.value[i],path:`${this.path}/value/${this.obj.metadata.selected}`,base:`${this.path}/value`,index:i,editable:this.editable,parentType:"option"}))}get el(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};rt.style=".select-control.sc-ldf-option{margin-top:var(--ldf-select-control-margin-top)}ion-select.sc-ldf-option{width:75vw;max-width:300px}";const dt={en:{parallel:"Parallel"}},ct=class{constructor(e){t(this,e),this.ldfAddOptionToDoc=i(this,"ldfAddOptionToDoc",7),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.ldfOptionAskForStoredSelection=i(this,"ldfOptionAskForStoredSelection",7),this.ldfOptionMakeSelection=i(this,"ldfOptionMakeSelection",7)}docChanged(t){try{this.obj=new R("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new R}}componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings(),this.ldfOptionAskForStoredSelection.emit({el:this.el})}async loadLocaleStrings(){try{this.localeStrings=dt[T(this.el)]}catch(t){console.warn(t)}}render(){var t;return o(n,{lang:this.obj.language},o("tr",null,((null===(t=this.obj)||void 0===t?void 0:t.value)||[]).map(((t,i)=>o("td",null,o("ldf-liturgical-document",{doc:t,path:`${this.path}/value/${i}`,base:`${this.path}/value`,index:i,editable:this.editable,parentType:"option"}))))))}get el(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};ct.style=".select-control.sc-ldf-parallel{margin-top:var(--ldf-select-control-margin-top)}ion-select.sc-ldf-parallel{width:75vw;max-width:300px}";const ht={en:{changeCanticle:"Change Canticle",citation:"(Biblical) Citation",label:"Label",latinname:"Latin Name",section_break_insert:"+ insert section break",section_break_remove:"x remove section break",source:"Source",source_citation:"Citation"},es:{changeCanticle:"Change Canticle",citation:"(Biblical) Citation",label:"Label",latinname:"Latin Name",section_break_insert:"+ insert section break",section_break_remove:"x remove section break",source:"Source",source_citation:"Citation"}},ut=class{constructor(e){t(this,e),this.ldfAskForCanticleOptions=i(this,"ldfAskForCanticleOptions",7),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.focusedVerse=void 0,this.focusedSection=void 0}docChanged(t){try{this.obj=new S("string"==typeof t?JSON.parse(t):t),this.filter()}catch(t){console.warn(t),this.obj=new S}}async componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings(),this.filter()}async loadLocaleStrings(){try{this.localeStrings=ht[T(this.element)]}catch(t){console.warn(t)}}async changeCanticle(){const t=await g.create({component:"ldf-editable-filter-documents"});t.componentProps={modal:t,type:"canticle",changeCallback:t=>{this.ldfDocShouldChange.emit(new N({path:this.path,op:[{type:"set",oldValue:this.obj,value:t}]}))}},await t.present(),this.ldfAskForCanticleOptions.emit(this.path)}async filter(){this.filteredValue=this.obj.filteredVerses()}antiphonNode(t,i=!1){var e,n;if("string"==typeof t){const e=new V({type:"refrain",value:[t],style:"antiphon"});return o("ldf-refrain",{class:"antiphon",doc:e,editable:this.editable&&!i,path:`${this.path}/metadata/antiphon`})}if(null==t?void 0:t.type)return o("ldf-liturgical-document",{class:"antiphon",doc:t,path:`${this.path}/metadata/antiphon`,editable:this.editable&&!i});if("object"==typeof t){const i=this.obj.day?k(null===(n=null===(e=this.obj)||void 0===e?void 0:e.day)||void 0===n?void 0:n.date):new Date;return this.antiphonNode(t[`${i.getMonth()+1}/${i.getDate()}`]||t[`${i.getMonth()+1}-${i.getDate()}`],!0)}}gloriaNode(t){if("string"==typeof t){const i=new V({value:[t],style:"gloria"});return o("ldf-liturgical-document",{doc:i,editable:this.editable})}return o("ldf-liturgical-document",{doc:t,editable:this.editable})}headingNode(t,i=3,e=!0,n=!1,l=!1){var s,a,r,d,c,h,u,p,v,b,f,g,m,y,x,k,w,$,C,S;let j=this.obj.label;"canticle"==this.obj.style&&this.obj.metadata&&this.obj.metadata.number&&this.obj.metadata.localname?j=`${this.obj.metadata.number}. ${this.obj.metadata.localname}`:"canticle"==this.obj.style&&this.obj.metadata&&this.obj.metadata.localname&&(j=this.obj.metadata.localname);const O=new z({type:"heading",metadata:{level:i},citation:n||(null===(s=this.obj)||void 0===s?void 0:s.citation)===(null===(a=this.obj)||void 0===a?void 0:a.label)||null===(r=this.obj)||void 0===r?void 0:r.citation,value:[null!=t?t:j],source:l||null===(d=this.obj)||void 0===d?void 0:d.source});return this.editable?[o("ldf-label-bar",null,o("h3",{slot:"start",class:"editable-label"},o("ldf-editable-text",{id:"label",text:null===(c=this.obj)||void 0===c?void 0:c.label,path:`${this.path}/label`,placeholder:null===(h=this.localeStrings)||void 0===h?void 0:h.label})),(null===(u=this.obj)||void 0===u?void 0:u.metadata)&&o("ldf-editable-text",{id:"latinname",text:null===(v=null===(p=this.obj)||void 0===p?void 0:p.metadata)||void 0===v?void 0:v.latinname,path:`${this.path}/metadata/latinname`,placeholder:null===(b=this.localeStrings)||void 0===b?void 0:b.latinname}),o("ldf-editable-text",{slot:"end",id:"source-source",text:null===(g=null===(f=this.obj)||void 0===f?void 0:f.source)||void 0===g?void 0:g.source,path:`${this.path}/source/source`,placeholder:null===(m=this.localeStrings)||void 0===m?void 0:m.source}),o("ldf-editable-text",{slot:"end",id:"source-citation",text:null===(x=null===(y=this.obj)||void 0===y?void 0:y.source)||void 0===x?void 0:x.citation,path:`${this.path}/source/citation`,placeholder:null===(k=this.localeStrings)||void 0===k?void 0:k.source_citation})),o("ldf-label-bar",null,o("ldf-editable-text",{slot:"start",id:"citation",text:null===(w=this.obj)||void 0===w?void 0:w.citation,path:`${this.path}/citation`,placeholder:null===($=this.localeStrings)||void 0===$?void 0:$.citation}))]:o("ldf-heading",{doc:O},e&&o("h5",{slot:"additional"},null===(S=null===(C=this.obj)||void 0===C?void 0:C.metadata)||void 0===S?void 0:S.latinname))}insertSectionBreakAfterVerse(t,i){const e=this.obj.value[t],o=e.value.slice(0,i+1),n=e.value.slice(i+1);this.ldfDocShouldChange.emit(new N({path:`${this.path}/value/${t}`,op:[{type:"set",oldValue:e,value:Object.assign(Object.assign({},e),{value:o})}]})),this.ldfDocShouldChange.emit(new N({path:`${this.path}/value`,op:[{type:"insertAt",index:t+1,oldValue:e,value:Object.assign(Object.assign({},e),{value:n})}]}))}removeSectionBreakAfter(t){const i=this.obj.value[t],e=this.obj.value[t+1];if(i&&e){const o=i.value.concat(e.value);this.ldfDocShouldChange.emit(new N({path:`${this.path}/value/${t}/value`,op:[{type:"set",oldValue:i.value,value:o}]})),this.ldfDocShouldChange.emit(new N({path:`${this.path}/value`,op:[{type:"deleteAt",index:t+1,oldValue:e}]}))}}render(){var t,i,e,l,s,a,r,d,c,h,u,p,v,b,f,g,m,y,x,k;const w=this.obj.includeAntiphon();let $,C=t=>({type:"psalm-verse",number:"",halfverse:"",verse:t});this.editable&&($=Object.assign({},(null===(i=null===(t=this.obj)||void 0===t?void 0:t.value[0])||void 0===i?void 0:i.value[0])||{type:"psalm-verse",number:"",halfverse:"",verse:""}),$.number&&($.number=""),$.halfverse&&($.halfverse=""),$.verse&&($.verse=""));const S=((null===(e=this.obj)||void 0===e?void 0:e.value)||[]).map((t=>t.value.map((t=>!Boolean(t.number))))).flat().reduce(((t,i)=>t||i),!1),j=this.localeStrings||{};return o(n,{lang:(null===(l=this.obj)||void 0===l?void 0:l.language)||"en"},o("div",{class:`psalm-parent ${this.editable?"editable":""} ${(null===(s=this.obj)||void 0===s?void 0:s.display_format)||"default"} ${S?"no-numbers":""}`},(this.editable||"canticle"===(null===(a=this.obj)||void 0===a?void 0:a.style))&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"},"canticle"===(null===(r=this.obj)||void 0===r?void 0:r.style)&&(null===(c=null===(d=this.obj)||void 0===d?void 0:d.metadata)||void 0===c?void 0:c.changeable)&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"},o("ion-buttons",null,o("ion-button",{onClick:()=>this.changeCanticle()},o("ion-icon",{name:"swap-horizontal",slot:"start"}),o("ion-label",null,j.changeCanticle))))))),this.headingNode(),w&&this.antiphonNode(this.obj.metadata.antiphon),null===(h=this.filteredValue)||void 0===h?void 0:h.map(((t,i)=>{var e,n,l;return[t.label&&(null===(e=t.value)||void 0===e?void 0:e.length)>0&&this.headingNode(t.label,4,!1,!0,!0),o("div",{class:"psalm-set"},t.value.map(((t,e)=>{var n,l,s,a,r,d,c,h,u,p;if(t instanceof z)return o("ldf-heading",{doc:t});{const v=new Array;return v.push(o("div",{class:"verse"},this.editable?o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}-${e}-verse`,text:t.verse,path:`${this.path}/value/${i}/value/${e}/verse`,placeholder:"Lorem ipsum sit dolor amet, *",template:$,templateMaker:C}):o("ldf-string",{text:t.verse,citation:{label:null===(n=this.obj)||void 0===n?void 0:n.label,book:"psalm"===(null===(l=this.obj)||void 0===l?void 0:l.style)?"Psalm":void 0,chapter:null===(a=null===(s=this.obj)||void 0===s?void 0:s.metadata)||void 0===a?void 0:a.number,verse:t.number},dropcap:M(null===(r=this.obj)||void 0===r?void 0:r.language,null===(d=this.obj)||void 0===d?void 0:d.display_format,e),index:e,fragment:this.path}))),v.push(o("br",null)),v.push(o("div",{class:"halfverse"},this.editable?o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}-${e}-halfverse`,text:t.halfverse,path:`${this.path}/value/${i}/value/${e}/halfverse`,placeholder:"consectetur adipiscing elit.",template:$}):o("ldf-string",{text:t.halfverse,citation:{label:null===(c=this.obj)||void 0===c?void 0:c.label,book:"psalm"===(null===(h=this.obj)||void 0===h?void 0:h.style)?"Psalm":void 0,chapter:null===(p=null===(u=this.obj)||void 0===u?void 0:u.metadata)||void 0===p?void 0:p.number,verse:t.number},dropcap:"disabled",fragment:this.path}))),o("p",{class:this.editable?"psalm editable":"psalm",onClick:()=>{this.focusedVerse=e,this.focusedSection=i}},this.editable?o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}-${e}-number`,text:t.number,path:`${this.path}/value/${i}/value/${e}/number`,placeholder:"#",template:$}):t.number&&o("sup",null,t.number),o("div",{class:"text"},v,this.editable&&o("ion-button",{fill:"clear",class:{"section-break":!0,hidden:this.focusedVerse!==e||this.focusedSection!==i},onClick:()=>this.insertSectionBreakAfterVerse(i,e)},j.section_break_insert)))}})),this.obj.repeatAntiphon(i,this.filteredValue.length)&&o("div",{class:"repeat-antiphon"},this.antiphonNode(null===(l=null===(n=this.obj)||void 0===n?void 0:n.metadata)||void 0===l?void 0:l.antiphon)),this.editable&&this.obj.value.length>i+1&&o("ion-button",{fill:"clear",class:"section-break",onClick:()=>this.removeSectionBreakAfter(i)},j.section_break_remove))]})),(null===(p=null===(u=this.obj)||void 0===u?void 0:u.metadata)||void 0===p?void 0:p.gloria)&&!this.obj.metadata.omit_gloria&&this.gloriaNode(this.obj.metadata.gloria),((null===(b=null===(v=this.obj)||void 0===v?void 0:v.metadata)||void 0===b?void 0:b.gloria)&&!this.obj.metadata.omit_gloria||void 0===(null===(g=null===(f=this.obj)||void 0===f?void 0:f.metadata)||void 0===g?void 0:g.gloria)||Boolean(null===(y=null===(m=this.obj)||void 0===m?void 0:m.metadata)||void 0===y?void 0:y.omit_gloria))&&w&&this.antiphonNode(null===(k=null===(x=this.obj)||void 0===x?void 0:x.metadata)||void 0===k?void 0:k.antiphon)))}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};ut.style="ldf-psalm.sc-ldf-psalm,.sc-ldf-psalm-h{font-family:var(--ldf-font-face);--ldf-drop-margin-right:var(--ldf-drop-psalm-margin-right)}ldf-psalm[lang=he].sc-ldf-psalm .verse.sc-ldf-psalm,[lang=he].sc-ldf-psalm-h .verse.sc-ldf-psalm{text-align:right;--ldf-drop-float:right}.psalm-set.sc-ldf-psalm{margin-top:0.5em;margin-bottom:0.5em}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm{display:var(--ldf-psalm-grid-display);grid-template-columns:var(--ldf-psalm-grid-template-columns);grid-template-rows:auto;grid-template-areas:var(--ldf-psalm-grid-template-areas);margin:0;text-indent:var(--ldf-psalm-verse-indentation)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm br.sc-ldf-psalm{display:var(--ldf-psalm-line-break-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm sup.sc-ldf-psalm{float:var(--ldf-psalm-number-float);display:var(--ldf-psalm-number-display);grid-area:var(--ldf-psalm-number-grid-area);margin-right:var(--ldf-psalm-number-margin-right)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .text.sc-ldf-psalm{display:var(--ldf-psalm-text-display);grid-area:var(--ldf-psalm-text-grid-area)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .halfverse.sc-ldf-psalm{margin-left:var(--ldf-psalm-halfverse-margin-left)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .verse.sc-ldf-psalm,.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .halfverse.sc-ldf-psalm{display:var(--ldf-psalm-verse-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .halfverse.sc-ldf-psalm{display:var(--ldf-psalm-halfverse-display, var(--ldf-psalm-verse-display))}.editable.sc-ldf-psalm .verse.sc-ldf-psalm,.editable.sc-ldf-psalm .halfverse.sc-ldf-psalm{width:100%}.psalm-parent.no-numbers.sc-ldf-psalm{display:block;text-align:left;grid-template-columns:none;grid-template-rows:none;grid-template-areas:none}.psalm-parent.no-numbers.sc-ldf-psalm .psalm.sc-ldf-psalm{display:block;grid-template-columns:none;grid-template-rows:none;grid-template-areas:none}.psalm-parent.no-numbers.sc-ldf-psalm .psalm.sc-ldf-psalm .text.sc-ldf-psalm{text-align:left;grid-area:none;display:var(--ldf-psalm-text-display);width:100%}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-of-type(1) sup.sc-ldf-psalm{display:var(--ldf-psalm-set-first-verse-number-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .verse.sc-ldf-psalm:nth-of-type(1){display:var(--ldf-psalm-set-first-verse-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .halfverse.sc-ldf-psalm:nth-of-type(2){display:var(--ldf-psalm-set-first-half-verse-display, inline-block)}.psalm-set.sc-ldf-psalm:nth-of-type(1) .psalm.sc-ldf-psalm:nth-of-type(1) sup.sc-ldf-psalm{display:var(--ldf-psalm-first-verse-number-display)}.psalm-set.sc-ldf-psalm:nth-of-type(1) .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .verse.sc-ldf-psalm:nth-of-type(1){display:var(--ldf-psalm-first-verse-display)}.psalm-set.sc-ldf-psalm:nth-of-type(1) .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .halfverse.sc-ldf-psalm:nth-of-type(2){display:var(--ldf-psalm-first-half-verse-display, inline-block)}.antiphon.sc-ldf-psalm{display:var(--ldf-psalm-antiphon-display);font-style:var(--ldf-antiphon-font-style);font-weight:var(--ldf-antiphon-font-weight);margin-top:0.5em}.repeat-antiphon.sc-ldf-psalm{display:var(--ldf-psalm-repeat-antiphon-display)}h5.sc-ldf-psalm{font-size:1em;font-style:italic;font-weight:normal;margin-right:1em}.psalm.unison.sc-ldf-psalm .text.sc-ldf-psalm{font-weight:var(--ldf-unison-font-weight);font-style:var(--ldf-unison-font-style)}.psalm.omit.sc-ldf-psalm .text.sc-ldf-psalm{display:none}.psalm.wholeverse.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-child(even),.psalm-parent.wholeverse.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-child(even){font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.psalm.halfverse.sc-ldf-psalm .halfverse.sc-ldf-psalm,.psalm-parent.halfverse.sc-ldf-psalm .halfverse.sc-ldf-psalm{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}h3.editable-label.sc-ldf-psalm{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}.section-break.sc-ldf-psalm{display:block;text-align:center;width:100%}.section-break.hidden.sc-ldf-psalm{display:none}";const pt=class{constructor(i){t(this,i)}docChanged(t){try{this.obj=new V("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new V}}componentWillLoad(){this.docChanged(this.doc)}render(){var t,i,e;return o(n,{lang:this.obj.language},this.editable&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"})),o("div",{class:`${(null===(t=this.obj)||void 0===t?void 0:t.style)||""} ${(null===(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)||void 0===e?void 0:e.align)||""}`},this.obj.value&&this.obj.value.map(((t,i)=>this.editable?o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}`,text:t,path:`${this.path}/value/${i}`}):o("p",{id:`${this.obj.uid||this.obj.slug}-${i}`,innerHTML:t})))))}static get watchers(){return{doc:["docChanged"]}}};pt.style="ldf-refrain.sc-ldf-refrain,.sc-ldf-refrain-h{font-family:var(--ldf-font-face);display:block}ldf-refrain.sc-ldf-refrain p.sc-ldf-refrain,.sc-ldf-refrain-h p.sc-ldf-refrain{font-style:inherit;margin-bottom:0;margin:0}.antiphon.sc-ldf-refrain{font-style:var(--ldf-antiphon-font-style)}.gloria.sc-ldf-refrain{margin-left:calc(var(--ldf-gloria-indent) / 2);text-indent:calc(var(--ldf-gloria-indent) / -2)}@media (min-width: 450px){.gloria.sc-ldf-refrain{margin-left:var(--ldf-gloria-indent);text-indent:calc(var(--ldf-gloria-indent) * -1)}.gloria.sc-ldf-refrain>p.sc-ldf-refrain:first-child{margin-left:0em}.gloria.sc-ldf-refrain>p.sc-ldf-refrain:nth-child(even){margin-left:1em}}.left.sc-ldf-refrain{text-align:left}.center.sc-ldf-refrain{text-align:center}.right.sc-ldf-refrain{text-align:right}";const vt={en:{label:"Label",source:"Source",citation:"Citation",makeOptional:"Make Optional",optional:"Optional"}},bt=class{constructor(i){t(this,i)}docChanged(t){try{this.obj=new j("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new j}}async componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings()}async loadLocaleStrings(){try{this.localeStrings=vt[T(this.element)]}catch(t){console.warn(t)}}editableNode(t,i,e,n,l){return o("ldf-editable-text",{id:`${this.obj.uid}-${i}-${e}`,text:t[e],path:`${this.path}/value/${i}/${e}`,template:n,templateMaker:l})}stringNode(t,i,e,n){return o("ldf-string",{citation:{label:this.obj.label},id:`${this.obj.uid}-${e}-${n}`,text:i[n],dropcap:M(t.language,t.display_format,e),fragment:this.path})}litanyResponseStringNode(t,i){const e=t.response||this.obj.metadata.response;return"[Silence]"==e?o("span",{class:"rubric"},o("br",null),"Silence"):o("span",{class:"response"},o("ldf-string",{citation:{label:this.obj.label},id:`${this.obj.uid}-${i}-response`,text:e,fragment:this.path}))}editableHeader(){var t,i,e,n,l,s,a,r;return o("ldf-label-bar",null,o("h3",{slot:"start",class:"editable-label"},o("ldf-editable-text",{id:"label",text:null===(t=this.obj)||void 0===t?void 0:t.label,path:`${this.path}/label`,placeholder:null===(i=this.localeStrings)||void 0===i?void 0:i.label})),o("ldf-editable-text",{slot:"end",id:"source-source",text:null===(n=null===(e=this.obj)||void 0===e?void 0:e.source)||void 0===n?void 0:n.source,path:`${this.path}/source/source`,placeholder:null===(l=this.localeStrings)||void 0===l?void 0:l.source}),o("ldf-editable-text",{slot:"end",id:"source-citation",text:null===(a=null===(s=this.obj)||void 0===s?void 0:s.source)||void 0===a?void 0:a.citation,path:`${this.path}/source/citation`,placeholder:null===(r=this.localeStrings)||void 0===r?void 0:r.citation}))}render(){var t,i,e,l,s;const a=(null===(t=this.obj)||void 0===t?void 0:t.label)||(null===(i=this.obj)||void 0===i?void 0:i.citation)||(null===(e=this.obj)||void 0===e?void 0:e.source);if("preces"==this.obj.style){const t={label:"",text:""},i=t=>({label:"",text:t});return o(n,{class:this.obj.style,lang:this.obj.language},o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"})),!this.editable&&a&&o("ldf-heading",{doc:new z({type:"heading",metadata:{level:3},value:[this.obj.label],citation:this.obj.citation,source:this.obj.source})}),this.editable&&a&&this.editableHeader(),o("table",{class:"preces"},this.obj.value.map(((e,n)=>o("tr",{class:"row"},o("td",{class:"cell"},this.editable?this.editableNode(e,n,"label",t,i):this.stringNode(this.obj,e,n,"label")),o("td",{class:n%2==0?"cell":"cell response"},this.editable?this.editableNode(e,n,"text",t,i):this.stringNode(this.obj,e,n,"text")))))))}if("litany"==this.obj.style){const t={text:"",response:(null===(l=this.obj.metadata)||void 0===l?void 0:l.response)||""},i=t=>{var i;return{text:t,response:(null===(i=this.obj.metadata)||void 0===i?void 0:i.response)||""}};return o(n,{class:this.obj.style,lang:this.obj.language},this.editable&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"})),!this.editable&&a&&o("ldf-heading",{doc:new z({type:"heading",metadata:{level:3},value:[this.obj.label],citation:this.obj.citation,source:this.obj.source})}),this.editable&&a&&this.editableHeader(),this.obj.value.map(((e,n)=>{var l,s;let a=new Array("litany");return e.optional&&a.push("optional"),o("div",{class:{line:!0,editable:this.editable}},o("p",{class:a.join(" ")},this.editable?this.editableNode(e,n,"text",t,i):this.stringNode(this.obj,e,n,"text"),e.response&&(this.editable?o("span",{class:"response"},this.editableNode(e,n,"response",t,i)):[o("br",null),this.litanyResponseStringNode(e,n)]),!e.response&&(null===(l=this.obj.metadata)||void 0===l?void 0:l.response)&&(this.editable?o("span",{class:"response"},o("ldf-editable-text",{id:`${this.obj.uid}-${n}-response`,text:this.obj.metadata.response,path:`${this.path}/response`})):[o("br",null),this.litanyResponseStringNode(e,n)])),this.editable&&o("label",{class:"optional-label",htmlFor:`optional-${n}`},null===(s=this.localeStrings)||void 0===s?void 0:s.optional),this.editable&&o("ldf-editable-boolean",{id:`optional-${n}`,slot:"start",path:`${this.path}/value/${n}/optional`,value:e.optional}))})))}{const t={text:"",response:(null===(s=this.obj.metadata)||void 0===s?void 0:s.response)||""},i=t=>{var i;return{text:t,response:(null===(i=this.obj.metadata)||void 0===i?void 0:i.response)||""}};return o(n,{class:this.obj.style,lang:this.obj.language},!this.editableHeader&&a&&o("ldf-heading",{doc:new z({type:"heading",metadata:{level:3},value:[this.obj.label],citation:this.obj.citation,source:this.obj.source})}),this.editable&&a&&this.editableHeader(),o("p",{class:"responsive"},this.obj.value.map(((e,n)=>[o("div",null,this.editable?this.editableNode(e,n,"text",t,i):this.stringNode(this.obj,e,n,"text")),o("div",{class:"response"},this.editable?this.editableNode(e,n,"response",t,i):this.stringNode(this.obj,e,n,"response"))]))))}}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};bt.style=".sc-ldf-responsive-prayer-h{text-align:var(--ldf-text-align);text-justify:inter-character}.response.sc-ldf-responsive-prayer{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.preces.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer{text-align:left}.preces.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer:first-child{font-style:italic;text-align:left;padding-right:1em;vertical-align:top}.optional.sc-ldf-responsive-prayer{padding-left:0.5em;border-left:2px solid black}.line.sc-ldf-responsive-prayer{display:flex;flex-direction:row;align-items:center}.line.sc-ldf-responsive-prayer>*.sc-ldf-responsive-prayer{text-align:var(--ldf-text-align)}.editable.line.sc-ldf-responsive-prayer ldf-editable-boolean.sc-ldf-responsive-prayer{width:2em}.editable.line.sc-ldf-responsive-prayer p.sc-ldf-responsive-prayer{width:calc(100% - 2em)}.rubric.sc-ldf-responsive-prayer{font-family:var(--ldf-font-face);color:var(--ldf-rubric-color);font-style:var(--ldf-rubric-font-style);font-weight:var(--ldf-rubric-font-weight);font-size:var(--ldf-rubric-font-size)}.litany.sc-ldf-responsive-prayer{white-space:pre-wrap}.preces.sc-ldf-responsive-prayer{width:100%}.preces.sc-ldf-responsive-prayer tr.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer .row.sc-ldf-responsive-prayer{display:table-row;display:var(--ldf-preces-tr-display)}.preces.sc-ldf-responsive-prayer tr.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer tr.sc-ldf-responsive-prayer .cell.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer .row.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer .row.sc-ldf-responsive-prayer .cell.sc-ldf-responsive-prayer{display:table-cell;display:var(--ldf-preces-td-display);margin-left:var(--ldf-preces-td-margin-left)}h3.editable-label.sc-ldf-responsive-prayer{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}.optional-label.sc-ldf-responsive-prayer{margin-right:0.5em}";const ft=class{constructor(i){t(this,i)}docChanged(t){try{this.obj=new O("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new O}}componentWillLoad(){this.docChanged(this.doc)}render(){return o(n,{lang:this.obj.language},this.editable&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"})),this.obj.value.map(((t,i)=>this.editable?o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}`,text:t,path:`${this.path}/value/${i}`}):o("p",{id:`${this.obj.uid||this.obj.slug}-${i}`,class:"rubric"},t))))}static get watchers(){return{doc:["docChanged"]}}};ft.style=".sc-ldf-rubric-h{font-family:var(--ldf-font-face);color:var(--ldf-rubric-color);font-style:var(--ldf-rubric-font-style);font-weight:var(--ldf-rubric-font-weight);font-size:var(--ldf-rubric-font-size);text-align:var(--ldf-text-align);text-justify:inter-character}";export{E as ion_segment,I as ion_segment_button,J as ion_skeleton_text,W as ldf_bible_reading,F as ldf_editable_add_block,K as ldf_editable_metadata_buttons,U as ldf_editable_select,q as ldf_image,ot as ldf_liturgical_document,nt as ldf_liturgy,st as ldf_meditation,rt as ldf_option,ct as ldf_parallel,ut as ldf_psalm,pt as ldf_refrain,bt as ldf_responsive_prayer,ft as ldf_rubric}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venite/components",
3
- "version": "0.16.49",
3
+ "version": "0.16.51",
4
4
  "description": "Rendering components for the Venite.app Liturgical Document Format (LDF)",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -1 +0,0 @@
1
- import{r as t,c as i,w as e,h as o,H as n,d as l,f as s}from"./p-814a5a13.js";import{c as a,g as r}from"./p-b7c33573.js";import{q as d,b as c,e as h}from"./p-4aeedb04.js";import{i as u}from"./p-506221fe.js";import{c as p,h as v}from"./p-0e4de1d0.js";import{f as b,l as f,m as g,t as m}from"./p-011c0279.js";import{L as y,R as x,d as k}from"./p-619c1cd7.js";import{B as w,L as $,M as C,P as S,R as j,a as O}from"./p-c88be1ca.js";import{H as z}from"./p-d6b725e9.js";import{v as _,O as L}from"./p-8e59a930.js";import{C as N}from"./p-991c0877.js";import{g as T}from"./p-546bb0de.js";import{u as M}from"./p-ae13ac48.js";import{I as D}from"./p-cf9d5530.js";import{D as R}from"./p-e911e60d.js";import{R as A}from"./p-3f3b5ab1.js";import"./p-add30d46.js";import"./p-3e8ff66b.js";class V extends y{constructor(t={}){super(t)}}const E=class{constructor(e){t(this,e),this.ionChange=i(this,"ionChange",7),this.ionSelect=i(this,"ionSelect",7),this.ionStyle=i(this,"ionStyle",7),this.didInit=!1,this.activated=!1,this.disabled=!1,this.scrollable=!1,this.swipeGesture=!0,this.selectOnFocus=!1,this.onClick=t=>{const i=t.target,e=this.checked;"ION-SEGMENT"!==i.tagName&&(this.value=i.value,!this.scrollable&&this.swipeGesture||(e?this.checkButton(e,i):this.setCheckedClasses()),this.checked=i)},this.getSegmentButton=t=>{const i=this.getButtons().filter((t=>!t.disabled)),e=i.findIndex((t=>t===document.activeElement));switch(t){case"first":return i[0];case"last":return i[i.length-1];case"next":return i[e+1]||i[0];case"previous":return i[e-1]||i[i.length-1];default:return null}}}colorChanged(t,i){(void 0===i&&void 0!==t||void 0!==i&&void 0===t)&&this.emitStyle()}swipeGestureChanged(){this.gestureChanged()}valueChanged(t,i){this.ionSelect.emit({value:t}),(""!==i||this.didInit)&&(this.activated?this.valueAfterGesture=t:this.ionChange.emit({value:t}))}disabledChanged(){this.gestureChanged();const t=this.getButtons();for(const i of t)i.disabled=this.disabled}gestureChanged(){this.gesture&&this.gesture.enable(!this.scrollable&&!this.disabled&&this.swipeGesture)}connectedCallback(){this.emitStyle()}componentWillLoad(){this.emitStyle()}async componentDidLoad(){this.setCheckedClasses(),this.ensureFocusable(),this.gesture=(await import("./p-e9431eeb.js")).createGesture({el:this.el,gestureName:"segment",gesturePriority:100,threshold:0,passive:!1,onStart:t=>this.onStart(t),onMove:t=>this.onMove(t),onEnd:t=>this.onEnd(t)}),this.gestureChanged(),this.disabled&&this.disabledChanged(),this.didInit=!0}onStart(t){this.activate(t)}onMove(t){this.setNextIndex(t)}onEnd(t){this.setActivated(!1);const i=this.setNextIndex(t,!0);t.event.stopImmediatePropagation(),i&&this.addRipple(t);const e=this.valueAfterGesture;void 0!==e&&(this.ionChange.emit({value:e}),this.valueAfterGesture=void 0)}getButtons(){return Array.from(this.el.querySelectorAll("ion-segment-button"))}addRipple(t){if(!a.getBoolean("animated",!0)||!a.getBoolean("rippleEffect",!0))return;const i=this.getButtons().find((t=>t.value===this.value)),e=(i.shadowRoot||i).querySelector("ion-ripple-effect");if(!e)return;const{x:o,y:n}=d(t.event);e.addRipple(o,n).then((t=>t()))}setActivated(t){this.getButtons().forEach((i=>{t?i.classList.add("segment-button-activated"):i.classList.remove("segment-button-activated")})),this.activated=t}activate(t){const i=t.event.target,e=this.getButtons().find((t=>t.value===this.value));"ION-SEGMENT-BUTTON"===i.tagName&&(e||(this.value=i.value,this.setCheckedClasses()),this.value===i.value&&this.setActivated(!0))}getIndicator(t){return(t.shadowRoot||t).querySelector(".segment-button-indicator")}checkButton(t,i){const o=this.getIndicator(t),n=this.getIndicator(i);if(null===o||null===n)return;const l=o.getBoundingClientRect(),s=n.getBoundingClientRect(),a=`translate3d(${l.left-s.left}px, 0, 0) scaleX(${l.width/s.width})`;e((()=>{n.classList.remove("segment-button-indicator-animated"),n.style.setProperty("transform",a),n.getBoundingClientRect(),n.classList.add("segment-button-indicator-animated"),n.style.setProperty("transform","")})),this.value=i.value,this.setCheckedClasses()}setCheckedClasses(){const t=this.getButtons(),i=t.findIndex((t=>t.value===this.value))+1;this.checked=t.find((t=>t.value===this.value));for(const i of t)i.classList.remove("segment-button-after-checked");i<t.length&&t[i].classList.add("segment-button-after-checked")}setNextIndex(t,i=!1){const e=u(this.el),o=this.activated,n=this.getButtons(),l=n.findIndex((t=>t.value===this.value)),s=n[l];let a,r;if(-1===l)return;const d=s.getBoundingClientRect(),c=d.left,h=d.width,p=t.currentX,v=d.top+d.height/2,b=this.el.getRootNode().elementFromPoint(p,v);if(o&&!i){if(e?p>c+h:p<c){const t=l-1;t>=0&&(r=t)}else if((e?p<c:p>c+h)&&o&&!i){const t=l+1;t<n.length&&(r=t)}void 0===r||n[r].disabled||(a=n[r])}if(!o&&i&&(a=b),null!=a){if("ION-SEGMENT"===a.tagName)return!1;s!==a&&this.checkButton(s,a)}return!0}emitStyle(){this.ionStyle.emit({segment:!0})}onKeyDown(t){const i=u(this.el);let e,o=this.selectOnFocus;switch(t.key){case"ArrowRight":t.preventDefault(),e=this.getSegmentButton(i?"previous":"next");break;case"ArrowLeft":t.preventDefault(),e=this.getSegmentButton(i?"next":"previous");break;case"Home":t.preventDefault(),e=this.getSegmentButton("first");break;case"End":t.preventDefault(),e=this.getSegmentButton("last");break;case" ":case"Enter":t.preventDefault(),e=document.activeElement,o=!0}e&&(o&&this.checkButton(this.checked||e,e),e.focus())}ensureFocusable(){var t;void 0===this.value&&(null===(t=this.getButtons()[0])||void 0===t||t.setAttribute("tabindex","0"))}render(){const t=r(this);return o(n,{role:"tablist",onClick:this.onClick,class:p(this.color,{[t]:!0,"in-toolbar":v("ion-toolbar",this.el),"in-toolbar-color":v("ion-toolbar[color]",this.el),"segment-activated":this.activated,"segment-disabled":this.disabled,"segment-scrollable":this.scrollable})},o("slot",null))}get el(){return l(this)}static get watchers(){return{color:["colorChanged"],swipeGesture:["swipeGestureChanged"],value:["valueChanged"],disabled:["disabledChanged"]}}};E.style={ios:":host{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:stretch;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint;user-select:none}:host(.segment-scrollable){justify-content:start;width:auto;overflow-x:auto}:host(.segment-scrollable::-webkit-scrollbar){display:none}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.065);border-radius:8px;overflow:hidden;z-index:0}:host(.ion-color){background:rgba(var(--ion-color-base-rgb), 0.065)}:host(.in-toolbar){margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;width:auto}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.in-toolbar){margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}:host(.in-toolbar:not(.ion-color)){background:var(--ion-toolbar-segment-background, var(--background))}:host(.in-toolbar-color:not(.ion-color)){background:rgba(var(--ion-color-contrast-rgb), 0.11)}",md:":host{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:stretch;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint;user-select:none}:host(.segment-scrollable){justify-content:start;width:auto;overflow-x:auto}:host(.segment-scrollable::-webkit-scrollbar){display:none}:host{--background:transparent}:host(.segment-scrollable) ::slotted(ion-segment-button){min-width:auto}"};let B=0;const I=class{constructor(i){t(this,i),this.segmentEl=null,this.checked=!1,this.disabled=!1,this.layout="icon-top",this.type="button",this.value="ion-sb-"+B++,this.updateStyle=()=>{s(this)},this.updateState=()=>{this.segmentEl&&(this.checked=this.segmentEl.value===this.value)}}connectedCallback(){const t=this.segmentEl=this.el.closest("ion-segment");t&&(this.updateState(),c(t,"ionSelect",this.updateState),c(t,"ionStyle",this.updateStyle))}disconnectedCallback(){const t=this.segmentEl;t&&(h(t,"ionSelect",this.updateState),h(t,"ionStyle",this.updateStyle),this.segmentEl=null)}get hasLabel(){return!!this.el.querySelector("ion-label")}get hasIcon(){return!!this.el.querySelector("ion-icon")}get tabIndex(){return this.checked&&!this.disabled?0:-1}render(){const{checked:t,type:i,disabled:e,hasIcon:l,hasLabel:s,layout:a,segmentEl:d,tabIndex:c}=this,h=r(this);return o(n,{role:"tab","aria-selected":t?"true":"false","aria-disabled":e?"true":null,tabIndex:c,class:{[h]:!0,"in-toolbar":v("ion-toolbar",this.el),"in-toolbar-color":v("ion-toolbar[color]",this.el),"in-segment":v("ion-segment",this.el),"in-segment-color":void 0!==(null==d?void 0:d.color),"segment-button-has-label":s,"segment-button-has-icon":l,"segment-button-has-label-only":s&&!l,"segment-button-has-icon-only":l&&!s,"segment-button-disabled":e,"segment-button-checked":t,[`segment-button-layout-${a}`]:!0,"ion-activatable":!0,"ion-activatable-instant":!0,"ion-focusable":!0}},o("button",{type:i,tabIndex:-1,class:"button-native",part:"native",disabled:e},o("span",{class:"button-inner"},o("slot",null)),"md"===h&&o("ion-ripple-effect",null)),o("div",{part:"indicator",class:{"segment-button-indicator":!0,"segment-button-indicator-animated":!0}},o("div",{part:"indicator-background",class:"segment-button-indicator-background"})))}get el(){return l(this)}};I.style={ios:':host{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:flex;position:relative;flex:1 1 auto;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;font-kerning:none;cursor:pointer}.button-native{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:var(--margin-start);margin-right:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);transform:translate3d(0, 0, 0);display:flex;position:relative;flex-direction:inherit;flex-grow:1;align-items:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end)}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{display:flex;position:relative;flex-flow:inherit;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.segment-button-checked){background:var(--background-checked);color:var(--color-checked)}:host(.segment-button-disabled){cursor:default;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(:focus){outline:none}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.segment-button-checked:hover) .button-native{color:var(--color-checked)}}::slotted(ion-icon){flex-shrink:0;order:-1;pointer-events:none}::slotted(ion-label){display:block;align-self:center;line-height:22px;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;pointer-events:none}:host(.segment-button-layout-icon-top) .button-native{flex-direction:column}:host(.segment-button-layout-icon-start) .button-native{flex-direction:row}:host(.segment-button-layout-icon-end) .button-native{flex-direction:row-reverse}:host(.segment-button-layout-icon-bottom) .button-native{flex-direction:column-reverse}:host(.segment-button-layout-icon-hide) ::slotted(ion-icon){display:none}:host(.segment-button-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color, var(--color-checked))}.segment-button-indicator{transform-origin:left;position:absolute;opacity:0;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}.segment-button-indicator-background{width:100%;height:var(--indicator-height);transform:var(--indicator-transform);box-shadow:var(--indicator-box-shadow);pointer-events:none}.segment-button-indicator-animated{transition:var(--indicator-transition)}:host(.segment-button-checked) .segment-button-indicator{opacity:1}@media (prefers-reduced-motion: reduce){.segment-button-indicator-background{transform:none}.segment-button-indicator-animated{transition:none}}:host{--background:none;--background-checked:none;--background-hover:none;--background-hover-opacity:0;--background-focused:none;--background-focused-opacity:0;--border-radius:7px;--border-width:1px;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--border-style:solid;--indicator-box-shadow:0 0 5px rgba(0, 0, 0, 0.16);--indicator-color:var(--ion-color-step-350, var(--ion-background-color, #fff));--indicator-height:100%;--indicator-transition:transform 260ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--transition:100ms all linear;--padding-top:0;--padding-end:13px;--padding-bottom:0;--padding-start:13px;margin-top:2px;margin-bottom:2px;position:relative;flex-basis:0;flex-direction:row;min-width:70px;min-height:28px;transform:translate3d(0, 0, 0);font-size:13px;font-weight:450;line-height:37px}:host::before{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px;transition:160ms opacity ease-in-out;transition-delay:100ms;border-left:var(--border-width) var(--border-style) var(--border-color);content:"";opacity:1;will-change:opacity}:host(:first-of-type)::before{border-left-color:transparent}:host(.segment-button-disabled){opacity:0.3}::slotted(ion-icon){font-size:24px}:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:2px;margin-right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:0;margin-inline-end:0}}:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:0;margin-right:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:2px;margin-inline-end:2px}}.segment-button-indicator{padding-left:2px;padding-right:2px;left:0;right:0;top:0;bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.segment-button-indicator{padding-left:unset;padding-right:unset;-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:2px;padding-inline-end:2px}}.segment-button-indicator-background{border-radius:var(--border-radius);background:var(--indicator-color)}.segment-button-indicator-background{transition:var(--indicator-transition)}:host(.segment-button-checked)::before,:host(.segment-button-after-checked)::before{opacity:0}:host(.segment-button-checked){z-index:-1}:host(.segment-button-activated){--indicator-transform:scale(0.95)}:host(.ion-focused) .button-native{opacity:0.7}@media (any-hover: hover){:host(:hover) .button-native{opacity:0.5}:host(.segment-button-checked:hover) .button-native{opacity:1}}:host(.in-segment-color){background:none;color:var(--ion-text-color, #000)}:host(.in-segment-color) .segment-button-indicator-background{background:var(--ion-color-step-350, var(--ion-background-color, #fff))}@media (any-hover: hover){:host(.in-segment-color:hover) .button-native,:host(.in-segment-color.segment-button-checked:hover) .button-native{color:var(--ion-text-color, #000)}}:host(.in-toolbar:not(.in-segment-color)){--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, var(--ion-toolbar-color), initial);--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-toolbar-color), initial);--indicator-color:var(--ion-toolbar-segment-indicator-color, var(--ion-color-step-350, var(--ion-background-color, #fff)))}:host(.in-toolbar-color) .segment-button-indicator-background{background:#fff}:host(.in-toolbar-color:not(.in-segment-color)) .button-native{color:var(--ion-color-contrast)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native{color:var(--ion-color-base)}@media (any-hover: hover){:host(.in-toolbar-color:not(.in-segment-color):hover) .button-native{color:var(--ion-color-contrast)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color):hover) .button-native{color:var(--ion-color-base)}}',md:':host{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:flex;position:relative;flex:1 1 auto;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;font-kerning:none;cursor:pointer}.button-native{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:var(--margin-start);margin-right:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);transform:translate3d(0, 0, 0);display:flex;position:relative;flex-direction:inherit;flex-grow:1;align-items:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end)}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.button-inner{display:flex;position:relative;flex-flow:inherit;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.segment-button-checked){background:var(--background-checked);color:var(--color-checked)}:host(.segment-button-disabled){cursor:default;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}:host(:focus){outline:none}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.segment-button-checked:hover) .button-native{color:var(--color-checked)}}::slotted(ion-icon){flex-shrink:0;order:-1;pointer-events:none}::slotted(ion-label){display:block;align-self:center;line-height:22px;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;pointer-events:none}:host(.segment-button-layout-icon-top) .button-native{flex-direction:column}:host(.segment-button-layout-icon-start) .button-native{flex-direction:row}:host(.segment-button-layout-icon-end) .button-native{flex-direction:row-reverse}:host(.segment-button-layout-icon-bottom) .button-native{flex-direction:column-reverse}:host(.segment-button-layout-icon-hide) ::slotted(ion-icon){display:none}:host(.segment-button-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color, var(--color-checked))}.segment-button-indicator{transform-origin:left;position:absolute;opacity:0;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}.segment-button-indicator-background{width:100%;height:var(--indicator-height);transform:var(--indicator-transform);box-shadow:var(--indicator-box-shadow);pointer-events:none}.segment-button-indicator-animated{transition:var(--indicator-transition)}:host(.segment-button-checked) .segment-button-indicator{opacity:1}@media (prefers-reduced-motion: reduce){.segment-button-indicator-background{transform:none}.segment-button-indicator-animated{transition:none}}:host{--background:none;--background-checked:none;--background-hover:var(--color-checked);--background-focused:var(--color-checked);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--color-checked:var(--ion-color-primary, #3880ff);--indicator-box-shadow:none;--indicator-color:var(--color-checked);--indicator-height:2px;--indicator-transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--padding-top:0;--padding-end:16px;--padding-bottom:0;--padding-start:16px;--transition:color 0.15s linear 0s, opacity 0.15s linear 0s;min-width:90px;max-width:360px;min-height:48px;border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);font-size:14px;font-weight:500;letter-spacing:0.06em;line-height:40px;text-transform:uppercase}:host(.segment-button-disabled){opacity:0.3}:host(.in-segment-color){background:none;color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}:host(.in-segment-color) ion-ripple-effect{color:var(--ion-color-base)}:host(.in-segment-color) .segment-button-indicator-background{background:var(--ion-color-base)}:host(.in-segment-color.segment-button-checked) .button-native{color:var(--ion-color-base)}:host(.in-segment-color.ion-focused) .button-native::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.in-segment-color:hover) .button-native{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}:host(.in-segment-color:hover) .button-native::after{background:var(--ion-color-base)}:host(.in-segment-color.segment-button-checked:hover) .button-native{color:var(--ion-color-base)}}:host(.in-toolbar:not(.in-segment-color)){--background:var(--ion-toolbar-segment-background, none);--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6));--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-color-primary, #3880ff));--indicator-color:var(--ion-toolbar-segment-color-checked, var(--color-checked))}:host(.in-toolbar-color:not(.in-segment-color)) .button-native{color:rgba(var(--ion-color-contrast-rgb), 0.6)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native{color:var(--ion-color-contrast)}@media (any-hover: hover){:host(.in-toolbar-color:not(.in-segment-color)) .button-native::after{background:var(--ion-color-contrast)}}::slotted(ion-icon){margin-top:12px;margin-bottom:12px;font-size:24px}::slotted(ion-label){margin-top:12px;margin-bottom:12px}:host(.segment-button-layout-icon-top) ::slotted(ion-label),:host(.segment-button-layout-icon-bottom) ::slotted(ion-icon){margin-top:0}:host(.segment-button-layout-icon-top) ::slotted(ion-icon),:host(.segment-button-layout-icon-bottom) ::slotted(ion-label){margin-bottom:0}:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:8px;margin-right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:0;margin-inline-end:0}}:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:0;margin-right:8px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}:host(.segment-button-has-icon-only) ::slotted(ion-icon){margin-top:12px;margin-bottom:12px}:host(.segment-button-has-label-only) ::slotted(ion-label){margin-top:12px;margin-bottom:12px}.segment-button-indicator{left:0;right:0;bottom:0}.segment-button-indicator-background{background:var(--indicator-color)}:host(.in-toolbar:not(.in-segment-color)) .segment-button-indicator-background{background:var(--ion-toolbar-segment-indicator-color, var(--indicator-color))}:host(.in-toolbar-color:not(.in-segment-color)) .segment-button-indicator-background{background:var(--ion-color-contrast)}'};const J=class{constructor(i){t(this,i),this.animated=!1}render(){const t=this.animated&&a.getBoolean("animated",!0),i=v("ion-avatar",this.el)||v("ion-thumbnail",this.el),e=r(this);return o(n,{class:{[e]:!0,"skeleton-text-animated":t,"in-media":i}},o("span",null," "))}get el(){return l(this)}};J.style=":host{--background:rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065);border-radius:var(--border-radius, inherit);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--background);line-height:10px;user-select:none;pointer-events:none}span{display:inline-block}:host(.in-media){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;height:100%}:host(.skeleton-text-animated){position:relative;background:linear-gradient(to right, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135) 18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 33%);background-size:800px 104px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer;animation-timing-function:linear}@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}";const W={en:{amen:"Amen.",book:"Book",chapter:"Chapter",citation:"Citation (e.g., John 1:1)",label:"Label",loading:"Loading...",verse:"Verse",changeReading:"Change Reading",newCitation:"Biblical citation.",cancel:"Cancel",ok:"OK"},es:{amen:"Amen.",book:"Book",chapter:"Chapter",citation:"Citation (e.g., John 1:1)",label:"Label",loading:"Loading...",verse:"Verse",changeReading:"Change Reading",newCitation:"Biblical citation.",cancel:"Cancel",ok:"OK"}},P=class{constructor(e){t(this,e),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7)}docChanged(t){try{this.obj=new w("string"==typeof t?JSON.parse(t):t),this.processIntro()}catch(t){console.warn(t),this.obj=new w}this.loadVerses()}async componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings(),this.loadVerses(),this.processIntro()}processIntro(){var t,i;if(null===(i=null===(t=this.obj)||void 0===t?void 0:t.metadata)||void 0===i?void 0:i.intro)try{this.obj.compileIntro(),this.obj=new w(Object.assign({},this.obj))}catch(t){console.warn(t),console.warn(this.obj)}}async loadLocaleStrings(){try{this.localeStrings=W[T(this.element)]}catch(t){console.warn(t)}}async changeReading(){var t;const i=this.localeStrings||{},e=await b.create({header:i.changeReading,inputs:[{name:"citation",type:"text",value:null===(t=this.obj)||void 0===t?void 0:t.citation,placeholder:i.newCitation}],buttons:[{text:i.cancel,role:"cancel",cssClass:"secondary"},{text:i.ok,handler:async t=>{var e,o,n;this.ldfDocShouldChange.emit(new N({path:this.path,op:[{type:"set",index:"citation",oldValue:null===(e=this.obj)||void 0===e?void 0:e.citation,value:null==t?void 0:t.citation}]}));const l=await f.create({message:i.loading});await l.present();const s=await async function(t,i="NRSV",e="https://us-central1-venite-2.cloudfunctions.net"){const o=new URL(`${e}/bible`);o.searchParams.append("citation",t),["NRSV","NRSVAE","ESV","CEB","KJV"].includes(i)?o.searchParams.append("version",i):o.searchParams.append("version","NRSV");const n=await fetch(o.toString()),l=await n.text();try{return JSON.parse(l)}catch(t){throw new Error(l)}}(t.citation,_(null===(o=this.obj)||void 0===o?void 0:o.version));await l.dismiss(),this.ldfDocShouldChange.emit(new N({path:this.path,op:[{type:"set",index:"value",oldValue:null===(n=this.obj)||void 0===n?void 0:n.value,value:(null==s?void 0:s.value)||[]}]})),this.obj=new w(Object.assign(Object.assign({},this.obj),{citation:null==t?void 0:t.citation,value:(null==s?void 0:s.value)||[]})),this.loadVerses()}}]});await e.present()}loadVerses(){this.verses=this.obj.value||[]}paragraphs(){const t=new Array;let i=new Array;return this.verses.forEach((e=>{e.hasOwnProperty("type")&&"heading"===e.type?(t.push(i),i=new Array):i.push(e)})),t.push(i),t}render(){var t,i,e,l,s,a,r,d,c,h,u,p,v,b,f,g,m,y,x,k,w,$,C,S;const j=this.localeStrings||{};if(this.verses){if(this.editable){const n=Object.assign(Object.assign({},this.verses[0]),{text:""}),r=t=>Object.assign(Object.assign({},n),{text:t});return o("div",{lang:null===(t=this.obj)||void 0===t?void 0:t.language,class:`editable bible-reading ${(null===(i=this.obj)||void 0===i?void 0:i.display_format)||"default"}`},this.editable&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"},o("ion-buttons",null,o("ion-button",{onClick:()=>this.changeReading()},o("ion-icon",{name:"swap-horizontal",slot:"start"}),o("ion-label",null,j.changeReading))))),o("ldf-label-bar",null,o("h3",{class:"editable-label",slot:"start"},o("ldf-editable-text",{id:"label",text:null===(e=this.obj)||void 0===e?void 0:e.label,path:`${this.path}/label`,placeholder:j.label})),(null===(l=this.obj)||void 0===l?void 0:l.citation)&&o("button",{class:"citation-button",slot:"end",onClick:()=>this.changeReading()},this.obj.citation)),(null===(a=null===(s=this.obj)||void 0===s?void 0:s.metadata)||void 0===a?void 0:a.compiled_intro)&&o("ldf-liturgical-document",{editable:!0,doc:this.obj.metadata.intro,path:`${this.path}/metadata/intro`}),o("section",{class:"verses"},this.verses.map(((t,i)=>[t.hasOwnProperty("type")&&"heading"===t.type?o("ldf-heading",{editable:!0,doc:t,path:`${this.path}/value/${i}`}):o("div",{class:"editable-verse"},o("div",{class:"editable-citation"},o("ldf-editable-text",{class:"book",id:`verse-${i}-book`,text:t.book,path:`${this.path}/value/${i}/book`,placeholder:j.book,short:!0}),o("ldf-editable-text",{id:`verse-${i}-chapter`,text:t.chapter,path:`${this.path}/value/${i}/chapter`,placeholder:j.chapter,short:!0})," :",o("ldf-editable-text",{id:`verse-${i}-verse`,text:t.verse,path:`${this.path}/value/${i}/verse`,placeholder:j.verse,short:!0})),o("ldf-editable-text",{id:`verse-${i}-text`,text:t.text,path:`${this.path}/value/${i}/text`,placeholder:j.text,short:!1,template:n,templateMaker:r}))]))))}if("short"==this.obj.style){const t=(null===(c=(null===(d=null===(r=this.obj)||void 0===r?void 0:r.metadata)||void 0===d?void 0:d.response)||(null==j?void 0:j.amen))||void 0===c?void 0:c.length)<=5;let i;return i=(null===(u=null===(h=this.obj)||void 0===h?void 0:h.metadata)||void 0===u?void 0:u.response)?o("span",{class:"response"}," ",null===(v=null===(p=this.obj)||void 0===p?void 0:p.metadata)||void 0===v?void 0:v.response):o("span",{class:"response"}," ",null==j?void 0:j.amen),o(n,null,(null===(b=this.obj)||void 0===b?void 0:b.label)&&o("ldf-heading",{doc:new z({type:"heading",metadata:{level:3},value:[this.obj.label]})}),o("div",{lang:null===(f=this.obj)||void 0===f?void 0:f.language,class:`bible-reading ${(null===(g=this.obj)||void 0===g?void 0:g.display_format)||"default"}`},o("p",null,this.verses.map(((t,i)=>{var e,n;return t.hasOwnProperty("type")&&"heading"===t.type?o("ldf-heading",{doc:new z(t)}):o("ldf-string",{citation:{book:t.book,chapter:t.chapter,verse:t.verse},id:this.obj.uid,text:t.text,fragment:this.path,dropcap:M(null===(e=this.obj)||void 0===e?void 0:e.language,null===(n=this.obj)||void 0===n?void 0:n.display_format,i)})})),t&&!(null===(y=null===(m=this.obj)||void 0===m?void 0:m.metadata)||void 0===y?void 0:y.omit_response)&&i,o("span",{class:"citation"},this.obj.citation)),!t&&!(null===(k=null===(x=this.obj)||void 0===x?void 0:x.metadata)||void 0===k?void 0:k.omit_response)&&o("p",null,i)))}{const t=this.paragraphs();return o("div",{lang:null===(w=this.obj)||void 0===w?void 0:w.language,class:`bible-reading ${(null===($=this.obj)||void 0===$?void 0:$.display_format)||"default"}`},o("ldf-heading",{doc:new z({type:"heading",metadata:{level:3},value:[this.obj.label],citation:this.obj.citation})}),(null===(S=null===(C=this.obj)||void 0===C?void 0:C.metadata)||void 0===S?void 0:S.compiled_intro)&&o("ldf-liturgical-document",{doc:this.obj.metadata.compiled_intro}),t.map(((t,i)=>o("p",{lang:this.obj.language},t.map(((t,e)=>{var n,l;return t.hasOwnProperty("type")&&"heading"===t.type?o("ldf-heading",{doc:new z(t)}):[o("sup",null,t.verse),o("ldf-string",{citation:t,dropcap:M(null===(n=this.obj)||void 0===n?void 0:n.language,null===(l=this.obj)||void 0===l?void 0:l.display_format,i+e),id:`${t.chapter}-${t.book}-${t.verse}`,text:t.text,index:e,fragment:this.path})]}))))))}}return this.loadingError?o("pre",null,this.loadingError):o("p",null,j.loading)}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};P.style='ldf-bible-reading.sc-ldf-bible-reading,.sc-ldf-bible-reading-h{font-family:var(--ldf-font-face);text-align:var(--ldf-text-align)}.bible-reading[lang=he].sc-ldf-bible-reading{text-align:right;direction:rtl;font-size:1.5em;font-family:"Times New Roman" !important}.bible-reading[lang=he].sc-ldf-bible-reading .drop.sc-ldf-bible-reading{float:right !important;font-family:"Times New Roman" !important}.bible-reading.omit.sc-ldf-bible-reading .verses.sc-ldf-bible-reading{display:none}.editable.bible-reading.sc-ldf-bible-reading .verses.sc-ldf-bible-reading{display:block;color:var(--ldf-greyed-out-text-color)}sup.sc-ldf-bible-reading{display:var(--ldf-bible-reading-verse-number-display);margin-left:0;margin-right:0.25em}.citation.sc-ldf-bible-reading{font-size:80%;font-style:italic;margin-left:1em;float:var(--ldf-bible-reading-citation-float)}.response.sc-ldf-bible-reading{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.verses.sc-ldf-bible-reading .verse.sc-ldf-bible-reading{display:flex;flex-direction:row}sup.sc-ldf-bible-reading:first-of-type{display:var(--ldf-drop-early-verses-display)}.editable-verse.sc-ldf-bible-reading{display:inline}.editable-citation.sc-ldf-bible-reading{display:inline;width:100%}.editable-citation.sc-ldf-bible-reading ldf-editable-text.sc-ldf-bible-reading{display:inline-block;width:25px}.editable-citation.sc-ldf-bible-reading ldf-editable-text.book.sc-ldf-bible-reading{width:75px}h3.editable-label.sc-ldf-bible-reading{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}.citation-button.sc-ldf-bible-reading{background:none;border:0;font-family:var(--ldf-font-face);font-size:inherit}';const H={en:{add:"Add",label:"Label",citation:"Citation"}},F=class{constructor(e){t(this,e),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.ldfDocShouldAdd=i(this,"ldfDocShouldAdd",7)}async componentWillLoad(){this.loadLocaleStrings()}async loadLocaleStrings(){try{this.localeStrings=H[T(this.element)]}catch(t){console.warn(t)}}render(){const t=this.localeStrings||{};return o(n,null,o("div",{class:{button:!0,hidden:!this.visible}},o("ion-button",{"aria-role":"button",fill:"outline",onClick:()=>this.ldfDocShouldAdd.emit({base:this.base,index:this.index})},o("ion-icon",{name:"add",slot:"icon-only"}),o("ion-label",{class:"visually-hidden"},t.add))))}get element(){return l(this)}};F.style=".sc-ldf-editable-add-block-h{display:flex;flex-direction:column;align-items:center;width:100%}.sc-ldf-editable-add-block-h .button-container.sc-ldf-editable-add-block{display:flex;align-items:center;height:0;justify-content:center;width:100%}.sc-ldf-editable-add-block-h button.sc-ldf-editable-add-block{background-color:var(--ldf-background-color);color:var(--ldf-color);font-family:var(--ldf-controls-font-family);font-weight:lighter}.sc-ldf-editable-add-block-h button.sc-ldf-editable-add-block:hover{cursor:pointer}.sc-ldf-editable-add-block-h .visible.sc-ldf-editable-add-block{height:0;opacity:1;transition:0.25s}.sc-ldf-editable-add-block-h .hidden.sc-ldf-editable-add-block{height:0;opacity:0;transition:2s}.sc-ldf-editable-add-block-h .underlying.sc-ldf-editable-add-block{width:100%;border-top:1px solid #a0a0a0;border-bottom:1px solid #a0a0a0;min-height:1em;position:relative;bottom:0.5em;z-index:-1}.sc-ldf-editable-add-block-h .underlying.visible.sc-ldf-editable-add-block{opacity:0.5;transition:0.25s}.sc-ldf-editable-add-block-h .underlying.visible.expanded.sc-ldf-editable-add-block{z-index:1}.sc-ldf-editable-add-block-h .underlying.collapsed.sc-ldf-editable-add-block{height:1em}.sc-ldf-editable-add-block-h .underlying.hidden.sc-ldf-editable-add-block{opacity:0;transition:1s}.sc-ldf-editable-add-block-h .underlying.hidden.sc-ldf-editable-add-block button.sc-ldf-editable-add-block{z-index:-1}.sc-ldf-editable-add-block-h .visually-hidden.sc-ldf-editable-add-block{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);white-space:nowrap}.button.sc-ldf-editable-add-block{position:absolute;display:flex;flex-direction:row;align-items:center;justify-content:center;opacity:1;transition:all 0.25s}.hidden.sc-ldf-editable-add-block{display:none;height:0;opacity:0;transition:all 0.25s}";const G={en:{abbreviated:"Abbreviated",addOption:"Add an Option",cancel:"Cancel",condition:"Conditions",copy:"Copy",copied:"Copied to Clipboard",default:"Default",displayFormat:"Display",halfverse:"By Half Verse",heading:"Heading Level",heading1:"1. Title",heading2:"2. Section Title",heading3:"3. Label",heading4:"4. Sub-Section Label",move_down:"Move Down",move_up:"Move Up",ok:"OK",omit:"Omit",preferences:"Preferences",settings:"Settings",edit:"Edit",preview:"Preview",responsive:"Responsive Display Settings",responsiveMsg:"What size devices should this appear on?",responsiveAll:"All devices",responsiveSmallOnly:"Only on small screens",responsiveSmallHidden:"Not on small screens",unison:"Unison",wholeverse:"By Whole Verse"}},K=class{constructor(e){t(this,e),this.ldfAddOptionToDoc=i(this,"ldfAddOptionToDoc",7),this.ldfTogglePreview=i(this,"ldfTogglePreview",7),this.ldfDocShouldMove=i(this,"ldfDocShouldMove",7),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.preview=!1}objChange(t){this.modal&&(this.modal.componentProps=Object.assign(Object.assign({},this.modal.componentProps),{obj:t}))}componentWillLoad(){this.loadLocaleStrings()}async loadLocaleStrings(){try{this.localeStrings=G[T(this.element)]}catch(t){console.warn(t)}}async openResponsive(){var t;const i=await b.create({header:this.localeStrings.responsive,message:this.localeStrings.responsiveMsg,inputs:[{name:"value",type:"radio",value:x.AllSizes,label:this.localeStrings.responsiveAll},{name:"value",type:"radio",value:x.SmallOnly,label:this.localeStrings.responsiveSmallOnly},{name:"value",type:"radio",value:x.SmallHidden,label:this.localeStrings.responsiveSmallHidden}],buttons:[{role:"cancel",text:this.localeStrings.cancel},this.localeStrings.ok]});await i.present();const{data:e}=await i.onDidDismiss(),{values:o}=e;o&&this.ldfDocShouldChange.emit(new N({path:`${this.base}/${this.index}/responsive`,op:[{type:"set",oldValue:null===(t=this.obj)||void 0===t?void 0:t.responsive,value:o}]}))}async openSettings(){this.modal=await this.openModal("ldf-editable-metadata")}async openCondition(){this.modal=await this.openModal("ldf-editable-condition",`${this.base}/${this.index}/condition`,{obj:this.obj})}async openPreferences(){const t=this.base&&this.index?`${this.base}/${this.index}`:"";this.modal=await this.openModal("ldf-editable-preferences",`${t}/metadata`,{obj:this.obj})}async openModal(t,i,e){const o=await g.create({component:t}),n=i||(this.base&&this.index>=0?`${this.base}/${this.index}`:"/");return o.componentProps=Object.assign(Object.assign({},e),{modal:o,doc:this.obj,path:n,visible:!0,collapsed:!1}),await o.present(),o}addOption(){this.ldfAddOptionToDoc.emit({base:this.base,index:this.index,obj:this.obj})}move(t){this.ldfDocShouldMove.emit({base:this.base,oldIndex:this.index,diff:t})}async headingLevel(){var t,i,e,o,n,l,s,a,r,d;const c=await b.create({header:null===(t=this.localeStrings)||void 0===t?void 0:t.heading,inputs:[{name:"level",type:"radio",value:1,label:null===(i=this.localeStrings)||void 0===i?void 0:i.heading1},{name:"level",type:"radio",value:2,label:null===(e=this.localeStrings)||void 0===e?void 0:e.heading2},{name:"level",type:"radio",value:3,label:null===(o=this.localeStrings)||void 0===o?void 0:o.heading3},{name:"level",type:"radio",value:4,label:null===(n=this.localeStrings)||void 0===n?void 0:n.heading4}],buttons:[{text:null===(l=this.localeStrings)||void 0===l?void 0:l.cancel,role:"cancel",cssClass:"secondary"},{text:null===(s=this.localeStrings)||void 0===s?void 0:s.ok}]});await c.present();const{data:h}=await c.onDidDismiss(),{values:u}=h;(null===(a=this.obj)||void 0===a?void 0:a.metadata)?this.ldfDocShouldChange.emit(new N({path:`${this.base}/${this.index}/metadata/level`,op:[{type:"set",value:u,oldValue:null===(d=null===(r=this.obj)||void 0===r?void 0:r.metadata)||void 0===d?void 0:d.level}]})):this.ldfDocShouldChange.emit(new N({path:`${this.base}/${this.index}/metadata`,op:[{type:"set",value:{level:u}}]}))}async copyDoc(){try{navigator.clipboard.writeText(JSON.stringify(this.obj));const t=await m.create({message:this.localeStrings.copied,duration:1e3,color:"success"});await t.present()}catch(t){console.warn("Clipboard operation not allowed.",t)}}render(){var t,i,e,l,s,a,r,d,c,h,u;const p=this.localeStrings||{},v=void 0!==this.index&&this.index>=0;return o(n,null,o("div",{class:{buttons:!0,hidden:!this.visible||!this.preview}},o("ion-buttons",{slot:"end"},(null===navigator||void 0===navigator?void 0:navigator.clipboard)&&o("ion-button",{onClick:()=>this.copyDoc(),"aria-role":"button","aria-label":p.copy},o("ion-label",{class:"sm-hidden"},p.copy),o("ion-icon",{slot:"end",name:"clipboard"})),o("ion-button",{onClick:()=>this.ldfTogglePreview.emit(!1)},o("ion-label",{class:"sm-hidden"},null===(t=this.localeStrings)||void 0===t?void 0:t.edit),o("ion-icon",{slot:"end",name:"create"})))),o("div",{class:{buttons:!0,hidden:!this.visible||this.preview}},o("ion-buttons",{slot:"end"},o("ion-button",{onClick:()=>this.ldfTogglePreview.emit(!0)},o("ion-label",{class:"sm-hidden"},null===(i=this.localeStrings)||void 0===i?void 0:i.preview),o("ion-icon",{slot:"end",name:"eye"})),"option"!==(null===(e=this.obj)||void 0===e?void 0:e.type)&&"option"!==this.parentType&&this.base&&o("ion-button",{onClick:()=>this.addOption(),"aria-role":"button","aria-label":p.addOption},o("ion-icon",{slot:"icon-only",name:"add"})),"liturgy"==(null===(l=this.obj)||void 0===l?void 0:l.type)&&o("ion-button",{onClick:()=>this.openPreferences(),"aria-role":"button","aria-label":p.preferences},o("ion-icon",{slot:"icon-only",name:"list"})),"heading"==(null===(s=this.obj)||void 0===s?void 0:s.type)&&o("ion-button",{onClick:()=>this.headingLevel()},o("ion-label",null,p[`heading${(null===(r=null===(a=this.obj)||void 0===a?void 0:a.metadata)||void 0===r?void 0:r.level)||3}`]||"Heading")),(null===(c=null===(d=this.obj)||void 0===d?void 0:d.availableDisplayFormats())||void 0===c?void 0:c.length)>0&&o("ldf-editable-select",{placeholder:p.displayFormat,value:this.obj.display_format,path:`${this.base}/${this.index}`,property:"display_format",options:this.obj.availableDisplayFormats().map((t=>({value:t,label:p[t]||t})))}),(this.base&&v||"liturgy"!==(null===(h=this.obj)||void 0===h?void 0:h.type))&&o("ion-button",{onClick:()=>this.openCondition(),"aria-role":"button","aria-label":p.condition},o("ion-icon",{slot:"icon-only",name:"calendar"})),(this.base&&v||"liturgy"!==(null===(u=this.obj)||void 0===u?void 0:u.type))&&o("ion-button",{onClick:()=>this.openResponsive(),"aria-role":"button","aria-label":p.responsive},o("ion-icon",{slot:"icon-only",name:"phone-portrait"})),(null===navigator||void 0===navigator?void 0:navigator.clipboard)&&o("ion-button",{onClick:()=>this.copyDoc(),"aria-role":"button","aria-label":p.copy},o("ion-icon",{slot:"icon-only",name:"clipboard"})),o("ion-button",{onClick:()=>this.openSettings(),"aria-role":"button","aria-label":p.settings},o("ion-icon",{slot:"icon-only",name:"cog"})),this.base&&v&&this.index>0&&o("ion-button",{onClick:()=>this.move(-1),"aria-role":"button","aria-label":p.move_up},o("ion-icon",{slot:"icon-only",name:"arrow-up"})),this.base&&v&&o("ion-button",{onClick:()=>this.move(1),"aria-role":"button","aria-label":p.move_down},o("ion-icon",{slot:"icon-only",name:"arrow-down"})),v&&o("ldf-editable-delete",{base:this.base,index:this.index,obj:this.obj}))))}get element(){return l(this)}static get watchers(){return{obj:["objChange"]}}};K.style=".buttons.sc-ldf-editable-metadata-buttons{position:absolute;height:0;width:100%;display:flex;flex-direction:row;align-items:center;justify-content:flex-end;opacity:1;transition:all 0.25s}.buttons.sc-ldf-editable-metadata-buttons ion-buttons.sc-ldf-editable-metadata-buttons{background-color:var(--ion-color-light, #f4f5f8);border-radius:3px;flex-wrap:wrap;max-width:100%}.hidden.sc-ldf-editable-metadata-buttons{display:none;height:0;opacity:0;transition:all 0.25s}@media (max-width: 767px){.sm-hidden.sc-ldf-editable-metadata-buttons{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}";const U=class{constructor(e){t(this,e),this.ldfChange=i(this,"ldfChange",7),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7)}onChange(t){const i=this.value,e=t.detail.value;e!==i&&(this.ldfDocShouldChange.emit(new N({path:this.path,op:[{type:"set",index:this.property,oldValue:i,value:e}]})),this.ldfChange.emit(e))}render(){return o("ion-select",{value:this.value,placeholder:this.placeholder},this.options.map((t=>o("ion-select-option",{value:t.value},t.label))))}get element(){return l(this)}};U.style="";const X={en:{close:"Return to Bulletin",url:"URL"}},q=class{constructor(e){t(this,e),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.isResizing=!1,this.resizingStartPoint=null,this.resizingCorner=null}docChanged(t){var i,e,o,n;try{this.obj=new D("string"==typeof t?JSON.parse(t):t),this.height=(null===(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)||void 0===e?void 0:e.height)||null,this.width=(null===(n=null===(o=this.obj)||void 0===o?void 0:o.metadata)||void 0===n?void 0:n.width)||null}catch(t){console.warn(t),this.obj=new D}}componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings()}async loadLocaleStrings(){try{this.localeStrings=X[T(this.element)]}catch(t){console.warn(t)}}async showZoomed(){const t=await g.create({component:"ldf-image"});t.componentProps={modal:t,doc:this.obj},await t.present()}startResizing(t,i,e){this.resizingCorner=t,this.resizingStartPoint={x:i,y:e}}stopResizing(){console.log("stopResizing"),this.resizingCorner=null}resizingMove(t){this.resizingCorner&&this.resizingStartPoint&&this.processResizingMove(this.resizingCorner,t.clientX,t.clientY)}processResizingMove(t,i,e){const{x:o}=this.resizingStartPoint,n="nw"===t||"sw"===t?i-o:o-i;this.resizingStartPoint={x:i,y:e},this.width=this.imgElement.clientWidth-n,this.height=null,this.updateDoc()}touchStart(t,i){i.preventDefault();const e=i.touches[0];e&&this.startResizing(t,e.clientX,e.clientY)}touchMove(t,i){i.preventDefault();const e=i.touches[0];e&&this.processResizingMove(t,e.clientX,e.clientY)}updateDoc(){var t,i,e,o,n,l;(null===(t=this.obj)||void 0===t?void 0:t.metadata)||this.ldfDocShouldChange.emit(new N({path:this.path,op:[{type:"set",index:"metadata",oldValue:null===(i=this.obj)||void 0===i?void 0:i.metadata,value:{}}]})),this.ldfDocShouldChange.emit(new N({path:`${this.path}/metadata`,op:[{type:"set",index:"height",oldValue:null===(o=null===(e=this.obj)||void 0===e?void 0:e.metadata)||void 0===o?void 0:o.height,value:this.imgElement.clientHeight},{type:"set",index:"width",oldValue:null===(l=null===(n=this.obj)||void 0===n?void 0:n.metadata)||void 0===l?void 0:l.width,value:this.imgElement.clientWidth}]}))}render(){var t,i,e,l,s;const a=this.localeStrings||{},r=[this.editable&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"})),o("div",{class:`${(null===(t=this.obj)||void 0===t?void 0:t.style)||""} ${(null===(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)||void 0===e?void 0:e.align)||"center"}`},this.obj.value&&this.obj.value.map(((t,i)=>{var e;return this.editable?o("figure",null,o("div",{class:"img-wrapper"},o("img",{src:t,ref:t=>this.imgElement=t,alt:null===(e=this.obj)||void 0===e?void 0:e.label,style:{height:this.height?`${this.height}px`:"auto",width:this.width?`${this.width}px`:"auto"},class:"editable"}),o("button",{class:"resize top-left",onMouseDown:t=>this.startResizing("nw",t.clientX,t.clientY),onTouchStart:t=>this.touchStart("nw",t),onTouchMove:t=>this.touchMove("nw",t),onTouchEnd:()=>this.stopResizing()}),o("button",{class:"resize bottom-left",onMouseDown:t=>this.startResizing("sw",t.clientX,t.clientY),onTouchStart:t=>this.touchStart("sw",t),onTouchMove:t=>this.touchMove("sw",t),onTouchEnd:()=>this.stopResizing()}),o("button",{class:"resize top-right",onMouseDown:t=>this.startResizing("ne",t.clientX,t.clientY),onTouchStart:t=>this.touchStart("ne",t),onTouchMove:t=>this.touchMove("ne",t),onTouchEnd:()=>this.stopResizing()}),o("button",{class:"resize bottom-right",onMouseDown:t=>this.startResizing("se",t.clientX,t.clientY),onTouchStart:t=>this.touchStart("se",t),onTouchMove:t=>this.touchMove("se",t),onTouchEnd:()=>this.stopResizing()})),o("figcaption",null,o("code",null,a.url),o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}`,text:t,path:`${this.path}/value/${i}`}))):o("img",{src:t,onClick:()=>this.showZoomed(),style:{height:this.height?`${this.height}px`:"auto",width:this.width?`${this.width}px`:"auto"}})})))];return this.modal?[o("ion-header",null,o("ion-toolbar",null,o("ion-buttons",{slot:"end"},o("ion-button",{onClick:()=>this.modal.dismiss()},o("ion-label",{slot:"start"},a.close),o("ion-icon",{slot:"end",name:"close"}))))),o("ion-content",{class:"ion-padding",scrollX:!0,lang:null===(s=this.obj)||void 0===s?void 0:s.language},r)]:o(n,{lang:null===(l=this.obj)||void 0===l?void 0:l.language},r)}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};(function(t,i,e,o){var n,l=arguments.length,s=l<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,i,e,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(l<3?n(s):l>3?n(i,e,s):n(i,e))||s);l>3&&s&&Object.defineProperty(i,e,s)})([R(250)],q.prototype,"updateDoc",null),q.style="img.sc-ldf-image{height:auto;max-width:100%;z-index:1}figcaption.sc-ldf-image{background-color:var(--ldf-editable-lookup-background-color);border-radius:4px;color:var(--ldf-editable-lookup-color);display:block;margin:auto;text-align:center}.left.sc-ldf-image{text-align:left}.center.sc-ldf-image{text-align:center}.right.sc-ldf-image{text-align:right}.img-wrapper.sc-ldf-image{margin:0;padding:12px;display:inline-block;position:relative}img.editable.sc-ldf-image{border:3px solid var(--ldf-color)}button.resize.sc-ldf-image{height:30px;width:30px;margin:0;padding:0;background-color:var(--ldf-editable-lookup-background-color);border-radius:50%;border:3px solid var(--ldf-color)}.resize.top-left.sc-ldf-image{position:absolute;left:0;top:-3px;cursor:nwse-resize}.resize.bottom-left.sc-ldf-image{position:absolute;left:-3px;bottom:0;cursor:nesw-resize}.resize.top-right.sc-ldf-image{position:absolute;right:-6px;top:-3px;cursor:nesw-resize}.resize.bottom-right.sc-ldf-image{position:absolute;right:-6px;bottom:0;cursor:nwse-resize}";const Z=({doc:t,localeStrings:i},e)=>o("div",{class:"condition"},o("p",null,i.condition,o("code",null,i[t.condition.mode]),i.of_the_following),o("ul",null,t.condition.conditions.map((t=>o(Q,{condition:t,localeStrings:i})))),e),Q=({condition:t,localeStrings:i})=>{let e=[];return t.day&&(e=e.concat(o(Y,{condition:t,field:"day",localeStrings:i}))),t.season&&(e=e.concat(o(Y,{condition:t,field:"season",localeStrings:i}))),t.week&&(e=e.concat(o(Y,{condition:t,field:"week",localeStrings:i}))),t.weekday&&(e=e.concat(o(Y,{condition:t,field:"weekday",localeStrings:i}))),t.day_of_month&&e.push([i.day_of_month_1,(n=Number(t.day_of_month),l=n%10,s=n%100,1==l&&11!=s?n+"st":2==l&&12!=s?n+"nd":3==l&&13!=s?n+"rd":n+"th"),i.day_of_month_2]),t.hasOwnProperty("feastDay")&&e.push([i.the_day,t.feastDay?i.is:i.is_not,i.feastDay]),t.preference&&e.push([i.the_preference,o("code",null,t.preference.key),t.preference.is?i.is:i.is_not,o("code",null,t.preference.value)]),t.date&&e.push([i.the_date,t.date.lt&&`${i.lt} ${t.date.lt}`,t.date.lte&&`${i.lte} ${t.date.lte}`,t.date.gte&&`${i.gte} ${t.date.gte}`,t.date.gt&&`${i.gt} ${t.date.gt}`]),e.map((t=>o("li",null,t)));var n,l,s},Y=({condition:t,field:i,localeStrings:e})=>{var o,n;const l=[];return(null===(o=t[i].except)||void 0===o?void 0:o.length)>0&&l.push([e[i],e.is,t[i].except.length>1?e.except:e.except_1,t[i].except.join(", ")]),(null===(n=t[i].only)||void 0===n?void 0:n.length)>0&&l.push([e[i],e.is,t[i].only.length>1?e.only:e.only_1,t[i].only.join(", ")]),l};const tt=(t,i)=>"object"==typeof t?o("span",null,i.definedByPreference," ",o("code",null,t.preference)):o("code",null,t),it=({doc:t,localeStrings:i})=>{var e,n,l,s,a,r,d,c,h,u,p,v,b,f,g,m,y,x,k,w,$,C,S,j,O,z,_,L,N;let T;if(t.lookup)switch(null===(e=t.lookup)||void 0===e?void 0:e.type){case"lectionary":T=[i.lectionaryReading,tt(null===(n=t.lookup)||void 0===n?void 0:n.item,i),i.fromLectionary,tt(null===(l=t.lookup)||void 0===l?void 0:l.table,i),"."];break;case"canticle":T=[i[`canticle-${null===(s=t.lookup)||void 0===s?void 0:s.item}`],i.fromCanticleTable,tt(null===(a=t.lookup)||void 0===a?void 0:a.table,i),"."];break;case"category":T=[i.category,t.category.map((t=>o("code",null,t))),(null===(r=t.lookup)||void 0===r?void 0:r.filter)&&"seasonal"==(null===(d=t.lookup)||void 0===d?void 0:d.filter)&&i["filter-seasonal"],(null===(c=t.lookup)||void 0===c?void 0:c.filter)&&"evening"==(null===(h=t.lookup)||void 0===h?void 0:h.filter)&&i[`filter-evening-${(null===(u=t.lookup)||void 0===u?void 0:u.item)||!0}`],(null===(p=t.lookup)||void 0===p?void 0:p.filter)&&"day"==(null===(v=t.lookup)||void 0===v?void 0:v.filter)&&i["filter-day"],(null===(b=t.lookup)||void 0===b?void 0:b.filter)&&"day"==(null===(f=t.lookup)||void 0===f?void 0:f.filter)&&o("code",null,null===(g=t.lookup)||void 0===g?void 0:g.item),(null===(m=t.lookup)||void 0===m?void 0:m.hasOwnProperty("rotate"))&&i[`rotate-${null===(y=t.lookup)||void 0===y?void 0:y.rotate}`],"."];break;case"slug":T=[i.slug,o("code",null,t.slug),(null===(x=t.lookup)||void 0===x?void 0:x.filter)&&"seasonal"==(null===(k=t.lookup)||void 0===k?void 0:k.filter)&&i["filter-seasonal"],(null===(w=t.lookup)||void 0===w?void 0:w.filter)&&"evening"==(null===($=t.lookup)||void 0===$?void 0:$.filter)&&i[`filter-evening-${(null===(C=t.lookup)||void 0===C?void 0:C.item)||!0}`],(null===(S=t.lookup)||void 0===S?void 0:S.filter)&&"day"==(null===(j=t.lookup)||void 0===j?void 0:j.filter)&&i["filter-day"],(null===(O=t.lookup)||void 0===O?void 0:O.filter)&&"day"==(null===(z=t.lookup)||void 0===z?void 0:z.filter)&&o("code",null,null===(_=t.lookup)||void 0===_?void 0:_.item),(null===(L=t.lookup)||void 0===L?void 0:L.hasOwnProperty("rotate"))&&i[`rotate-${null===(N=t.lookup)||void 0===N?void 0:N.rotate}`],"."];break;case"collect":T=o("code",null,i.collect);break;default:T=JSON.stringify(t.lookup)}else"bible-reading"===t.type&&t.citation&&(T=[o("code",null,t.citation),i.bible_version,..."string"==typeof t.version?[o("code",null,t.version)]:[i.the_preference_specified,o("code",null,"bibleVersion")]]);return o("article",{class:"lookup"},T)},et={en:{bible_version:" in the version ","canticle-1":"The first canticle ","canticle-2":"The second canticle ",category:"All items that match the category ",collect:"The Collect of the Day.",day_of_month_1:"It is the ",day_of_month_2:" day of the month",definedByPreference:" defined by the preference ",fromCanticleTable:" from the canticle table ",fromLectionary:" from the lectionary ",lectionaryReading:"The lectionary reading ","filter-seasonal":" and the current season","filter-evening-true":" and are in the evening ","filter-evening-false":" and are not in the evening ","filter-day":" and the liturgical day ","rotate-true":" (rotating by day)","rotate-false":" (including all possibilities)",slug:"All items with the slug ",condition:"Included when ",and:"all",or:"any",the_day:" the day ",of_the_following:" of the following are true: ",day:"the liturgical day",season:"the liturgical season",week:"the liturgical week",weekday:"the day of the week",feastDay:"a Sunday or Holy Day",is:" is ",is_not:" is not ",only:" one of: ",only_1:"",except:" anything but: ",except_1:" not ",the_preference:"the preference ",the_preference_specified:"chosen in the preference ",the_date:"the date ",lte:" ≤ ",lt:" < ",gt:" > ",gte:" ≥ ",smallOnly:"Only appears on small screens",smallHidden:"Doesn't appear on small screens"}},ot=class{constructor(e){t(this,e),this.focusPath=i(this,"focusPath",7),this.focusObj=i(this,"focusObj",7),this.ldfSelectionChange=i(this,"ldfSelectionChange",7),this.hasFocus=!1,this.buttonsSelected=!1,this.interrupt=!1,this.parentType=null,this.preview=!1,this.padding=void 0}async docChanged(t){let i;try{i=new y("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),i=new y}this.obj=i||new y}onDragOver(){"/"!==this.path&&(this.hasFocus=!0,this.focusPath.emit(this.path),this.focusObj.emit({obj:this.obj,path:this.path}),console.log("dragged over",this.path))}selectionChangeHandler(t){var i,e;t.preventDefault();const o=document.getSelection(),n=o.anchorNode,l=null===(e=null===(i=null==n?void 0:n.parentElement)||void 0===i?void 0:i.closest("ldf-string"))||void 0===e?void 0:e.citation;if(this.element.contains(n)){const t=o.toString();this.ldfSelectionChange.emit({target:this.element,text:t,citation:l,fragment:this.path})}}componentWillLoad(){this.loadLocaleStrings(),this.docChanged(this.doc)}onMouseOver(){this.hasFocus=!0,this.focusPath.emit(this.path)}onMouseOut(t){const i=this.element.querySelector("div.container");t.relatedTarget==i&&setTimeout((()=>{this.hasFocus=!1,this.focusPath.emit(this.path)}),500)}onClick(){this.hasFocus=!0,this.focusPath.emit(this.path),this.focusObj.emit({obj:this.obj,path:this.path})}async loadLocaleStrings(){try{this.localeStrings=et[T(this.element)]}catch(t){console.warn(t)}}nodeFromDoc(t,i){return null==t?(null===customElements||void 0===customElements?void 0:customElements.get("ion-skeleton-text"))?o("ion-skeleton-text",null):o("p",null,"..."):this.editable||i?this.editableNode(t):this.chooseComponent(t)}editableNode(t){var i;const e=this.localeStrings||{};return(null===(i=t.value)||void 0===i?void 0:i.length)>0&&Boolean(t.value[0])?t.condition?o(Z,{doc:t,localeStrings:e},this.chooseComponent(t)):this.chooseComponent(t):t.condition&&!t.lookup?o(Z,{doc:t,localeStrings:e},this.chooseComponent(t)):t.condition&&t.lookup?o(Z,{doc:t,localeStrings:e},o(it,{doc:t,localeStrings:e})):!t.condition&&t.lookup||"bible-reading"===t.type?o(it,{doc:t,localeStrings:e}):this.chooseComponent(t)}chooseComponent(t){var i,e;let n;const l=this.editable&&!this.preview;switch(null==t?void 0:t.type){case"liturgy":n=o("ldf-liturgy",{path:this.path,editable:l,preview:this.preview,doc:t});break;case"heading":n=o("ldf-heading",{path:this.path,editable:l,doc:t});break;case"image":n=o("ldf-image",{path:this.path,editable:l,doc:t});break;case"meditation":const s=null===(e=null===(i=this.obj)||void 0===i?void 0:i.day)||void 0===e?void 0:e.color,a=(null==s?void 0:s.hasOwnProperty("hex"))?s.hex:s||"#3489eb";n=o("ldf-meditation",{path:this.path,editable:this.editable||this.preview,doc:t,color:a});break;case"option":n=o("ldf-option",{path:this.path,editable:l,preview:this.preview,doc:t});break;case"parallel":n=o("ldf-parallel",{path:this.path,editable:l,preview:this.preview,doc:t});break;case"refrain":n=o("ldf-refrain",{path:this.path,editable:l,doc:t});break;case"rubric":n=o("ldf-rubric",{path:this.path,editable:l,doc:t});break;case"text":n=o("ldf-text",{path:this.path,editable:l,doc:t});break;case"responsive":n=o("ldf-responsive-prayer",{path:this.path,editable:l,doc:t});break;case"bible-reading":n=o("ldf-bible-reading",{path:this.path,editable:l,doc:t});break;case"psalm":n=o("ldf-psalm",{path:this.path,editable:l,doc:t});break;default:console.warn("invalid type for document",t)}return n}setPreview(t){this.preview=t,this.editable=!0}render(){var t,i,e,l,s,a,r,d,c,h,u,p;const v=this.nodeFromDoc(this.obj);return v&&o(n,{lang:(null===(t=this.obj)||void 0===t?void 0:t.language)||"en"},(null===(i=this.obj)||void 0===i?void 0:i.audio)?o("audio",{controls:!0,src:this.obj.audio}):null,o("div",{class:{container:!0,editable:this.editable||this.preview,"small-only":!this.editable&&!this.preview&&void 0!==(null===(e=this.obj)||void 0===e?void 0:e.responsive)&&(null===(l=this.obj)||void 0===l?void 0:l.responsive)==x.SmallOnly,"small-hidden":!this.editable&&!this.preview&&void 0!==(null===(s=this.obj)||void 0===s?void 0:s.responsive)&&(null===(a=this.obj)||void 0===a?void 0:a.responsive)==x.SmallHidden}},(this.editable||this.preview)&&o("ldf-editable-metadata-buttons",{visible:this.hasFocus,base:this.base,index:this.index,obj:this.obj,parentType:this.parentType,preview:this.preview,onLdfTogglePreview:t=>this.setPreview(t.detail),class:{"top-level":"liturgy"===(null===(r=this.obj)||void 0===r?void 0:r.type)||"option"===(null===(d=this.obj)||void 0===d?void 0:d.type)}}),(this.editable||this.preview)&&((null===(c=this.obj)||void 0===c?void 0:c.responsive)===x.SmallHidden||(null===(h=this.obj)||void 0===h?void 0:h.responsive)===x.SmallOnly)&&o("ion-chip",{class:"responsive-banner"},o("ion-icon",{name:"phone-portrait-outline"}),(null===(u=this.obj)||void 0===u?void 0:u.responsive)===x.SmallOnly&&o("ion-label",null,this.localeStrings.smallOnly),(null===(p=this.obj)||void 0===p?void 0:p.responsive)===x.SmallHidden&&o("ion-label",null,this.localeStrings.smallHidden)),o("div",{id:(this.path||"").replace(/\//g,"-"),class:{doc:!0,editable:this.editable||this.preview},style:{padding:this.padding}},v)))}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};ot.style="ldf-liturgical-document.sc-ldf-liturgical-document,.sc-ldf-liturgical-document-h{font-family:var(--ldf-font-face);display:block}.container.editable.sc-ldf-liturgical-document{padding-top:0}.lookup.sc-ldf-liturgical-document{background-color:var(--ldf-editable-lookup-background-color);color:var(--ldf-editable-lookup-color);border-radius:4px;margin-bottom:1.5em;padding:1em;width:calc(100% - 2em)}.lookup.sc-ldf-liturgical-document code.sc-ldf-liturgical-document{font-weight:bold}.condition.sc-ldf-liturgical-document{background-color:var(--ldf-editable-condition-background-color);color:var(--ldf-editable-condition-color);border-radius:4px;padding:1em;width:calc(100% - 2em)}.condition.sc-ldf-liturgical-document code.sc-ldf-liturgical-document{font-weight:bold}.doc.sc-ldf-liturgical-document{margin-top:var(--ldf-liturgical-document-margin-top)}ldf-editable-metadata-buttons.sc-ldf-liturgical-document{height:none;display:block;z-index:10;background:var(--ldf-background);opacity:0.8;width:100%;position:sticky;top:2em;padding-top:1em;padding-bottom:1em}ldf-editable-metadata-buttons.top-level.sc-ldf-liturgical-document{position:relative;top:0}.small-only.sc-ldf-liturgical-document{display:block}.small-hidden.sc-ldf-liturgical-document{display:none}@media (min-width: 415px){.small-only.sc-ldf-liturgical-document{display:none}.small-hidden.sc-ldf-liturgical-document{display:block}}";const nt=class{constructor(i){t(this,i),this.preview=!1}docChanged(t){try{this.obj=new $("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new $}}componentWillLoad(){this.docChanged(this.doc)}onFocusPath(t){this.hasFocus=t.detail}render(){const t=("/"==this.path?"":`${this.path}/`)+"/value";return o(n,{lang:this.obj.language},(this.editable||this.preview)&&o("ldf-editable-add-block",{visible:!0,base:t,index:0}),this.obj.value.map(((i,e)=>{var n,l,s;const a=`${t}/${e}`,r=this.hasFocus==a||e==((null===(l=null===(n=this.obj)||void 0===n?void 0:n.value)||void 0===l?void 0:l.length)||0)-1||"option"===(null==i?void 0:i.type)&&(null===(s=this.hasFocus)||void 0===s?void 0:s.startsWith(a));return o("article",{style:{padding:this.editable?"1em":"0"}},o("ldf-liturgical-document",{doc:i,path:a,base:t,index:e,editable:this.editable,preview:this.preview,parentType:"liturgy"}),(this.editable||this.preview)&&o("ldf-editable-add-block",{visible:r,base:t,index:e+1}))})))}static get watchers(){return{doc:["docChanged"]}}},lt={en:{start:"Start",pause:"Pause",resume:"Resume",meditate:"Meditate for",minutes:"minutes.",seconds:" seconds. "}},st=class{constructor(e){t(this,e),this.timerChanged=i(this,"timerChanged",7),this.started=!1,this.paused=!1,this.startingDuration=void 0,this.color="#3333ff"}docChanged(t){try{this.obj=new C("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new C}}async componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings(),this.autostart&&(this.secondsRemaining=this.obj.metadata.length,this.start())}async start(t){var i,e;const o=null!==(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)&&void 0!==e?e:{length:300,delay:0},n=t||o.length,l=o.delay;this.secondsRemaining=n,this.startingDuration=n,setTimeout((()=>{this.startTimer(),this.started=!0}),l),setTimeout((()=>{this.timerChanged.emit("start")}),l)}async pause(){this.paused=!0,this.stopTimer()}async resume(){this.paused=!1,this.startTimer(),this.timerChanged.emit("resume")}async rewind(){this.pause(),this.stopTimer(),this.start(),this.timerChanged.emit("rewind")}async duration(){return this.startingDuration}async reset(){await this.pause(),this.secondsRemaining=void 0}async loadLocaleStrings(){try{this.localeStrings=lt[T(this.element)]}catch(t){console.warn(t)}}minutesSeconds(t){const i=t<0,e=Math.floor(Math.abs(t/60));return`${i?"-":""}${e.toString().padStart(2,"0")}:${Math.abs(t-60*e).toString().padStart(2,"0")}`}startTimer(){this.timerId=setInterval((()=>{this.secondsRemaining--,0==this.secondsRemaining?(this.timerChanged.emit("complete"),this.startingDuration=void 0):this.timerChanged.emit(this.secondsRemaining)}),1e3)}stopTimer(){this.timerId&&clearInterval(this.timerId),this.timerChanged.emit("pause")}handleControlSubmit(t){t.preventDefault()}handleControlValue(t){var i,e,o;let n=t.target.value;""==n&&(n="0"),Object.assign(this.obj,{metadata:Object.assign(Object.assign({},this.obj.metadata),{length:60*parseInt(n)})}),this.obj=new C(this.obj),this.secondsRemaining=null!==(o=null===(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)||void 0===e?void 0:e.length)&&void 0!==o?o:0}buttonNode(t,i,e,n="clear",l="large"){const s=this.localeStrings||{};return customElements&&customElements.get("ion-button")?o("ion-button",{onClick:t,fill:n,size:l},o("ion-icon",{name:e,slot:"start"}),o("ion-label",null,s[i])):o("button",{onClick:t,class:n,style:{color:this.color}},s[i])}render(){var t,i,e,l,s,a,r;const d=this.localeStrings||{},c=null!==(e=null===(i=null===(t=this.obj)||void 0===t?void 0:t.metadata)||void 0===i?void 0:i.length)&&void 0!==e?e:300,h=this.secondsRemaining/c*100;return this.editable?o(n,null,o("form",{class:"controls",onSubmit:t=>this.handleControlSubmit(t)},o("span",null,d.meditate),o("ldf-editable-text",{inputType:"number",short:!0,path:`${this.path}/metadata/length`,text:null===(r=null!==(a=null===(s=null===(l=this.obj)||void 0===l?void 0:l.metadata)||void 0===s?void 0:s.length)&&void 0!==a?a:300)||void 0===r?void 0:r.toString()}),o("span",null,d.seconds),o("span",null,"(",Math.floor(c/60),":",Math.floor(c%60).toString().padStart(2,"0"),")"))):o(n,null,o("div",{class:{"control-container":!0,hidden:!!this.secondsRemaining}},o("form",{class:"controls",onSubmit:t=>this.handleControlSubmit(t)},this.buttonNode((()=>this.start()),"meditate","sunny","solid","small"),o("input",{type:"number",value:c/60,onInput:t=>this.handleControlValue(t)}),o("span",null,d.minutes))),o("div",{class:{hidden:!this.secondsRemaining}},o("div",{class:"progress-circle-container"},o("div",{class:"progress-circle",style:{background:`conic-gradient(${this.color} ${100-h}%, 0, #ecf0f1 ${h}%)`}},o("div",{class:"circle-overlay"},o("div",{class:"seconds"},this.minutesSeconds(this.secondsRemaining)),o("div",{class:"controls"},!this.started&&this.buttonNode((()=>this.start()),"start","start"),this.started&&!this.paused&&this.buttonNode((()=>this.pause()),"pause","pause"),this.started&&this.paused&&this.buttonNode((()=>this.resume()),"resume","play")))))))}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};st.style="ldf-heading.sc-ldf-meditation .control-container.sc-ldf-meditation,.sc-ldf-meditation-h .control-container.sc-ldf-meditation{display:block;margin:auto}ldf-heading.sc-ldf-meditation .controls.sc-ldf-meditation,.sc-ldf-meditation-h .controls.sc-ldf-meditation{display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;width:100%}ldf-heading.sc-ldf-meditation .controls.sc-ldf-meditation input.sc-ldf-meditation,.sc-ldf-meditation-h .controls.sc-ldf-meditation input.sc-ldf-meditation{text-align:center}@media (min-width: 767px){ldf-heading.sc-ldf-meditation .controls.sc-ldf-meditation,.sc-ldf-meditation-h .controls.sc-ldf-meditation{flex-direction:row}}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation{display:flex;align-items:center;justify-content:center;padding:1em}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation{width:300px;height:300px;display:flex;align-items:center;justify-content:center;border-radius:50%}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .circle-overlay.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .circle-overlay.sc-ldf-meditation{background-color:var(--ldf-background-color);display:flex;align-items:center;flex-direction:column;justify-content:center;height:92%;width:92%;border-radius:50%}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .seconds.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .seconds.sc-ldf-meditation{font-family:var(--ldf-font-face);font-size:3em}ldf-heading.sc-ldf-meditation button.clear.sc-ldf-meditation,.sc-ldf-meditation-h button.clear.sc-ldf-meditation{background-color:var(--ldf-background-color);border:none;font-size:1em}.hidden.sc-ldf-meditation{height:0;opacity:0;transition:0.25s}";const at={en:{option:"Option"}},rt=class{constructor(e){t(this,e),this.ldfAddOptionToDoc=i(this,"ldfAddOptionToDoc",7),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.ldfOptionAskForStoredSelection=i(this,"ldfOptionAskForStoredSelection",7),this.ldfOptionMakeSelection=i(this,"ldfOptionMakeSelection",7)}docChanged(t){var i,e,o,n,l,s,a,r,d,c;try{this.obj=new L("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new L}const h=this.editable?null!==(s=null!==(o=null===(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)||void 0===e?void 0:e.editor_selected)&&void 0!==o?o:null===(l=null===(n=this.obj)||void 0===n?void 0:n.metadata)||void 0===l?void 0:l.selected)&&void 0!==s?s:0:null!==(d=null===(r=null===(a=this.obj)||void 0===a?void 0:a.metadata)||void 0===r?void 0:r.selected)&&void 0!==d?d:0;this.select(h),(null===(c=this.obj)||void 0===c?void 0:c.value)&&this.obj.value[h]&&this.obj.value[h].value||this.selectFirstDefined(),this.filterOptions()}componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings(),this.ldfOptionAskForStoredSelection.emit({el:this.el})}async loadLocaleStrings(){try{this.localeStrings=at[T(this.el)]}catch(t){console.warn(t)}}async select(t,i=!1){var e,o,n,l,s,a,r,d;(null===(e=this.obj)||void 0===e?void 0:e.slug)&&"number"==typeof t&&i&&this.ldfOptionMakeSelection.emit({slug:null===(o=this.obj)||void 0===o?void 0:o.slug,index:t});const c=Boolean(null===(n=this.obj)||void 0===n?void 0:n.metadata),h=null===(s=null===(l=this.obj)||void 0===l?void 0:l.metadata)||void 0===s?void 0:s.editor_selected;Number(t)>=0?((null===(a=this.obj)||void 0===a?void 0:a.metadata)?(this.obj.metadata.selected=Number(t),this.obj.metadata.editor_selected=Number(t)):this.obj.metadata={selected:Number(t),editor_selected:Number(t)},this.obj=new L(Object.assign({},this.obj)),i&&!this.editable&&this.ldfDocShouldChange.emit(new N({path:`${this.path}/metadata`,op:[{type:"set",index:"selected",oldValue:h,value:Number(t)}]})),this.editable&&(c&&t!==h?this.ldfDocShouldChange.emit(new N({path:`${this.path}/metadata`,op:[{type:"set",index:"editor_selected",oldValue:h,value:Number(t)}]})):c||t===h||this.ldfDocShouldChange.emit(new N({path:`${this.path}`,op:[{type:"set",index:"metadata",value:{editor_selected:Number(t)}}]}))),Object.assign(this.obj,{metadata:Object.assign(Object.assign({},this.obj.metadata),{selected:t})}),Object.assign(this.obj,{metadata:Object.assign(Object.assign({},this.obj.metadata),{editor_selected:t})})):"add"===t&&this.ldfAddOptionToDoc.emit({base:this.path,index:null===(d=null===(r=this.obj)||void 0===r?void 0:r.value)||void 0===d?void 0:d.length,obj:this.obj})}onSelectChange(t){const i=parseInt(t.target.value);this.select(i,!0)}selectFirstDefined(){const t=this.obj.value.find((t=>void 0!==(null==t?void 0:t.value))),i=this.obj.value.filter((t=>Boolean(t))).indexOf(t);this.select(i)}filterOptions(){var t;this.obj&&(this.obj=new L(Object.assign(Object.assign({},this.obj),{value:((null===(t=this.obj)||void 0===t?void 0:t.value)||[]).filter((t=>this.editable||Boolean(t)&&(Boolean(t.value)||Boolean("bible-reading"===(null==t?void 0:t.type)&&t.citation))))})))}selectNode(){var t,i,e,n,l,s,a,r,d,c,h,u,p,v,b,f;const g=this.editable?null!==(s=null!==(e=null===(i=null===(t=this.obj)||void 0===t?void 0:t.metadata)||void 0===i?void 0:i.editor_selected)&&void 0!==e?e:null===(l=null===(n=this.obj)||void 0===n?void 0:n.metadata)||void 0===l?void 0:l.selected)&&void 0!==s?s:0:null!==(d=null===(r=null===(a=this.obj)||void 0===a?void 0:a.metadata)||void 0===r?void 0:r.selected)&&void 0!==d?d:0;return(null===(h=null===(c=this.obj)||void 0===c?void 0:c.value)||void 0===h?void 0:h.length)>1||this.editable?customElements&&customElements.get("ion-select")?!((null===(u=this.obj)||void 0===u?void 0:u.value)||[]).map(((t,i)=>{var e;return(null===(e=this.versionLabel(t,i))||void 0===e?void 0:e.length)>20})).reduce(((t,i)=>t||i),!1)&&(null===(p=this.obj)||void 0===p?void 0:p.value.length)<=3?o("ion-segment",{color:"primary",value:g.toString()},null===(v=this.obj)||void 0===v?void 0:v.value.map(((t,i)=>o("ion-segment-button",{value:i.toString(),onClick:()=>this.select(i,!0)},o("ion-label",null,this.versionLabel(t,i))))),this.editable&&o("ion-segment-button",{value:"add",class:"add",onClick:()=>this.select("add",!0)},o("ion-label",null,"+"))):(console.log(">2 or longish"),o("ion-toolbar",null,o("ion-select",{value:g,slot:this.editable?"start":"end",onIonChange:t=>this.select(Number(t.detail.value),!0)},null===(b=this.obj)||void 0===b?void 0:b.value.map(((t,i)=>o("ion-select-option",{value:i},o("ion-label",null,this.versionLabel(t,i)))))),this.editable&&o("ion-buttons",{slot:"end"},o("ion-button",{onClick:()=>this.select("add",!0)},o("ion-icon",{slot:"icon-only",name:"add"}))))):o("ldf-label-bar",null,o("select",{onInput:t=>this.onSelectChange(t),slot:this.editable?"start":"end"},null===(f=this.obj)||void 0===f?void 0:f.value.map(((t,i)=>o("option",{value:i,selected:i==g},this.versionLabel(t,i))))),this.editable&&o("button",{slot:"end",onClick:()=>this.select("add",!0)},"+")):[]}versionLabel(t,i){try{return this.obj.getVersionLabel(t)}catch(t){return console.warn(t),`${(this.localeStrings||{}).option} ${i+1}`}}render(){var t;const i=this.editable&&null!==(t=this.obj.metadata.editor_selected)&&void 0!==t?t:this.obj.metadata.selected;return o(n,{lang:this.obj.language},o("div",{class:"select-control"},o("ldf-label-bar",null,this.selectNode())),(this.obj.value||this.editable)&&o("ldf-liturgical-document",{doc:this.obj.value[i],path:`${this.path}/value/${this.obj.metadata.selected}`,base:`${this.path}/value`,index:i,editable:this.editable,parentType:"option"}))}get el(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};rt.style=".select-control.sc-ldf-option{margin-top:var(--ldf-select-control-margin-top)}ion-select.sc-ldf-option{width:75vw;max-width:300px}";const dt={en:{parallel:"Parallel"}},ct=class{constructor(e){t(this,e),this.ldfAddOptionToDoc=i(this,"ldfAddOptionToDoc",7),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.ldfOptionAskForStoredSelection=i(this,"ldfOptionAskForStoredSelection",7),this.ldfOptionMakeSelection=i(this,"ldfOptionMakeSelection",7)}docChanged(t){try{this.obj=new V("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new V}}componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings(),this.ldfOptionAskForStoredSelection.emit({el:this.el})}async loadLocaleStrings(){try{this.localeStrings=dt[T(this.el)]}catch(t){console.warn(t)}}render(){var t;return o(n,{lang:this.obj.language},o("tr",null,((null===(t=this.obj)||void 0===t?void 0:t.value)||[]).map(((t,i)=>o("td",null,o("ldf-liturgical-document",{doc:t,path:`${this.path}/value/${i}`,base:`${this.path}/value`,index:i,editable:this.editable,parentType:"option"}))))))}get el(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};ct.style=".select-control.sc-ldf-parallel{margin-top:var(--ldf-select-control-margin-top)}ion-select.sc-ldf-parallel{width:75vw;max-width:300px}";const ht={en:{changeCanticle:"Change Canticle",citation:"(Biblical) Citation",label:"Label",latinname:"Latin Name",section_break_insert:"+ insert section break",section_break_remove:"x remove section break",source:"Source",source_citation:"Citation"},es:{changeCanticle:"Change Canticle",citation:"(Biblical) Citation",label:"Label",latinname:"Latin Name",section_break_insert:"+ insert section break",section_break_remove:"x remove section break",source:"Source",source_citation:"Citation"}},ut=class{constructor(e){t(this,e),this.ldfAskForCanticleOptions=i(this,"ldfAskForCanticleOptions",7),this.ldfDocShouldChange=i(this,"ldfDocShouldChange",7),this.focusedVerse=void 0,this.focusedSection=void 0}docChanged(t){try{this.obj=new S("string"==typeof t?JSON.parse(t):t),this.filter()}catch(t){console.warn(t),this.obj=new S}}async componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings(),this.filter()}async loadLocaleStrings(){try{this.localeStrings=ht[T(this.element)]}catch(t){console.warn(t)}}async changeCanticle(){const t=await g.create({component:"ldf-editable-filter-documents"});t.componentProps={modal:t,type:"canticle",changeCallback:t=>{this.ldfDocShouldChange.emit(new N({path:this.path,op:[{type:"set",oldValue:this.obj,value:t}]}))}},await t.present(),this.ldfAskForCanticleOptions.emit(this.path)}async filter(){this.filteredValue=this.obj.filteredVerses()}antiphonNode(t,i=!1){var e,n;if("string"==typeof t){const e=new A({type:"refrain",value:[t],style:"antiphon"});return o("ldf-refrain",{class:"antiphon",doc:e,editable:this.editable&&!i,path:`${this.path}/metadata/antiphon`})}if(null==t?void 0:t.type)return o("ldf-liturgical-document",{class:"antiphon",doc:t,path:`${this.path}/metadata/antiphon`,editable:this.editable&&!i});if("object"==typeof t){const i=this.obj.day?k(null===(n=null===(e=this.obj)||void 0===e?void 0:e.day)||void 0===n?void 0:n.date):new Date;return this.antiphonNode(t[`${i.getMonth()+1}/${i.getDate()}`]||t[`${i.getMonth()+1}-${i.getDate()}`],!0)}}gloriaNode(t){if("string"==typeof t){const i=new A({value:[t],style:"gloria"});return o("ldf-liturgical-document",{doc:i,editable:this.editable})}return o("ldf-liturgical-document",{doc:t,editable:this.editable})}headingNode(t,i=3,e=!0,n=!1,l=!1){var s,a,r,d,c,h,u,p,v,b,f,g,m,y,x,k,w,$,C,S;let j=this.obj.label;"canticle"==this.obj.style&&this.obj.metadata&&this.obj.metadata.number&&this.obj.metadata.localname?j=`${this.obj.metadata.number}. ${this.obj.metadata.localname}`:"canticle"==this.obj.style&&this.obj.metadata&&this.obj.metadata.localname&&(j=this.obj.metadata.localname);const O=new z({type:"heading",metadata:{level:i},citation:n||(null===(s=this.obj)||void 0===s?void 0:s.citation)===(null===(a=this.obj)||void 0===a?void 0:a.label)||null===(r=this.obj)||void 0===r?void 0:r.citation,value:[null!=t?t:j],source:l||null===(d=this.obj)||void 0===d?void 0:d.source});return this.editable?[o("ldf-label-bar",null,o("h3",{slot:"start",class:"editable-label"},o("ldf-editable-text",{id:"label",text:null===(c=this.obj)||void 0===c?void 0:c.label,path:`${this.path}/label`,placeholder:null===(h=this.localeStrings)||void 0===h?void 0:h.label})),(null===(u=this.obj)||void 0===u?void 0:u.metadata)&&o("ldf-editable-text",{id:"latinname",text:null===(v=null===(p=this.obj)||void 0===p?void 0:p.metadata)||void 0===v?void 0:v.latinname,path:`${this.path}/metadata/latinname`,placeholder:null===(b=this.localeStrings)||void 0===b?void 0:b.latinname}),o("ldf-editable-text",{slot:"end",id:"source-source",text:null===(g=null===(f=this.obj)||void 0===f?void 0:f.source)||void 0===g?void 0:g.source,path:`${this.path}/source/source`,placeholder:null===(m=this.localeStrings)||void 0===m?void 0:m.source}),o("ldf-editable-text",{slot:"end",id:"source-citation",text:null===(x=null===(y=this.obj)||void 0===y?void 0:y.source)||void 0===x?void 0:x.citation,path:`${this.path}/source/citation`,placeholder:null===(k=this.localeStrings)||void 0===k?void 0:k.source_citation})),o("ldf-label-bar",null,o("ldf-editable-text",{slot:"start",id:"citation",text:null===(w=this.obj)||void 0===w?void 0:w.citation,path:`${this.path}/citation`,placeholder:null===($=this.localeStrings)||void 0===$?void 0:$.citation}))]:o("ldf-heading",{doc:O},e&&o("h5",{slot:"additional"},null===(S=null===(C=this.obj)||void 0===C?void 0:C.metadata)||void 0===S?void 0:S.latinname))}insertSectionBreakAfterVerse(t,i){const e=this.obj.value[t],o=e.value.slice(0,i+1),n=e.value.slice(i+1);this.ldfDocShouldChange.emit(new N({path:`${this.path}/value/${t}`,op:[{type:"set",oldValue:e,value:Object.assign(Object.assign({},e),{value:o})}]})),this.ldfDocShouldChange.emit(new N({path:`${this.path}/value`,op:[{type:"insertAt",index:t+1,oldValue:e,value:Object.assign(Object.assign({},e),{value:n})}]}))}removeSectionBreakAfter(t){const i=this.obj.value[t],e=this.obj.value[t+1];if(i&&e){const o=i.value.concat(e.value);this.ldfDocShouldChange.emit(new N({path:`${this.path}/value/${t}/value`,op:[{type:"set",oldValue:i.value,value:o}]})),this.ldfDocShouldChange.emit(new N({path:`${this.path}/value`,op:[{type:"deleteAt",index:t+1,oldValue:e}]}))}}render(){var t,i,e,l,s,a,r,d,c,h,u,p,v,b,f,g,m,y,x,k;const w=this.obj.includeAntiphon();let $,C=t=>({type:"psalm-verse",number:"",halfverse:"",verse:t});this.editable&&($=Object.assign({},(null===(i=null===(t=this.obj)||void 0===t?void 0:t.value[0])||void 0===i?void 0:i.value[0])||{type:"psalm-verse",number:"",halfverse:"",verse:""}),$.number&&($.number=""),$.halfverse&&($.halfverse=""),$.verse&&($.verse=""));const S=((null===(e=this.obj)||void 0===e?void 0:e.value)||[]).map((t=>t.value.map((t=>!Boolean(t.number))))).flat().reduce(((t,i)=>t||i),!1),j=this.localeStrings||{};return o(n,{lang:(null===(l=this.obj)||void 0===l?void 0:l.language)||"en"},o("div",{class:`psalm-parent ${this.editable?"editable":""} ${(null===(s=this.obj)||void 0===s?void 0:s.display_format)||"default"} ${S?"no-numbers":""}`},(this.editable||"canticle"===(null===(a=this.obj)||void 0===a?void 0:a.style))&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"},"canticle"===(null===(r=this.obj)||void 0===r?void 0:r.style)&&(null===(c=null===(d=this.obj)||void 0===d?void 0:d.metadata)||void 0===c?void 0:c.changeable)&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"},o("ion-buttons",null,o("ion-button",{onClick:()=>this.changeCanticle()},o("ion-icon",{name:"swap-horizontal",slot:"start"}),o("ion-label",null,j.changeCanticle))))))),this.headingNode(),w&&this.antiphonNode(this.obj.metadata.antiphon),null===(h=this.filteredValue)||void 0===h?void 0:h.map(((t,i)=>{var e,n,l;return[t.label&&(null===(e=t.value)||void 0===e?void 0:e.length)>0&&this.headingNode(t.label,4,!1,!0,!0),o("div",{class:"psalm-set"},t.value.map(((t,e)=>{var n,l,s,a,r,d,c,h,u,p;if(t instanceof z)return o("ldf-heading",{doc:t});{const v=new Array;return v.push(o("div",{class:"verse"},this.editable?o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}-${e}-verse`,text:t.verse,path:`${this.path}/value/${i}/value/${e}/verse`,placeholder:"Lorem ipsum sit dolor amet, *",template:$,templateMaker:C}):o("ldf-string",{text:t.verse,citation:{label:null===(n=this.obj)||void 0===n?void 0:n.label,book:"psalm"===(null===(l=this.obj)||void 0===l?void 0:l.style)?"Psalm":void 0,chapter:null===(a=null===(s=this.obj)||void 0===s?void 0:s.metadata)||void 0===a?void 0:a.number,verse:t.number},dropcap:M(null===(r=this.obj)||void 0===r?void 0:r.language,null===(d=this.obj)||void 0===d?void 0:d.display_format,e),index:e,fragment:this.path}))),v.push(o("br",null)),v.push(o("div",{class:"halfverse"},this.editable?o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}-${e}-halfverse`,text:t.halfverse,path:`${this.path}/value/${i}/value/${e}/halfverse`,placeholder:"consectetur adipiscing elit.",template:$}):o("ldf-string",{text:t.halfverse,citation:{label:null===(c=this.obj)||void 0===c?void 0:c.label,book:"psalm"===(null===(h=this.obj)||void 0===h?void 0:h.style)?"Psalm":void 0,chapter:null===(p=null===(u=this.obj)||void 0===u?void 0:u.metadata)||void 0===p?void 0:p.number,verse:t.number},dropcap:"disabled",fragment:this.path}))),o("p",{class:this.editable?"psalm editable":"psalm",onClick:()=>{this.focusedVerse=e,this.focusedSection=i}},this.editable?o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}-${e}-number`,text:t.number,path:`${this.path}/value/${i}/value/${e}/number`,placeholder:"#",template:$}):t.number&&o("sup",null,t.number),o("div",{class:"text"},v,this.editable&&o("ion-button",{fill:"clear",class:{"section-break":!0,hidden:this.focusedVerse!==e||this.focusedSection!==i},onClick:()=>this.insertSectionBreakAfterVerse(i,e)},j.section_break_insert)))}})),this.obj.repeatAntiphon(i,this.filteredValue.length)&&o("div",{class:"repeat-antiphon"},this.antiphonNode(null===(l=null===(n=this.obj)||void 0===n?void 0:n.metadata)||void 0===l?void 0:l.antiphon)),this.editable&&this.obj.value.length>i+1&&o("ion-button",{fill:"clear",class:"section-break",onClick:()=>this.removeSectionBreakAfter(i)},j.section_break_remove))]})),(null===(p=null===(u=this.obj)||void 0===u?void 0:u.metadata)||void 0===p?void 0:p.gloria)&&!this.obj.metadata.omit_gloria&&this.gloriaNode(this.obj.metadata.gloria),((null===(b=null===(v=this.obj)||void 0===v?void 0:v.metadata)||void 0===b?void 0:b.gloria)&&!this.obj.metadata.omit_gloria||void 0===(null===(g=null===(f=this.obj)||void 0===f?void 0:f.metadata)||void 0===g?void 0:g.gloria)||Boolean(null===(y=null===(m=this.obj)||void 0===m?void 0:m.metadata)||void 0===y?void 0:y.omit_gloria))&&w&&this.antiphonNode(null===(k=null===(x=this.obj)||void 0===x?void 0:x.metadata)||void 0===k?void 0:k.antiphon)))}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};ut.style="ldf-psalm.sc-ldf-psalm,.sc-ldf-psalm-h{font-family:var(--ldf-font-face);--ldf-drop-margin-right:var(--ldf-drop-psalm-margin-right)}ldf-psalm[lang=he].sc-ldf-psalm .verse.sc-ldf-psalm,[lang=he].sc-ldf-psalm-h .verse.sc-ldf-psalm{text-align:right;--ldf-drop-float:right}.psalm-set.sc-ldf-psalm{margin-top:0.5em;margin-bottom:0.5em}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm{display:var(--ldf-psalm-grid-display);grid-template-columns:var(--ldf-psalm-grid-template-columns);grid-template-rows:auto;grid-template-areas:var(--ldf-psalm-grid-template-areas);margin:0;text-indent:var(--ldf-psalm-verse-indentation)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm br.sc-ldf-psalm{display:var(--ldf-psalm-line-break-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm sup.sc-ldf-psalm{float:var(--ldf-psalm-number-float);display:var(--ldf-psalm-number-display);grid-area:var(--ldf-psalm-number-grid-area);margin-right:var(--ldf-psalm-number-margin-right)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .text.sc-ldf-psalm{display:var(--ldf-psalm-text-display);grid-area:var(--ldf-psalm-text-grid-area)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .halfverse.sc-ldf-psalm{margin-left:var(--ldf-psalm-halfverse-margin-left)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .verse.sc-ldf-psalm,.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .halfverse.sc-ldf-psalm{display:var(--ldf-psalm-verse-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .halfverse.sc-ldf-psalm{display:var(--ldf-psalm-halfverse-display, var(--ldf-psalm-verse-display))}.editable.sc-ldf-psalm .verse.sc-ldf-psalm,.editable.sc-ldf-psalm .halfverse.sc-ldf-psalm{width:100%}.psalm-parent.no-numbers.sc-ldf-psalm{display:block;text-align:left;grid-template-columns:none;grid-template-rows:none;grid-template-areas:none}.psalm-parent.no-numbers.sc-ldf-psalm .psalm.sc-ldf-psalm{display:block;grid-template-columns:none;grid-template-rows:none;grid-template-areas:none}.psalm-parent.no-numbers.sc-ldf-psalm .psalm.sc-ldf-psalm .text.sc-ldf-psalm{text-align:left;grid-area:none;display:var(--ldf-psalm-text-display);width:100%}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-of-type(1) sup.sc-ldf-psalm{display:var(--ldf-psalm-set-first-verse-number-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .verse.sc-ldf-psalm:nth-of-type(1){display:var(--ldf-psalm-set-first-verse-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .halfverse.sc-ldf-psalm:nth-of-type(2){display:var(--ldf-psalm-set-first-half-verse-display, inline-block)}.psalm-set.sc-ldf-psalm:nth-of-type(1) .psalm.sc-ldf-psalm:nth-of-type(1) sup.sc-ldf-psalm{display:var(--ldf-psalm-first-verse-number-display)}.psalm-set.sc-ldf-psalm:nth-of-type(1) .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .verse.sc-ldf-psalm:nth-of-type(1){display:var(--ldf-psalm-first-verse-display)}.psalm-set.sc-ldf-psalm:nth-of-type(1) .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .halfverse.sc-ldf-psalm:nth-of-type(2){display:var(--ldf-psalm-first-half-verse-display, inline-block)}.antiphon.sc-ldf-psalm{display:var(--ldf-psalm-antiphon-display);font-style:var(--ldf-antiphon-font-style);font-weight:var(--ldf-antiphon-font-weight);margin-top:0.5em}.repeat-antiphon.sc-ldf-psalm{display:var(--ldf-psalm-repeat-antiphon-display)}h5.sc-ldf-psalm{font-size:1em;font-style:italic;font-weight:normal;margin-right:1em}.psalm.unison.sc-ldf-psalm .text.sc-ldf-psalm{font-weight:var(--ldf-unison-font-weight);font-style:var(--ldf-unison-font-style)}.psalm.omit.sc-ldf-psalm .text.sc-ldf-psalm{display:none}.psalm.wholeverse.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-child(even),.psalm-parent.wholeverse.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-child(even){font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.psalm.halfverse.sc-ldf-psalm .halfverse.sc-ldf-psalm,.psalm-parent.halfverse.sc-ldf-psalm .halfverse.sc-ldf-psalm{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}h3.editable-label.sc-ldf-psalm{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}.section-break.sc-ldf-psalm{display:block;text-align:center;width:100%}.section-break.hidden.sc-ldf-psalm{display:none}";const pt=class{constructor(i){t(this,i)}docChanged(t){try{this.obj=new A("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new A}}componentWillLoad(){this.docChanged(this.doc)}render(){var t,i,e;return o(n,{lang:this.obj.language},this.editable&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"})),o("div",{class:`${(null===(t=this.obj)||void 0===t?void 0:t.style)||""} ${(null===(e=null===(i=this.obj)||void 0===i?void 0:i.metadata)||void 0===e?void 0:e.align)||""}`},this.obj.value&&this.obj.value.map(((t,i)=>this.editable?o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}`,text:t,path:`${this.path}/value/${i}`}):o("p",{id:`${this.obj.uid||this.obj.slug}-${i}`,innerHTML:t})))))}static get watchers(){return{doc:["docChanged"]}}};pt.style="ldf-refrain.sc-ldf-refrain,.sc-ldf-refrain-h{font-family:var(--ldf-font-face);display:block}ldf-refrain.sc-ldf-refrain p.sc-ldf-refrain,.sc-ldf-refrain-h p.sc-ldf-refrain{font-style:inherit;margin-bottom:0;margin:0}.antiphon.sc-ldf-refrain{font-style:var(--ldf-antiphon-font-style)}.gloria.sc-ldf-refrain{margin-left:calc(var(--ldf-gloria-indent) / 2);text-indent:calc(var(--ldf-gloria-indent) / -2)}@media (min-width: 450px){.gloria.sc-ldf-refrain{margin-left:var(--ldf-gloria-indent);text-indent:calc(var(--ldf-gloria-indent) * -1)}.gloria.sc-ldf-refrain>p.sc-ldf-refrain:first-child{margin-left:0em}.gloria.sc-ldf-refrain>p.sc-ldf-refrain:nth-child(even){margin-left:1em}}.left.sc-ldf-refrain{text-align:left}.center.sc-ldf-refrain{text-align:center}.right.sc-ldf-refrain{text-align:right}";const vt={en:{label:"Label",source:"Source",citation:"Citation",makeOptional:"Make Optional",optional:"Optional"}},bt=class{constructor(i){t(this,i)}docChanged(t){try{this.obj=new j("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new j}}async componentWillLoad(){this.docChanged(this.doc),this.loadLocaleStrings()}async loadLocaleStrings(){try{this.localeStrings=vt[T(this.element)]}catch(t){console.warn(t)}}editableNode(t,i,e,n,l){return o("ldf-editable-text",{id:`${this.obj.uid}-${i}-${e}`,text:t[e],path:`${this.path}/value/${i}/${e}`,template:n,templateMaker:l})}stringNode(t,i,e,n){return o("ldf-string",{citation:{label:this.obj.label},id:`${this.obj.uid}-${e}-${n}`,text:i[n],dropcap:M(t.language,t.display_format,e),fragment:this.path})}litanyResponseStringNode(t,i){const e=t.response||this.obj.metadata.response;return"[Silence]"==e?o("span",{class:"rubric"},o("br",null),"Silence"):o("span",{class:"response"},o("ldf-string",{citation:{label:this.obj.label},id:`${this.obj.uid}-${i}-response`,text:e,fragment:this.path}))}editableHeader(){var t,i,e,n,l,s,a,r;return o("ldf-label-bar",null,o("h3",{slot:"start",class:"editable-label"},o("ldf-editable-text",{id:"label",text:null===(t=this.obj)||void 0===t?void 0:t.label,path:`${this.path}/label`,placeholder:null===(i=this.localeStrings)||void 0===i?void 0:i.label})),o("ldf-editable-text",{slot:"end",id:"source-source",text:null===(n=null===(e=this.obj)||void 0===e?void 0:e.source)||void 0===n?void 0:n.source,path:`${this.path}/source/source`,placeholder:null===(l=this.localeStrings)||void 0===l?void 0:l.source}),o("ldf-editable-text",{slot:"end",id:"source-citation",text:null===(a=null===(s=this.obj)||void 0===s?void 0:s.source)||void 0===a?void 0:a.citation,path:`${this.path}/source/citation`,placeholder:null===(r=this.localeStrings)||void 0===r?void 0:r.citation}))}render(){var t,i,e,l,s;const a=(null===(t=this.obj)||void 0===t?void 0:t.label)||(null===(i=this.obj)||void 0===i?void 0:i.citation)||(null===(e=this.obj)||void 0===e?void 0:e.source);if("preces"==this.obj.style){const t={label:"",text:""},i=t=>({label:"",text:t});return o(n,{class:this.obj.style,lang:this.obj.language},o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"})),!this.editable&&a&&o("ldf-heading",{doc:new z({type:"heading",metadata:{level:3},value:[this.obj.label],citation:this.obj.citation,source:this.obj.source})}),this.editable&&a&&this.editableHeader(),o("table",{class:"preces"},this.obj.value.map(((e,n)=>o("tr",{class:"row"},o("td",{class:"cell"},this.editable?this.editableNode(e,n,"label",t,i):this.stringNode(this.obj,e,n,"label")),o("td",{class:n%2==0?"cell":"cell response"},this.editable?this.editableNode(e,n,"text",t,i):this.stringNode(this.obj,e,n,"text")))))))}if("litany"==this.obj.style){const t={text:"",response:(null===(l=this.obj.metadata)||void 0===l?void 0:l.response)||""},i=t=>{var i;return{text:t,response:(null===(i=this.obj.metadata)||void 0===i?void 0:i.response)||""}};return o(n,{class:this.obj.style,lang:this.obj.language},this.editable&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"})),!this.editable&&a&&o("ldf-heading",{doc:new z({type:"heading",metadata:{level:3},value:[this.obj.label],citation:this.obj.citation,source:this.obj.source})}),this.editable&&a&&this.editableHeader(),this.obj.value.map(((e,n)=>{var l,s;let a=new Array("litany");return e.optional&&a.push("optional"),o("div",{class:{line:!0,editable:this.editable}},o("p",{class:a.join(" ")},this.editable?this.editableNode(e,n,"text",t,i):this.stringNode(this.obj,e,n,"text"),e.response&&(this.editable?o("span",{class:"response"},this.editableNode(e,n,"response",t,i)):[o("br",null),this.litanyResponseStringNode(e,n)]),!e.response&&(null===(l=this.obj.metadata)||void 0===l?void 0:l.response)&&(this.editable?o("span",{class:"response"},o("ldf-editable-text",{id:`${this.obj.uid}-${n}-response`,text:this.obj.metadata.response,path:`${this.path}/response`})):[o("br",null),this.litanyResponseStringNode(e,n)])),this.editable&&o("label",{class:"optional-label",htmlFor:`optional-${n}`},null===(s=this.localeStrings)||void 0===s?void 0:s.optional),this.editable&&o("ldf-editable-boolean",{id:`optional-${n}`,slot:"start",path:`${this.path}/value/${n}/optional`,value:e.optional}))})))}{const t={text:"",response:(null===(s=this.obj.metadata)||void 0===s?void 0:s.response)||""},i=t=>{var i;return{text:t,response:(null===(i=this.obj.metadata)||void 0===i?void 0:i.response)||""}};return o(n,{class:this.obj.style,lang:this.obj.language},!this.editableHeader&&a&&o("ldf-heading",{doc:new z({type:"heading",metadata:{level:3},value:[this.obj.label],citation:this.obj.citation,source:this.obj.source})}),this.editable&&a&&this.editableHeader(),o("p",{class:"responsive"},this.obj.value.map(((e,n)=>[o("div",null,this.editable?this.editableNode(e,n,"text",t,i):this.stringNode(this.obj,e,n,"text")),o("div",{class:"response"},this.editable?this.editableNode(e,n,"response",t,i):this.stringNode(this.obj,e,n,"response"))]))))}}get element(){return l(this)}static get watchers(){return{doc:["docChanged"]}}};bt.style=".sc-ldf-responsive-prayer-h{text-align:var(--ldf-text-align);text-justify:inter-character}.response.sc-ldf-responsive-prayer{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.preces.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer{text-align:left}.preces.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer:first-child{font-style:italic;text-align:left;padding-right:1em;vertical-align:top}.optional.sc-ldf-responsive-prayer{padding-left:0.5em;border-left:2px solid black}.line.sc-ldf-responsive-prayer{display:flex;flex-direction:row;align-items:center}.line.sc-ldf-responsive-prayer>*.sc-ldf-responsive-prayer{text-align:var(--ldf-text-align)}.editable.line.sc-ldf-responsive-prayer ldf-editable-boolean.sc-ldf-responsive-prayer{width:2em}.editable.line.sc-ldf-responsive-prayer p.sc-ldf-responsive-prayer{width:calc(100% - 2em)}.rubric.sc-ldf-responsive-prayer{font-family:var(--ldf-font-face);color:var(--ldf-rubric-color);font-style:var(--ldf-rubric-font-style);font-weight:var(--ldf-rubric-font-weight);font-size:var(--ldf-rubric-font-size)}.litany.sc-ldf-responsive-prayer{white-space:pre-wrap}.preces.sc-ldf-responsive-prayer{width:100%}.preces.sc-ldf-responsive-prayer tr.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer .row.sc-ldf-responsive-prayer{display:table-row;display:var(--ldf-preces-tr-display)}.preces.sc-ldf-responsive-prayer tr.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer tr.sc-ldf-responsive-prayer .cell.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer .row.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer .row.sc-ldf-responsive-prayer .cell.sc-ldf-responsive-prayer{display:table-cell;display:var(--ldf-preces-td-display);margin-left:var(--ldf-preces-td-margin-left)}h3.editable-label.sc-ldf-responsive-prayer{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}.optional-label.sc-ldf-responsive-prayer{margin-right:0.5em}";const ft=class{constructor(i){t(this,i)}docChanged(t){try{this.obj=new O("string"==typeof t?JSON.parse(t):t)}catch(t){console.warn(t),this.obj=new O}}componentWillLoad(){this.docChanged(this.doc)}render(){return o(n,{lang:this.obj.language},this.editable&&o("ldf-label-bar",null,o("slot",{slot:"end",name:"controls"})),this.obj.value.map(((t,i)=>this.editable?o("ldf-editable-text",{id:`${this.obj.uid||this.obj.slug}-${i}`,text:t,path:`${this.path}/value/${i}`}):o("p",{id:`${this.obj.uid||this.obj.slug}-${i}`,class:"rubric"},t))))}static get watchers(){return{doc:["docChanged"]}}};ft.style=".sc-ldf-rubric-h{font-family:var(--ldf-font-face);color:var(--ldf-rubric-color);font-style:var(--ldf-rubric-font-style);font-weight:var(--ldf-rubric-font-weight);font-size:var(--ldf-rubric-font-size);text-align:var(--ldf-text-align);text-justify:inter-character}";export{E as ion_segment,I as ion_segment_button,J as ion_skeleton_text,P as ldf_bible_reading,F as ldf_editable_add_block,K as ldf_editable_metadata_buttons,U as ldf_editable_select,q as ldf_image,ot as ldf_liturgical_document,nt as ldf_liturgy,st as ldf_meditation,rt as ldf_option,ct as ldf_parallel,ut as ldf_psalm,pt as ldf_refrain,bt as ldf_responsive_prayer,ft as ldf_rubric}
@@ -1 +0,0 @@
1
- import{L as s}from"./p-619c1cd7.js";const a=["normal","slideshow","carousel"];class r extends s{constructor(s={}){super(s)}availableStyles(){return a}availableDisplayFormats(){return[]}}export{r as I}