@creaditor/web-starterkit 1.0.62 → 1.0.64

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.
Files changed (36) hide show
  1. package/dist/2655.creaditor.bundle.js +16 -0
  2. package/dist/2655.creaditor.bundle.js.gz +0 -0
  3. package/dist/3521.creaditor.bundle.js +2 -11
  4. package/dist/3521.creaditor.bundle.js.gz +0 -0
  5. package/dist/3600.creaditor.bundle.js +1 -0
  6. package/dist/3600.creaditor.bundle.js.gz +0 -0
  7. package/dist/3847.creaditor.bundle.js +116 -69
  8. package/dist/3847.creaditor.bundle.js.gz +0 -0
  9. package/dist/4000.creaditor.bundle.js +1 -0
  10. package/dist/4000.creaditor.bundle.js.gz +0 -0
  11. package/dist/5884.creaditor.bundle.js +8 -8
  12. package/dist/5884.creaditor.bundle.js.gz +0 -0
  13. package/dist/5926.creaditor.bundle.js +1 -1
  14. package/dist/5926.creaditor.bundle.js.gz +0 -0
  15. package/dist/6442.creaditor.bundle.js +214 -155
  16. package/dist/6442.creaditor.bundle.js.gz +0 -0
  17. package/dist/{8547.creaditor.bundle.js → 7348.creaditor.bundle.js} +66 -131
  18. package/dist/7348.creaditor.bundle.js.gz +0 -0
  19. package/dist/7493.creaditor.bundle.js +48 -0
  20. package/dist/7493.creaditor.bundle.js.gz +0 -0
  21. package/dist/creaditor.bundle.js +948 -327
  22. package/dist/creaditor.bundle.js.LICENSE.txt +6 -0
  23. package/dist/creaditor.bundle.js.LICENSE.txt.gz +0 -0
  24. package/dist/creaditor.bundle.js.gz +0 -0
  25. package/dist/service-worker.js +1 -1
  26. package/dist/service-worker.js.gz +0 -0
  27. package/package.json +1 -1
  28. package/dist/1204.creaditor.bundle.js +0 -236
  29. package/dist/1204.creaditor.bundle.js.gz +0 -0
  30. package/dist/5119.creaditor.bundle.js +0 -48
  31. package/dist/5119.creaditor.bundle.js.gz +0 -0
  32. package/dist/6442.creaditor.bundle.js.LICENSE.txt +0 -23
  33. package/dist/6442.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  34. package/dist/7937.creaditor.bundle.js +0 -51
  35. package/dist/7937.creaditor.bundle.js.gz +0 -0
  36. package/dist/8547.creaditor.bundle.js.gz +0 -0
@@ -789,6 +789,22 @@
789
789
  overflow: hidden;
790
790
  }
791
791
 
792
+ /* In the light main toolbar rather than the dark bar. */
793
+ :host([compact]) {
794
+ margin-inline: 8px 10px;
795
+ }
796
+ :host([compact]) .next-button {
797
+ height: 34px;
798
+ width: auto;
799
+ /* Keeps its width while the spinner replaces the label. */
800
+ min-width: 90px;
801
+ padding: 0 18px;
802
+ margin: 0;
803
+ border-radius: 8px;
804
+ transform: none;
805
+ font-weight: 600;
806
+ }
807
+
792
808
  .next-button:disabled {
793
809
  opacity: 0.6;
794
810
  cursor: not-allowed;
Binary file
@@ -1,14 +1,5 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3521],{83521(t,e,i){i.r(e),i.d(e,{DesignFactory:()=>l});var o=i(5441),n=i(59929),r=i(54804),s=i(18057),d=i(86319);i.e(8315).then(i.bind(i,68315));class l extends n.WF{constructor(){super(),this.lastEditor=null,this._selectedComponentId=null,this._injectedForId=null,d.M.set({injectEditor:t=>{this.injected=!0,this._injectedForId=this._selectedComponentId,this.lastEditor=this.editor,this.backToEditor=this.editor,this.editor=t}}),this.editor=n.qy`<cdtr-ilustration-preference
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3521],{83521(t,e,i){i.r(e),i.d(e,{DesignFactory:()=>l});var o=i(5441),s=i(59929),n=i(54804),r=i(18057),d=i(86319),c=i(57327);i.e(8315).then(i.bind(i,68315));class l extends s.WF{constructor(){super(),this.lastEditor=null,this._selectedComponentId=null,this._injectedForId=null,d.M.set({injectEditor:t=>{this.injected=!0,this._injectedForId=this._selectedComponentId,this.lastEditor=this.editor,this.backToEditor=this.editor,this.editor=t}}),this.editor=s.qy`<cdtr-ilustration-preference
2
2
  width="200px"
3
3
  height="200px"
4
- ></cdtr-ilustration-preference>`,this.delayer=new s.A,this.connect=this.connect.bind(this),this.editors={block:{selector:"block-editor",load:()=>i.e(8299).then(i.bind(i,68299)),component:null},no_editor:{selector:"cdtr-no-component",load:()=>i.e(8854).then(i.bind(i,68854)),component:null,attrs:{style:"margin:auto;display:block;max-width:150px;margin-top:30px;"}}},this.type=null,r.Ay.on("select",this.connect)}connect(t){let{editor:e,component:i}=t;if(!e)return;let n=e.type;if("string"!=typeof n)return;const r=i?.id??null;if(this.injected){if(null==r||r===this._injectedForId)return;this.injected=!1,this._injectedForId=null}if(this._selectedComponentId=r,this.editor?.type===n)return;if(!this.editors[n]){const t=d.M.get("config","editor","configure","plugins");if(Array.isArray(t)){const e=t.find(t=>t.name===n);if(e&&"function"==typeof e.createEditor){this.editor=document.createElement("cdtr-editor-builder"),this.editor.type=n;const t=e.createEditor();return void(t&&(this.editor.editors=t.layout,t!==this.backToEditor&&this.lastEditor&&(this.lastEditor=null)))}}n="no_editor"}this.type=n;const s=(0,o.A)("div",null,(0,o.A)("cdtr-block-loader",null),(0,o.A)("cdtr-title",{style:"text-align:center;"},(0,o.A)("lang-text",{text:"please_wait_downloading_new_version"})));this.editors[n]&&!this.editors[n].component&&(this.editors[n].load().then(()=>{if(s.remove(),this.editors[n].attrs)for(const t in this.editors[n].attrs)if(Object.hasOwnProperty.call(this.editors[n].attrs,t)){const e=this.editors[n].attrs[t];this.editors[n].component[t]=e}}),this.editors[n].component=document.createElement(this.editors[n].selector),this.editors[n].component.appendChild(s)),this.editors[n].component&&(this.editor=this.editors[n].component)}goBack(){this.lastEditor&&(this.editor=this.lastEditor,this.lastEditor=null,this.injected=!1,this._injectedForId=null)}createRenderRoot(){return this}render(){const t="rtl"===getComputedStyle(document.documentElement).getPropertyValue("--direction-locale").trim();return n.qy` ${this.lastEditor?n.qy`<div style="display:flex;justify-content:flex-start;padding:12px 16px 4px;direction:var(--direction-locale);">
5
- <span
6
- @click=${this.goBack}
7
- style="display:inline-flex;align-items:center;gap:3px;font-size:12px;color:#555;cursor:pointer;font-family:inherit;"
8
- @mouseover=${t=>{t.currentTarget.style.color="#333",t.currentTarget.style.textDecoration="underline"}}
9
- @mouseout=${t=>{t.currentTarget.style.color="#555",t.currentTarget.style.textDecoration="none"}}
10
- ><svg width="12" height="12" viewBox="0 0 24 24" style=${t?"transform:scaleX(-1)":""} fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg
11
- ><lang-text text="go_back"></lang-text
12
- ></span>
13
- </div>`:""}
4
+ ></cdtr-ilustration-preference>`,this.delayer=new r.A,this.connect=this.connect.bind(this),this.editors={block:{selector:"block-editor",load:()=>i.e(8299).then(i.bind(i,68299)),component:null},no_editor:{selector:"cdtr-no-component",load:()=>i.e(8854).then(i.bind(i,68854)),component:null,attrs:{style:"margin:auto;display:block;max-width:150px;margin-top:30px;"}}},this.type=null,n.Ay.on("select",this.connect)}connect(t){let{editor:e,component:i}=t;if(!e)return;let s=e.type;if("string"!=typeof s)return;const n=i?.id??null;if(this.injected){if(null==n||n===this._injectedForId)return;this.injected=!1,this._injectedForId=null}if(this._selectedComponentId=n,this.editor?.type===s)return;if(!this.editors[s]){const t=d.M.get("config","editor","configure","plugins");if(Array.isArray(t)){const e=t.find(t=>t.name===s);if(e&&"function"==typeof e.createEditor){this.editor=document.createElement("cdtr-editor-builder"),this.editor.type=s;const t=e.createEditor();return void(t&&(this.editor.editors=t.layout,t!==this.backToEditor&&this.lastEditor&&(this.lastEditor=null)))}}s="no_editor"}this.type=s;const r=(0,o.A)("div",null,(0,o.A)("cdtr-block-loader",null),(0,o.A)("cdtr-title",{style:"text-align:center;"},(0,o.A)("lang-text",{text:"please_wait_downloading_new_version"})));this.editors[s]&&!this.editors[s].component&&(this.editors[s].load().then(()=>{if(r.remove(),this.editors[s].attrs)for(const t in this.editors[s].attrs)if(Object.hasOwnProperty.call(this.editors[s].attrs,t)){const e=this.editors[s].attrs[t];this.editors[s].component[t]=e}}),this.editors[s].component=document.createElement(this.editors[s].selector),this.editors[s].component.appendChild(r)),this.editors[s].component&&(this.editor=this.editors[s].component)}goBack(){this.lastEditor&&(this.editor=this.lastEditor,this.lastEditor=null,this.injected=!1,this._injectedForId=null)}createRenderRoot(){return this}render(){return s.qy` ${this.lastEditor?(0,c.T)(this.goBack):""}
14
5
  ${this.editor}`}}l.properties={type:{type:String},editor:{type:Object},injected:{type:Boolean}},customElements.define("design-factory",l)}}]);
Binary file
@@ -0,0 +1 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[3600],{93600(t,e,n){var o=n(87348),i=n(47493),s=n(92384);const r=["animations","settings"],a=["presets","open_modal","icons"];function l(t){const e=String(t.weightValue||400);return{type:"dropdown",active:t.active,title:"fontWeight",value:e,selected:e,items:s.FONT_WEIGHTS.map(t=>({value:String(t.value)})),onChange:e=>t.onWeightChange({detail:{value:parseInt(e.target.value,10)}})}}function u(t){return e=>{const n=(0,i.A)(e);return{select:n.select,tabs:e=>n.tabs(e).filter(e=>!(r.includes(e.text)||"submit"===t&&"interactions"===e.text)),layout:e=>function(t,e){const n=[];let o=null;for(const i of t)i&&"heading"===i.type&&(o=i.text),a.includes(o)||(i&&"fontFamily"===i.type?n.push(l(i)):"submit"===e&&"text"===o&&i&&"custom"===i.type||n.push(i));return n}(n.layout(e),t)}}}const p=["300","400","500","600","700","800","900"],c=["left","center","right"];function d(t){let{component:e,commands:n}=t;const o=()=>e.props.style,i=t=>n.execCommand("style",t);return{select:()=>{},tabs:()=>[{text:"style",selected:!0}],layout:()=>[{type:"colorpicker",title:"font_color",value:o().color,onChange:t=>i({color:t.target.value})},{type:"slider",title:"fontSize",min:8,max:120,step:1,value:parseInt(o().fontSize)||16,onInput:t=>i({fontSize:t.target.value+"px"})},{type:"dropdown",title:"fontWeight",value:String(o().fontWeight||""),selected:String(o().fontWeight||""),items:p.map(t=>({value:t})),onChange:t=>i({fontWeight:t.target.value})},{type:"dropdown",title:"alignment",value:o().textAlign,selected:o().textAlign,items:c.map(t=>({value:t})),onChange:t=>i({textAlign:t.target.value})}]}}class h extends o.EditorBuilder{connectWith(){const{commands:t,helpers:e}=this.commandsBuilder();var n;this.type=this.target.type,this.component=this.target,this.props=this.target.props,this.editor=("text"===(n=this.target.kind)?d:u(n))({component:this.target,props:this.target.props,commands:t,helpers:e})}execCommandWrapper(t,e){this.target.execCommand(t,e)}shouldShowDesignControls(){return!1}getColElementData(){return null}updated(t){super.updated(t),t.has("target")&&this.connectWith()}}h.properties={...o.EditorBuilder.properties,target:{attribute:!1}},customElements.define("cdtr-ai-editor-builder",h)}}]);
Binary file
@@ -1,4 +1,4 @@
1
- "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[380,3847],{70380(t,e,i){i.r(e),i.d(e,{default:()=>u});var s=i(59929),o=i(21421),r=i(91597);const n="֑-߿יִ-﷽ﹰ-ﻼ",a="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",l=new RegExp("^[^"+a+"]*["+n+"]"),c=new RegExp("^[^"+n+"]*["+a+"]");var h=i(86319);const d=(0,r.S)();class u extends s.WF{constructor(){super(),this.inputRef=(0,o._)(),this.min=0,this.max=100,this.step=1,this.autofocus=!1,this.type="text",this.value="number"===this.type?"0":"",this.placeholder="",this.oldValue=this.value,this.successActive=!1,this._successTimeout=null}onSubmit(t){t.preventDefault();const e=new UIEvent("submit",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e),this.oldValue=this.value}focus(){const t=this.inputRef.value;t.focus(),t.setSelectionRange(t.value.length,t.value.length)}onFocus(){const t=new UIEvent("focus",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)}onBlur(){const t=new UIEvent("blur",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t),this.oldValue=this.value}render(){this.fullWidth&&(this.style.width="100%"),this.value||"text"!==this.type||(this.value=""),this.icon&&"string"!=typeof this.inputStyle&&(this.inputStyle="");const t=h.M.get("lang",this.placeholder)||this.placeholder||"";t&&("string"!=typeof this.inputStyle&&(this.inputStyle=""),-1===this.inputStyle.indexOf("text-align")&&(this.inputStyle+=";text-align:"+("rtl"===function(t){const e=String(t||"");return l.test(e)?"rtl":c.test(e)?"ltr":"neutral"}(t)?"right":"")));const e=this.multiline?s.qy` <textarea
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[380,3847],{70380(t,e,i){i.r(e),i.d(e,{default:()=>p});var s=i(59929),o=i(21421),r=i(91597);const n="֑-߿יִ-﷽ﹰ-ﻼ",a="A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿",l=new RegExp("^[^"+a+"]*["+n+"]"),c=new RegExp("^[^"+n+"]*["+a+"]");var h=i(86319);const d=(0,r.S)();class p extends s.WF{constructor(){super(),this.inputRef=(0,o._)(),this.min=0,this.max=100,this.step=1,this.autofocus=!1,this.type="text",this.value="number"===this.type?"0":"",this.placeholder="",this.oldValue=this.value,this.successActive=!1,this._successTimeout=null}onSubmit(t){t.preventDefault();const e=new UIEvent("submit",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(e),this.oldValue=this.value}focus(){const t=this.inputRef.value;t.focus(),t.setSelectionRange(t.value.length,t.value.length)}onFocus(){const t=new UIEvent("focus",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)}onBlur(){const t=new UIEvent("blur",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t),this.oldValue=this.value}render(){this.fullWidth&&(this.style.width="100%"),this.value||"text"!==this.type||(this.value=""),this.icon&&"string"!=typeof this.inputStyle&&(this.inputStyle="");const t=h.M.get("lang",this.placeholder)||this.placeholder||"";t&&("string"!=typeof this.inputStyle&&(this.inputStyle=""),-1===this.inputStyle.indexOf("text-align")&&(this.inputStyle+=";text-align:"+("rtl"===function(t){const e=String(t||"");return l.test(e)?"rtl":c.test(e)?"ltr":"neutral"}(t)?"right":"")));const e=this.multiline?s.qy` <textarea
2
2
  rows=${this.row||4}
3
3
  .disabled=${this.disabled}
4
4
  dir="auto"
@@ -49,7 +49,7 @@
49
49
  ${"text"===this.type&&this.maxLength?s.qy`<span class="counter"
50
50
  >${this.value.length}/${this.maxLength}</span
51
51
  > `:null}
52
- </form>`}firstUpdated(){this.autofocus&&setTimeout(()=>{this.inputRef.value&&this.inputRef.value.focus()},500),void 0===this.value&&(this.value="")}focus(){super.focus(),this.inputRef.value.focus()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null)}setValue(t){if(this.selectionStart=this.inputRef.value.selectionStart,!this.inputRef.value)return;const e=this.inputRef.value;if("text"===this.type&&this.max&&e.value.length>this.max)return e.value=this.value,void this.inputRef.value.focus();this.value=e.value;const i=new UIEvent(t.type,{view:window,bubbles:!0,cancelable:!0});if(this.dispatchEvent(i),"input"===t.type){const t=()=>{const t=new UIEvent("debounce",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)};d.run(t,500)}}success(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3;this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null),this.successActive=!0;const e=Number(t);!Number.isFinite(e)||e<=0||(this._successTimeout=setTimeout(()=>{this.successActive=!1,this._successTimeout=null},e))}patch(t){this.value=t}}u.styles=s.AH`
52
+ </form>`}firstUpdated(){this.autofocus&&setTimeout(()=>{this.inputRef.value&&this.inputRef.value.focus()},500),void 0===this.value&&(this.value="")}focus(){super.focus(),this.inputRef.value.focus()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null)}setValue(t){if(this.selectionStart=this.inputRef.value.selectionStart,!this.inputRef.value)return;const e=this.inputRef.value;if("text"===this.type&&this.max&&e.value.length>this.max)return e.value=this.value,void this.inputRef.value.focus();this.value=e.value;const i=new UIEvent(t.type,{view:window,bubbles:!0,cancelable:!0});if(this.dispatchEvent(i),"input"===t.type){const t=()=>{const t=new UIEvent("debounce",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)};d.run(t,500)}}success(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3;this._successTimeout&&(clearTimeout(this._successTimeout),this._successTimeout=null),this.successActive=!0;const e=Number(t);!Number.isFinite(e)||e<=0||(this._successTimeout=setTimeout(()=>{this.successActive=!1,this._successTimeout=null},e))}patch(t){this.value=t}}p.styles=s.AH`
53
53
  :host {
54
54
  display: inline-block;
55
55
  --cdtr-input-height: 30px;
@@ -185,7 +185,7 @@
185
185
  box-shadow: 0 0 10px rgba(79, 192, 111, 0.2);
186
186
  }
187
187
  }
188
- `,u.properties={value:{type:String,reflect:!0},step:{type:Number,reflect:!0},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0},type:{type:String,reflect:!0},inputDir:{type:String},icon:{type:String,reflect:!0},placeholder:{type:String,reflect:!0},autofocus:{type:Boolean,reflect:!0},fullWidth:{type:Boolean,reflect:!0},selectionStart:{type:Number},inputStyle:{type:String,reflect:!0},maxLength:{type:Number},couchOnEmpty:{type:Boolean},disabled:{type:Boolean},multiline:{type:Boolean},row:{type:Number},successActive:{type:Boolean}},customElements.get("cdtr-input")||customElements.define("cdtr-input",u)},73847(t,e,i){i.r(e),i.d(e,{LinkElement:()=>j});var s=i(59929),o=i(86319),r=i(88385);const n=s.AH`
188
+ `,p.properties={value:{type:String,reflect:!0},step:{type:Number,reflect:!0},min:{type:Number,reflect:!0},max:{type:Number,reflect:!0},type:{type:String,reflect:!0},inputDir:{type:String},icon:{type:String,reflect:!0},placeholder:{type:String,reflect:!0},autofocus:{type:Boolean,reflect:!0},fullWidth:{type:Boolean,reflect:!0},selectionStart:{type:Number},inputStyle:{type:String,reflect:!0},maxLength:{type:Number},couchOnEmpty:{type:Boolean},disabled:{type:Boolean},multiline:{type:Boolean},row:{type:Number},successActive:{type:Boolean}},customElements.get("cdtr-input")||customElements.define("cdtr-input",p)},73847(t,e,i){i.r(e),i.d(e,{LinkElement:()=>F});var s=i(59929),o=i(86319),r=i(88385);const n=s.AH`
189
189
  :host {
190
190
  --paper-radio-button-checked-color: var(--primary);
191
191
  box-sizing: border-box;
@@ -290,8 +290,38 @@
290
290
  .input-wrapper cdtr-input {
291
291
  display: block;
292
292
  }
293
+ .compact {
294
+ display: grid;
295
+ gap: 8px;
296
+ }
297
+ .compact-row {
298
+ display: grid;
299
+ gap: 8px;
300
+ }
301
+ .compact-row cdtr-row {
302
+ width: 100%;
303
+ }
304
+ .compact-tab {
305
+ display: flex;
306
+ align-items: center;
307
+ gap: 8px;
308
+ font-size: 12.5px;
309
+ color: var(--color-text-secondary, #555);
310
+ cursor: pointer;
311
+ }
312
+ .compact-tab cdtr-checkbox {
313
+ flex: none;
314
+ }
315
+ /* the email/SMS extra fields are drawn 260px wide; in a tight panel they fill the space instead */
316
+ .compact cdtr-input {
317
+ width: 100% !important;
318
+ }
319
+ .compact .explain-title {
320
+ margin-top: 4px;
321
+ }
293
322
  .explain-title {
294
- margin: 20px 0 6px;
323
+ display: block;
324
+ margin: 12px 0 6px;
295
325
  }
296
326
  paper-item {
297
327
  text-align: var(--text-align-locale);
@@ -520,7 +550,7 @@
520
550
  margin-top: 0.75rem;
521
551
  padding-left: 1rem;
522
552
  }
523
- `;var a=i(21421);i(73095),i(70380);const l="260px",c=[{type:"https:",text:"link"},{type:"http:",text:"link"},{type:"mailto:",text:"sendEmail"},{type:"tel:",text:"tel"},{type:"sms:",text:"sendSms"},{type:"whatsapp:",text:"sendWhatsapp"},{type:"anchor:",text:"anchor"}],h="cdtrAdd",d="cdtrRemove",u="cdtrAutomation",p=[h,d,u];var m=i(73813);function f(t,e){t=t.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}const g="anchor",b="linkpicker:anchor";function y(){const t=new Set;return function(){const t=o.M.get("components");return Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t).filter(t=>t&&"object"==typeof t):[]}().forEach(e=>{const i=e&&e.props;i&&(i.anchor&&i.anchor.name&&t.add(String(i.anchor.name)),e.type===g&&i.name&&t.add(String(i.name)))}),t}let x=null,v=null;const w="cdtr:anchor-attached";function $(){let{onCreated:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};k();const e=function(){const t=y();let e=1;for(;t.has(`${g}-${e}`);)e++;return`${g}-${e}`}(),i={id:b,name:g,group:"elements",body:{type:g,props:{name:e,color:"#6b7280"}}},s=document.createElement("div");return s.setAttribute("data-id",b),s.setAttribute("data-group","elements"),s.setAttribute("data-placement",""),s.setAttribute("draggable-element","create:element"),s.setAttribute("draggable-direction","top,bottom,left,right"),s.classList.add("draggable-element-handle"),s.__template=i,window.__dragoned_selected_element=s,x=s,"function"==typeof t&&(v=function(t){let e=!1;const i=i=>{const s=i&&i.detail&&i.detail.name;!e&&s&&(e=!0,o(),v=null,t(s))},s=()=>{setTimeout(()=>{e||(o(),v=null)},0)};function o(){window.removeEventListener(w,i),document.removeEventListener("mouseup",s,!0)}return window.addEventListener(w,i),document.addEventListener("mouseup",s,!0),o}(t)),s}function k(){x&&window.__dragoned_selected_element===x&&delete window.__dragoned_selected_element,x=null,v&&(v(),v=null)}function A(t){let{onRequest:e,onChangeLink:i,onBlur:r}=t;return function(){const t=o.M.get("config","editor","configure","plugins");return!!Array.isArray(t)&&t.some(t=>t&&t.name===g)}()?s.qy`
553
+ `;var a=i(21421);i(73095),i(70380);const l="260px",c=[{type:"https:",text:"link"},{type:"http:",text:"link"},{type:"mailto:",text:"sendEmail"},{type:"tel:",text:"tel"},{type:"sms:",text:"sendSms"},{type:"whatsapp:",text:"sendWhatsapp"},{type:"anchor:",text:"anchor"}],h="cdtrAdd",d="cdtrRemove",p="cdtrAutomation",u=[h,d,p];var m=i(73813);function g(t,e){t=t.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}const f="anchor",b="linkpicker:anchor";function y(){const t=new Set;return function(){const t=o.M.get("components");return Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t).filter(t=>t&&"object"==typeof t):[]}().forEach(e=>{const i=e&&e.props;i&&(i.anchor&&i.anchor.name&&t.add(String(i.anchor.name)),e.type===f&&i.name&&t.add(String(i.name)))}),t}let x=null,v=null;const w="cdtr:anchor-attached";function $(){let{onCreated:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};k();const e=function(){const t=y();let e=1;for(;t.has(`${f}-${e}`);)e++;return`${f}-${e}`}(),i={id:b,name:f,group:"elements",body:{type:f,props:{name:e,color:"#6b7280"}}},s=document.createElement("div");return s.setAttribute("data-id",b),s.setAttribute("data-group","elements"),s.setAttribute("data-placement",""),s.setAttribute("draggable-element","create:element"),s.setAttribute("draggable-direction","top,bottom,left,right"),s.classList.add("draggable-element-handle"),s.__template=i,window.__dragoned_selected_element=s,x=s,"function"==typeof t&&(v=function(t){let e=!1;const i=i=>{const s=i&&i.detail&&i.detail.name;!e&&s&&(e=!0,o(),v=null,t(s))},s=()=>{setTimeout(()=>{e||(o(),v=null)},0)};function o(){window.removeEventListener(w,i),document.removeEventListener("mouseup",s,!0)}return window.addEventListener(w,i),document.addEventListener("mouseup",s,!0),o}(t)),s}function k(){x&&window.__dragoned_selected_element===x&&delete window.__dragoned_selected_element,x=null,v&&(v(),v=null)}function A(t){let{onRequest:e,onChangeLink:i,onBlur:r}=t;return function(){const t=o.M.get("config","editor","configure","plugins");return!!Array.isArray(t)&&t.some(t=>t&&t.name===f)}()?s.qy`
524
554
  <div class="anchor-create">
525
555
  <div
526
556
  class="anchor-drag draggable-element-handle"
@@ -571,7 +601,7 @@
571
601
  </cdtr-dropdown>
572
602
  ${A({onRequest:a,onChangeLink:r,onBlur:n})}
573
603
  </cdtr-row>
574
- `}(e);case"mailto:":return function(t){const{href:e,body:i,subject:o,onBlur:r,updateBody:n,updateSubject:a}=t,c="string"==typeof e?f("body",e):i||e.params.body,h="string"==typeof e?f("subject",e):o||e.params.subject;return s.qy`
604
+ `}(e);case"mailto:":return function(t){const{href:e,body:i,subject:o,onBlur:r,updateBody:n,updateSubject:a}=t,c="string"==typeof e?g("body",e):i||e.params.body,h="string"==typeof e?g("subject",e):o||e.params.subject;return s.qy`
575
605
  <cdtr-row spacing="5">
576
606
  <cdtr-title class="explain-title"
577
607
  ><lang-text text="add_catchy_subject"></lang-text
@@ -592,7 +622,7 @@
592
622
  @change=${t=>{let{target:e}=t;n(e.value),r()}}
593
623
  ></cdtr-input>
594
624
  </cdtr-row>
595
- `}(e);case"sms:":return function(t){const{href:e,body:i,onBlur:o,updateBody:r}=t,n="string"==typeof e?f("body",e):e.params.body;return s.qy`
625
+ `}(e);case"sms:":return function(t){const{href:e,body:i,onBlur:o,updateBody:r}=t,n="string"==typeof e?g("body",e):e.params.body;return s.qy`
596
626
  <cdtr-row spacing="5">
597
627
  <cdtr-title class="explain-title"
598
628
  ><lang-text text="sms_body_if_needed"></lang-text
@@ -604,7 +634,7 @@
604
634
  @change=${t=>{let{target:e}=t;r(e.value),o()}}
605
635
  ></cdtr-input>
606
636
  </cdtr-row>
607
- `}(e);case"whatsapp:":return function(t){const{href:e,body:i,onBlur:o,updateBody:r}=t,n="string"==typeof e?f("text",e)||f("body",e):e.params&&(e.params.text||e.params.body)||"";return s.qy`
637
+ `}(e);case"whatsapp:":return function(t){const{href:e,body:i,onBlur:o,updateBody:r}=t,n="string"==typeof e?g("text",e)||g("body",e):e.params&&(e.params.text||e.params.body)||"";return s.qy`
608
638
  <cdtr-row spacing="5">
609
639
  <cdtr-title class="explain-title"
610
640
  ><lang-text text="whatsapp_body_if_needed"></lang-text
@@ -616,14 +646,14 @@
616
646
  @change=${t=>{let{target:e}=t;r(e.value),o()}}
617
647
  ></cdtr-input>
618
648
  </cdtr-row>
619
- `}(e);default:return""}}function S(t,e,i,s,o,n){if(!t)return null;const a="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t);return t?"whatsapp:"===e||"whatsapp:"===a.protocol?function(t,e,i,s,o){const n="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t),a=(n.params&&(n.params.phone||function(t){try{const e=/whatsapp:([^?]+)/,i=t.match(e);return i?i[1]:""}catch(t){return""}}(n.fullHref))||f("phone",n.href||"")||n.url||"").replace(/\D+/g,"");if(!a)return null;const l=s||n.params&&(n.params.text||n.params.body)||"",c=l?encodeURIComponent(l):"";let h=`https://wa.me/${a}`;c&&(h+=`?text=${c}`);const d=new r.A(h);return d.target=o||d.target||"_blank",{url:d,params:d.params,protocol:"whatsapp:"}}(t,e,i,s,n):(a.isEmail?function(t,e,i){let s=!1;e?t.addParam("subject",e):t.params&&"subject"in t.params&&(delete t.params.subject,s=!0),i?t.addParam("body",i):t.params&&"body"in t.params&&(delete t.params.body,s=!0),s&&(t.href=t.getUrlWithParams())}(a,o,s):s?a.addParam("body",s):a.params&&"body"in a.params&&(delete a.params.body,a.href=a.getUrlWithParams()),a.target=n||a.target||"_blank",{url:a,params:a.params,protocol:a.protocol}):null}function L(t,e,i){if(!t)return{href:{},protocol:null,body:"",subject:""};if(t.startsWith("http")&&!t.startsWith("http://")&&!t.startsWith("https://"))return null;const s=r.A.getProtocol(t);let o=e;s&&(o=s+":");const n=new r.A({href:t,protocol:o||null});console.log("output",n);const a=(i instanceof r.A?i:new r.A(i)).url!==n.url;return{href:n,protocol:n.protocol,shouldBlur:n.isValid,clearParams:a}}function R(){const t=o.M.get("components"),e=Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t):[],i=function(t){const e=new Map;t.forEach(t=>{const i=t&&(t.id||t._id);i&&e.set(i,t)});const i=t.find(t=>t&&"root"===t.type),s=i&&(i.id||i._id);if(!s)return null;const o=new Set,r=t=>{if(!t||o.has(t))return;o.add(t);const i=e.get(t);i&&[].concat(Array.isArray(i.children)?i.children:[]).concat(Array.isArray(i.elements)?i.elements:[]).forEach(t=>r((t=>t?"string"==typeof t?t:t.id||t.dataset&&t.dataset.id||null:null)(t)))};return r(s),o}(e),s=i?e.filter(t=>t&&i.has(t.id||t._id)):e,r=new Set,n=[],a=(t,e,i)=>{e&&!r.has(e)&&(r.add(e),n.push({id:t,name:e,label:i||e}))};return s.forEach(t=>{const e=t&&t.props;e&&(e.anchor&&e.anchor.name?a(t.id,e.anchor.name,e.anchor.label):"anchor"===t.type&&e.name?a(t.id,e.name):e.element_ID&&a(t.id,e.element_ID))}),n}function U(t){const{value:e="",inputRef:i,autofocus:o=!1,onChange:r,onBlur:n,onFocus:c,onKeyDown:h,placeholder:d="",inputStyle:u="",style:p="width:260px;",width:m=l}=t,f=t=>{r&&r(t),n&&n()},g=(()=>{if(null==e||""===e)return"";try{return decodeURI(String(e))||""}catch{return String(e)}})();return s.qy`
649
+ `}(e);default:return""}}function S(t){const{value:e="",inputRef:i,autofocus:o=!1,onChange:r,onBlur:n,onFocus:c,onKeyDown:h,placeholder:d="",inputStyle:p="",style:u="width:260px;",width:m=l,coach:g=!0}=t,f=t=>{r&&r(t),n&&n()},b=(()=>{if(null==e||""===e)return"";try{return decodeURI(String(e))||""}catch{return String(e)}})();return s.qy`
620
650
  <cdtr-row style="position:relative;" spacing="5">
621
651
  <span style="display:none;" aria-hidden="true">${e}</span>
622
652
  <cdtr-input
623
- .couchOnEmpty=${!0}
653
+ .couchOnEmpty=${g}
624
654
  ${i?(0,a.K)(i):""}
625
- style="${p}"
626
- inputStyle="${u}"
655
+ style="${u}"
656
+ inputStyle="${p}"
627
657
  .autofocus=${o}
628
658
  type="search"
629
659
  width="${m}"
@@ -632,10 +662,44 @@
632
662
  @change=${f}
633
663
  @focus=${c}
634
664
  @submit=${h||f}
635
- .value="${g}"
665
+ .value="${b}"
636
666
  ></cdtr-input>
637
667
  </cdtr-row>
638
- `}const M="automation:";function C(){return s.qy`
668
+ `}function L(t,e,i,s,o,n){if(!t)return null;const a="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t);return t?"whatsapp:"===e||"whatsapp:"===a.protocol?function(t,e,i,s,o){const n="string"==typeof t?new r.A({href:t,protocol:e,params:i}):new r.A(t);let a=n.params&&(n.params.phone||function(t){try{const e=/whatsapp:([^?]+)/,i=t.match(e);return i?i[1]:""}catch(t){return""}}(n.fullHref))||g("phone",n.href||"")||n.url||"";try{a=decodeURIComponent(a)}catch(t){}const l=a.replace(/\D+/g,"");if(!l)return null;const c=s||n.params&&(n.params.text||n.params.body)||"",h=c?encodeURIComponent(c):"";let d=`https://wa.me/${l}`;h&&(d+=`?text=${h}`);const p=new r.A(d);return p.target=o||p.target||"_blank",{url:p,params:p.params,protocol:"whatsapp:"}}(t,e,i,s,n):(a.isEmail?function(t,e,i){let s=!1;e?t.addParam("subject",e):t.params&&"subject"in t.params&&(delete t.params.subject,s=!0),i?t.addParam("body",i):t.params&&"body"in t.params&&(delete t.params.body,s=!0),s&&(t.href=t.getUrlWithParams())}(a,o,s):s?a.addParam("body",s):a.params&&"body"in a.params&&(delete a.params.body,a.href=a.getUrlWithParams()),a.target=n||a.target||"_blank",{url:a,params:a.params,protocol:a.protocol}):null}function R(t,e,i){if(!t)return{href:{},protocol:null,body:"",subject:""};if(t.startsWith("http")&&!t.startsWith("http://")&&!t.startsWith("https://"))return null;const s=r.A.getProtocol(t);let o=e;s&&(o=s+":");const n=new r.A({href:t,protocol:o||null});console.log("output",n);const a=(i instanceof r.A?i:new r.A(i)).url!==n.url;return{href:n,protocol:n.protocol,shouldBlur:n.isValid,clearParams:a}}function U(){const t=o.M.get("components"),e=Array.isArray(t)?t:t&&"object"==typeof t?Object.values(t):[],i=function(t){const e=new Map;t.forEach(t=>{const i=t&&(t.id||t._id);i&&e.set(i,t)});const i=t.find(t=>t&&"root"===t.type),s=i&&(i.id||i._id);if(!s)return null;const o=new Set,r=t=>{if(!t||o.has(t))return;o.add(t);const i=e.get(t);i&&[].concat(Array.isArray(i.children)?i.children:[]).concat(Array.isArray(i.elements)?i.elements:[]).forEach(t=>r((t=>t?"string"==typeof t?t:t.id||t.dataset&&t.dataset.id||null:null)(t)))};return r(s),o}(e),s=i?e.filter(t=>t&&i.has(t.id||t._id)):e,r=new Set,n=[],a=(t,e,i)=>{e&&!r.has(e)&&(r.add(e),n.push({id:t,name:e,label:i||e}))};return s.forEach(t=>{const e=t&&t.props;e&&(e.anchor&&e.anchor.name?a(t.id,e.anchor.name,e.anchor.label):"anchor"===t.type&&e.name?a(t.id,e.name):e.element_ID&&a(t.id,e.element_ID))}),n}const C="automation:";function M(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return s.qy`
669
+ <cdtr-dropdown @change=${t=>i(t.target.value)}>
670
+ <cdtr-dropdown-button
671
+ minWidth=${100}
672
+ class=" dropdown-button"
673
+ slot="trigger"
674
+ ><lang-text
675
+ .text="${t.find(t=>t.type===e)?.text||"link"}"
676
+ ></lang-text>
677
+ </cdtr-dropdown-button>
678
+ <div slot="content">
679
+ ${t.map(t=>s.qy`<cdtr-dropdown-item
680
+ .focused=${t.type===e}
681
+ .selected=${t.type===e}
682
+ value="${t.type}"
683
+ ><lang-text text="${t.text}"></lang-text>
684
+ </cdtr-dropdown-item>`)}
685
+ ${o.length?s.qy`<cdtr-dropdown-item value="${C}" class="special-links-item">
686
+ <span class="special-links-label">
687
+ <span class="special-links-title">
688
+ <svg viewBox="0 0 24 24" aria-hidden="true">
689
+ <path d="M13 2 4.5 13.5H11L10 22l8.5-11.5H12L13 2Z" />
690
+ </svg>
691
+ <lang-text text="link_automations_title"></lang-text>
692
+ </span>
693
+ <span class="special-links-desc">
694
+ ${o.map((t,e)=>s.qy`${e>0?" · ":""}<lang-text
695
+ text="${t.name}"
696
+ ></lang-text>`)}
697
+ </span>
698
+ </span>
699
+ </cdtr-dropdown-item>`:null}
700
+ </div>
701
+ </cdtr-dropdown>
702
+ `}function q(){return s.qy`
639
703
  <style>
640
704
  .save-success-container {
641
705
  margin-bottom: 1rem;
@@ -746,23 +810,23 @@
746
810
  </span>
747
811
  </div>
748
812
  </div>
749
- `}function q(){const t=o.M.get("config","editor","configure","editorProps","automations")||{},e=[];return t.addAndRemoveFromMailingList&&e.push({id:"addAndRemoveFromMailingList",name:"moving_from_mailing_list",description:"automation_desc_mailing_list",icon:"lists"}),t.unsubscribe&&e.push({id:"unsubscribe",name:"unsubscribe",description:"automation_desc_unsubscribe",icon:"unsubscribe"}),e}const B={lists:s.qy`<svg viewBox="0 0 24 24" aria-hidden="true">
813
+ `}function B(){const t=o.M.get("config","editor","configure","editorProps","automations")||{},e=[];return t.addAndRemoveFromMailingList&&e.push({id:"addAndRemoveFromMailingList",name:"moving_from_mailing_list",description:"automation_desc_mailing_list",icon:"lists"}),t.unsubscribe&&e.push({id:"unsubscribe",name:"unsubscribe",description:"automation_desc_unsubscribe",icon:"unsubscribe"}),e}const I={lists:s.qy`<svg viewBox="0 0 24 24" aria-hidden="true">
750
814
  <path d="M4 6h11M4 12h11M4 18h7M18 15v6M15 18h6" />
751
815
  </svg>`,unsubscribe:s.qy`<svg viewBox="0 0 24 24" aria-hidden="true">
752
816
  <rect x="3" y="5" width="18" height="14" rx="2" />
753
817
  <path d="m3 7 9 6 9-6M15 16l4-4M19 16l-4-4" />
754
- </svg>`},I=s.qy`<svg class="crumb-sep" viewBox="0 0 24 24" aria-hidden="true">
818
+ </svg>`},j=s.qy`<svg class="crumb-sep" viewBox="0 0 24 24" aria-hidden="true">
755
819
  <path d="m9 6 6 6-6 6" />
756
- </svg>`;customElements.get("paper-button")||Promise.resolve().then(i.bind(i,39239)),customElements.get("cdtr-emoji-picker")||i.e(3105).then(i.t.bind(i,63105,23));class j extends(function(t){return class extends t{initAutomations(){this.showAutomations=!1,this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.activeTab="add",this.baseUrl="",this.showSaveSuccess=!1;const t=o.M.get("config","editor","configure","editorProps","mailingLists","items");this.mailingLists=t||[],this.automations=q()}onAutomationsClick(){if(this.automations=q(),this.showAutomations=!0,this.protocol="automation:",this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.href&&this.href.href){const t=this.href.href;if((0,m.r_)(t))this.parseAutomationLink(this.href);else{const t=new r.A(this.href);t.params&&t.params[u]?(this.baseUrl=this.extractBaseUrl(t),this.parseAutomationLink(t)):this.baseUrl=t.href||""}}else this.baseUrl="";this.requestUpdate()}extractBaseUrl(t){const e=[];t.protocol&&e.push(t.protocol),t.host&&(e.push("//"),e.push(t.host)),t.pathname&&e.push(t.pathname);const i=p,s=[];t.params&&Object.keys(t.params).forEach(e=>{if(!i.includes(e)){const i=t.params[e];s.push(`${e}=${encodeURIComponent(i)}`)}});let o=e.join("");return s.length>0&&(o+=`?${s.join("&")}`),t.href}onBackClick(){if(this.selectedAutomation)this.selectedAutomation=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null;else if(this.showAutomations=!1,this.activeAutomationId=null,"automation:"===this.protocol)if(this.baseUrl){const t=new r.A(this.baseUrl);this.href=t,this.protocol=t.protocol}else this.protocol=null,this.href={};this.requestUpdate()}exitAutomations(){this.selectedAutomation&&this.onBackClick(),this.onBackClick()}renderAutomationsBreadcrumb(){const t=[{text:"link",onClick:()=>this.exitAutomations()}];return this.selectedAutomation?(t.push({text:"link_automations_title",onClick:()=>this.onBackClick()}),t.push({text:this.selectedAutomation.name})):t.push({text:"link_automations_title"}),s.qy`<nav class="automation-crumbs" aria-label="breadcrumb">
820
+ </svg>`;customElements.get("paper-button")||Promise.resolve().then(i.bind(i,39239)),customElements.get("cdtr-emoji-picker")||i.e(3105).then(i.t.bind(i,63105,23));class F extends(function(t){return class extends t{initAutomations(){this.showAutomations=!1,this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.activeTab="add",this.baseUrl="",this.showSaveSuccess=!1;const t=o.M.get("config","editor","configure","editorProps","mailingLists","items");this.mailingLists=t||[],this.automations=B()}onAutomationsClick(){if(this.automations=B(),this.showAutomations=!0,this.protocol="automation:",this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.href&&this.href.href){const t=this.href.href;if((0,m.r_)(t))this.parseAutomationLink(this.href);else{const t=new r.A(this.href);t.params&&t.params[p]?(this.baseUrl=this.extractBaseUrl(t),this.parseAutomationLink(t)):this.baseUrl=t.href||""}}else this.baseUrl="";this.requestUpdate()}extractBaseUrl(t){const e=[];t.protocol&&e.push(t.protocol),t.host&&(e.push("//"),e.push(t.host)),t.pathname&&e.push(t.pathname);const i=u,s=[];t.params&&Object.keys(t.params).forEach(e=>{if(!i.includes(e)){const i=t.params[e];s.push(`${e}=${encodeURIComponent(i)}`)}});let o=e.join("");return s.length>0&&(o+=`?${s.join("&")}`),t.href}onBackClick(){if(this.selectedAutomation)this.selectedAutomation=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null;else if(this.showAutomations=!1,this.activeAutomationId=null,"automation:"===this.protocol)if(this.baseUrl){const t=new r.A(this.baseUrl);this.href=t,this.protocol=t.protocol}else this.protocol=null,this.href={};this.requestUpdate()}exitAutomations(){this.selectedAutomation&&this.onBackClick(),this.onBackClick()}renderAutomationsBreadcrumb(){const t=[{text:"link",onClick:()=>this.exitAutomations()}];return this.selectedAutomation?(t.push({text:"link_automations_title",onClick:()=>this.onBackClick()}),t.push({text:this.selectedAutomation.name})):t.push({text:"link_automations_title"}),s.qy`<nav class="automation-crumbs" aria-label="breadcrumb">
757
821
  ${t.map((t,e)=>s.qy`
758
- ${e>0?I:null}
822
+ ${e>0?j:null}
759
823
  ${t.onClick?s.qy`<button type="button" class="crumb" @click=${t.onClick}>
760
824
  <lang-text text="${t.text}"></lang-text>
761
825
  </button>`:s.qy`<span class="crumb current" aria-current="page">
762
826
  <lang-text text="${t.text}"></lang-text>
763
827
  </span>`}
764
828
  `)}
765
- </nav>`}onAutomationClick(t){this.selectedAutomation=t,this.activeAutomationId=t.id,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.requestUpdate()}onActionSelect(t){this.automationAction===t?this.automationAction=null:this.automationAction=t,this.requestUpdate()}onTabChange(t){this.activeTab=t,this.requestUpdate()}onMailingListToggle(t,e){("add"===e?this.selectedMailingListsForAdd:this.selectedMailingListsForRemove).indexOf(t)>-1?"add"===e?this.selectedMailingListsForAdd=this.selectedMailingListsForAdd.filter(e=>e!==t):this.selectedMailingListsForRemove=this.selectedMailingListsForRemove.filter(e=>e!==t):"add"===e?this.selectedMailingListsForAdd=[...this.selectedMailingListsForAdd,t]:this.selectedMailingListsForRemove=[...this.selectedMailingListsForRemove,t],this.requestUpdate()}createAutomationLink(){if(!this.selectedAutomation)return null;const t=this.selectedAutomation.name||this.selectedAutomation.id;if("unsubscribe"===this.selectedAutomation.id)return(0,m.LX)(t);const e={};if(this.selectedMailingListsForAdd.length>0&&(e[h]=this.selectedMailingListsForAdd.join(",")),this.selectedMailingListsForRemove.length>0&&(e[d]=this.selectedMailingListsForRemove.join(",")),0===Object.keys(e).length)return null;if(this.baseUrl&&this.baseUrl.trim()){let t=this.baseUrl.trim();t.match(/^https?:\/\//i)||t.includes("://")||!t.includes(".")&&t.match(/^[a-zA-Z]+:/)||(t=`https://${t}`),e.url=t}return(0,m.LX)(t,e)}onSaveAutomation(){const t=this.createAutomationLink();if(!t)return;console.log("Saving automation link:",t);const e=(0,m.IW)(t);if(!e)return void console.error("Invalid automation link format:",t);const i=e.name,s=e.params,o=s.url;let n;if(delete s.url,n=o?new r.A(o):new r.A("https://example.com"),n.params||(n.params={}),s[h]&&(n.params[h]=s[h]),s[d]&&(n.params[d]=s[d]),n.params[u]=i,n.href=t,n.url=o||"",this.href=n,this.protocol=null,this.value=n,this.link=n,this.lastUrl=n,console.log("Set href to:",this.href),console.log("Set href.href to:",this.href?.href),this.onDispatch(),console.log("After dispatch, href:",this.href),console.log("After dispatch, href.href:",this.href?.href),console.log("After dispatch, href.params:",this.href?.params),this.href&&(!this.href.params||!this.href.params[u])){console.log("Restoring automation params after dispatch");const t=this.href.href||this.href,e=(0,m.IW)(String(t));if(e){const i=e.params,s=i.url,o=s?new r.A(s):new r.A("https://example.com");o.params||(o.params={}),i[h]&&(o.params[h]=i[h]),i[d]&&(o.params[d]=i[d]),o.params[u]=e.name,o.href=t,o.url=s||"",this.href=o,this.value=o,this.link=o,this.lastUrl=o,console.log("Restored href:",this.href?.href),console.log("Restored params:",this.href?.params)}}this.showSaveSuccess=!0,this.requestUpdate(),setTimeout(()=>{this.showSaveSuccess=!1,this.requestUpdate()},2e3)}parseAutomationLink(t){if(!t)return;let e=null,i=!1,s=t.href||t;const o="string"==typeof s?(0,m.IW)(s):null;if(o?(i=!0,e=o.name):t.params&&(e=t.params[u],i=e&&""!==e&&"string"==typeof e&&""!==e.trim()),!i)return;if(o){const t=o.params;if(t.url?this.baseUrl=t.url:this.baseUrl="",t[h]){const e="string"==typeof t[h]?t[h].split(",").filter(t=>t.trim()):Array.isArray(t[h])?t[h]:[];this.selectedMailingListsForAdd=e}if(t[d]){const e="string"==typeof t[d]?t[d].split(",").filter(t=>t.trim()):Array.isArray(t[d])?t[d]:[];this.selectedMailingListsForRemove=e}}else if(t.params){const e=this.extractBaseUrl(t);if(this.baseUrl=e,t.params[h]){const e="string"==typeof t.params[h]?t.params[h].split(",").filter(t=>t.trim()):Array.isArray(t.params[h])?t.params[h]:[];this.selectedMailingListsForAdd=e}if(t.params[d]){const e="string"==typeof t.params[d]?t.params[d].split(",").filter(t=>t.trim()):Array.isArray(t.params[d])?t.params[d]:[];this.selectedMailingListsForRemove=e}}const r=String(e).trim(),n=(this.automations||[]).find(t=>t.name&&String(t.name).trim()===r||t.id&&String(t.id).trim()===r);if(this.selectedMailingListsForAdd.length>0||this.selectedMailingListsForRemove.length>0||"unsubscribe"===n?.id){this.showAutomations=!0;const t=n||this.automations?.[0];t&&(this.selectedAutomation=t,this.activeAutomationId=t.id)}}renderAutomationsView(){return this.selectedAutomation?this.renderAutomationDetails():s.qy`
829
+ </nav>`}onAutomationClick(t){this.selectedAutomation=t,this.activeAutomationId=t.id,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.requestUpdate()}onActionSelect(t){this.automationAction===t?this.automationAction=null:this.automationAction=t,this.requestUpdate()}onTabChange(t){this.activeTab=t,this.requestUpdate()}onMailingListToggle(t,e){("add"===e?this.selectedMailingListsForAdd:this.selectedMailingListsForRemove).indexOf(t)>-1?"add"===e?this.selectedMailingListsForAdd=this.selectedMailingListsForAdd.filter(e=>e!==t):this.selectedMailingListsForRemove=this.selectedMailingListsForRemove.filter(e=>e!==t):"add"===e?this.selectedMailingListsForAdd=[...this.selectedMailingListsForAdd,t]:this.selectedMailingListsForRemove=[...this.selectedMailingListsForRemove,t],this.requestUpdate()}createAutomationLink(){if(!this.selectedAutomation)return null;const t=this.selectedAutomation.name||this.selectedAutomation.id;if("unsubscribe"===this.selectedAutomation.id)return(0,m.LX)(t);const e={};if(this.selectedMailingListsForAdd.length>0&&(e[h]=this.selectedMailingListsForAdd.join(",")),this.selectedMailingListsForRemove.length>0&&(e[d]=this.selectedMailingListsForRemove.join(",")),0===Object.keys(e).length)return null;if(this.baseUrl&&this.baseUrl.trim()){let t=this.baseUrl.trim();t.match(/^https?:\/\//i)||t.includes("://")||!t.includes(".")&&t.match(/^[a-zA-Z]+:/)||(t=`https://${t}`),e.url=t}return(0,m.LX)(t,e)}onSaveAutomation(){const t=this.createAutomationLink();if(!t)return;console.log("Saving automation link:",t);const e=(0,m.IW)(t);if(!e)return void console.error("Invalid automation link format:",t);const i=e.name,s=e.params,o=s.url;let n;if(delete s.url,n=o?new r.A(o):new r.A("https://example.com"),n.params||(n.params={}),s[h]&&(n.params[h]=s[h]),s[d]&&(n.params[d]=s[d]),n.params[p]=i,n.href=t,n.url=o||"",this.href=n,this.protocol=null,this.value=n,this.link=n,this.lastUrl=n,console.log("Set href to:",this.href),console.log("Set href.href to:",this.href?.href),this.onDispatch(),console.log("After dispatch, href:",this.href),console.log("After dispatch, href.href:",this.href?.href),console.log("After dispatch, href.params:",this.href?.params),this.href&&(!this.href.params||!this.href.params[p])){console.log("Restoring automation params after dispatch");const t=this.href.href||this.href,e=(0,m.IW)(String(t));if(e){const i=e.params,s=i.url,o=s?new r.A(s):new r.A("https://example.com");o.params||(o.params={}),i[h]&&(o.params[h]=i[h]),i[d]&&(o.params[d]=i[d]),o.params[p]=e.name,o.href=t,o.url=s||"",this.href=o,this.value=o,this.link=o,this.lastUrl=o,console.log("Restored href:",this.href?.href),console.log("Restored params:",this.href?.params)}}this.showSaveSuccess=!0,this.requestUpdate(),setTimeout(()=>{this.showSaveSuccess=!1,this.requestUpdate()},2e3)}parseAutomationLink(t){if(!t)return;let e=null,i=!1,s=t.href||t;const o="string"==typeof s?(0,m.IW)(s):null;if(o?(i=!0,e=o.name):t.params&&(e=t.params[p],i=e&&""!==e&&"string"==typeof e&&""!==e.trim()),!i)return;if(o){const t=o.params;if(t.url?this.baseUrl=t.url:this.baseUrl="",t[h]){const e="string"==typeof t[h]?t[h].split(",").filter(t=>t.trim()):Array.isArray(t[h])?t[h]:[];this.selectedMailingListsForAdd=e}if(t[d]){const e="string"==typeof t[d]?t[d].split(",").filter(t=>t.trim()):Array.isArray(t[d])?t[d]:[];this.selectedMailingListsForRemove=e}}else if(t.params){const e=this.extractBaseUrl(t);if(this.baseUrl=e,t.params[h]){const e="string"==typeof t.params[h]?t.params[h].split(",").filter(t=>t.trim()):Array.isArray(t.params[h])?t.params[h]:[];this.selectedMailingListsForAdd=e}if(t.params[d]){const e="string"==typeof t.params[d]?t.params[d].split(",").filter(t=>t.trim()):Array.isArray(t.params[d])?t.params[d]:[];this.selectedMailingListsForRemove=e}}const r=String(e).trim(),n=(this.automations||[]).find(t=>t.name&&String(t.name).trim()===r||t.id&&String(t.id).trim()===r);if(this.selectedMailingListsForAdd.length>0||this.selectedMailingListsForRemove.length>0||"unsubscribe"===n?.id){this.showAutomations=!0;const t=n||this.automations?.[0];t&&(this.selectedAutomation=t,this.activeAutomationId=t.id)}}renderAutomationsView(){return this.selectedAutomation?this.renderAutomationDetails():s.qy`
766
830
  <div class="automations-view">
767
831
  ${this.renderAutomationsBreadcrumb()}
768
832
  <div class="automations-list">
@@ -772,14 +836,14 @@
772
836
  class="automation-card ${e?"active":""}"
773
837
  @click=${()=>this.onAutomationClick(t)}
774
838
  >
775
- <span class="automation-card-icon">${B[t.icon]}</span>
839
+ <span class="automation-card-icon">${I[t.icon]}</span>
776
840
  <span class="automation-card-text">
777
841
  <span class="automation-card-title"><lang-text text="${t.name}"></lang-text></span>
778
842
  ${t.description?s.qy`<span class="automation-card-desc"
779
843
  ><lang-text whiteSpace="break-spaces" text="${t.description}"></lang-text
780
844
  ></span>`:null}
781
845
  </span>
782
- ${I}
846
+ ${j}
783
847
  </button>
784
848
  `})}
785
849
  </div>
@@ -795,7 +859,7 @@
795
859
 
796
860
  <div class="automation-content">
797
861
  <!-- Success Message -->
798
- ${this.showSaveSuccess?C():null}
862
+ ${this.showSaveSuccess?q():null}
799
863
 
800
864
  <h6
801
865
  class="explain-title"
@@ -839,7 +903,7 @@
839
903
 
840
904
  <div class="automation-content">
841
905
  <!-- Success Message -->
842
- ${this.showSaveSuccess?C():null}
906
+ ${this.showSaveSuccess?q():null}
843
907
 
844
908
  <!-- URL Input (Optional) -->
845
909
  <div style="margin-bottom: 1.5rem;">
@@ -848,7 +912,7 @@
848
912
  >
849
913
  <lang-text text="url"></lang-text> (Optional)
850
914
  </cdtr-title>
851
- ${U({value:this.baseUrl||"",onChange:t=>{const e=t.target.value||"",i=L(e,null,this.baseUrl?new r.A(this.baseUrl):{});null===i?this.baseUrl=e:i.href?i.href instanceof r.A?this.baseUrl=i.href.href||e:"string"==typeof i.href?this.baseUrl=i.href:this.baseUrl=e:this.baseUrl=e,this.requestUpdate()},placeholder:"https://example.com",inputStyle:"height: 40px; padding: 0.5rem; border: 1px solid #e0e0e0; border-radius: 4px; width: 100%;",style:"width: 100%;"})}
915
+ ${S({value:this.baseUrl||"",onChange:t=>{const e=t.target.value||"",i=R(e,null,this.baseUrl?new r.A(this.baseUrl):{});null===i?this.baseUrl=e:i.href?i.href instanceof r.A?this.baseUrl=i.href.href||e:"string"==typeof i.href?this.baseUrl=i.href:this.baseUrl=e:this.baseUrl=e,this.requestUpdate()},placeholder:"https://example.com",inputStyle:"height: 40px; padding: 0.5rem; border: 1px solid #e0e0e0; border-radius: 4px; width: 100%;",style:"width: 100%;"})}
852
916
  </div>
853
917
 
854
918
  <h6
@@ -1014,53 +1078,36 @@
1014
1078
  </cdtr-row>
1015
1079
  </div>
1016
1080
  </div>
1017
- `}}}(s.WF)){constructor(){super(),this.inputRef=(0,a._)(),this.onBlur=this.onBlur.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.urlInputFocused=!1,this._urlInputRawValue="",this._lastSyncedMyHref=void 0,this._lastBodySyncHref=void 0,this.lastUrl=void 0,this.target="_blank",this.anchors=[],this.event=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0}),this.options=c,this.body="",this.subject="",this.name=o.M.get("lang",c[0].text),this.initAutomations()}onDispatch(){const t=function(t){const{href:e,protocol:i,params:s,body:o,subject:r,target:n,dispatchEvent:a,event:l}=t;if(!e)return a(l),{dispatched:!0};const c=S(e,i,s,o,r,n);return c?{dispatched:!0,href:c.url,protocol:c.protocol,params:c.params,value:c.url,link:c.url,lastUrl:c.url}:{dispatched:!1}}({href:this.href,protocol:this.protocol,params:this.params,body:this.body,subject:this.subject,target:this.target,dispatchEvent:this.dispatchEvent.bind(this),event:this.event});if(t.dispatched){if(t.href){this.href=t.href,this.protocol=t.protocol,this.params=t.params?{...t.params}:{},this.value=t.value,this.link=t.link,this.lastUrl=t.lastUrl;const e="string"==typeof t.href?t.href:t.href?.href;this._urlInputRawValue=null!=e&&""!==e?String(e):""}this.dispatchEvent(this.event)}}onChangeLink(t){const e=t.target.value;this._urlInputRawValue=e;const i=L(e,this.protocol,this.href);null!==i?(this.href=i.href,this.protocol=i.protocol,i.clearParams&&(this.body="",this.subject=""),void 0!==i.body&&(this.body=i.body),void 0!==i.subject&&(this.subject=i.subject),i.shouldBlur&&this.onBlur()):this.href=e}onKeyDown(t){if("submit"===t.type){const t=this.inputRef?.value;void 0!==t?.value&&this.onChangeLink({target:{value:t.value}}),t&&"function"==typeof t.success&&t.success(),this.onDispatch()}}onUrlInputFocus(){const t=this.inputRef?.value?.value;null!=t&&(this._urlInputRawValue=t),this.urlInputFocused=!0}onUrlInputBlur(){this.urlInputFocused=!1,this.hasButton||this.onDispatch()}onBlur(){this.hasButton||this.onDispatch()}onClickOk(){this.onDispatch()}onChangeTarget(t){const e={target:t.target.value};this.target=e.target,t.stopPropagation(),!this.hasButton&&this.href&&this.onBlur()}resolveAnchors(){this.anchors=R()}onChangeType(t){if(t===M)return void this.onAutomationsClick();const e=function(t,e,i,s){const o=e.find(e=>e.type===t);if(!o)return{forceProtocolChange:!1};const r="anchor"===o.text,n=s!==o.type;return setTimeout(()=>{i&&i.value&&i.value.focus()},500),{protocol:o.type,forceProtocolChange:!0,shouldResolveAnchors:r,clearParams:n}}(t,this.options,this.inputRef,this.protocol);if(e.shouldResolveAnchors&&this.resolveAnchors(),this.protocol=e.protocol,this.forceProtocolChange=e.forceProtocolChange,e.clearParams&&(this.body="",this.subject=""),e.forceProtocolChange){const t=new r.A(this.href,{protocol:this.protocol});t.protocol=this.protocol,this.href=t,this.onBlur()}}connectedCallback(){super.connectedCallback(),this.href=new r.A(this.href);const t=String(this.href?.href||""),e=(0,m.r_)(t),i=this.href&&this.href.params&&this.href.params[u];(e||i)&&this.parseAutomationLink(this.href)}render(){const t=o.M.get("config","editor","configure","editorProps","linkPicker","savedVariables");this.resolveAnchors();const e=this.lastUrl!==this.href,i=new r.A(this.href,{protocol:e?null:this.protocol});this.protocol&&!e?i.protocol=this.protocol:i.protocol&&(this.protocol=i.protocol);const n=String(this.href?.href||this.href||"");if(this._lastBodySyncHref!==n){const t=void 0===this._lastBodySyncHref;this._lastBodySyncHref=n,i.params?(this.body=i.params.text||i.params.body||"",this.subject=i.params.subject||""):(this.body="",this.subject="");(0,m.r_)(n)||i.params&&i.params[u]?(this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.showAutomations=!0,this.parseAutomationLink(this.href)):(this.showAutomations=!1,this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,t&&this.openAutomations&&q().length&&this.onAutomationsClick())}const l=function(t,e,i){let s=[];return t.isEmail?s=[]:t.isPhone?s=i.filter(t=>("tel:"===t.type||"sms:"===t.type||"whatsapp:"===t.type)&&t.type!==e):-1!==t.href.indexOf("http://")&&"https:"!==e&&(s=[{type:"https:",text:o.M.get("lang","is_user_wants_https"),reccomanded:!0}]),"anchor:"===e&&(s=[]),s}(i,this.protocol,this.options);let c=i.href;const h=String(i.href||""),d=(0,m.r_)(h),f=i.params&&i.params[u];if(d)c=h;else if(f){const t=p,e=[];i.params&&Object.keys(i.params).forEach(s=>{if(!t.includes(s)){const t=i.params[s];e.push(`${s}=${encodeURIComponent(t).replace(/%24/g,"$")}`)}});const s=i.url||"";c=i.protocol?"http:"===i.protocol||"https:"===i.protocol?`${i.protocol}//${s}`:`${i.protocol}${s}`:s,e.length>0&&(c+=`?${e.join("&")}`)}const g=function(t){switch(t){case"mailto:":return"what_the_email_address";case"tel:":return"what_the_phone_number";case"sms:":case"whatsapp:":return"what_the_phone_number_to_send_msg";case"anchor:":return"what_the_anchor_name";case"file:":return"what_the_file_name";default:return"what_the_url_address"}}(this.protocol),b=[...this.options],y=b.findIndex(t=>"http:"===t.type);y>-1&&b.splice(y,1);const x=q(),v={url:i,href:this.href,protocol:this.protocol,anchors:this.anchors,body:this.body,subject:this.subject,onChangeLink:this.onChangeLink.bind(this),onBlur:this.onBlur.bind(this),onRequest:this.onRequest,updateBody:t=>{this.body=t},updateSubject:t=>{this.subject=t}},w=null!=c&&""!==c?String(c):"",$=this._urlInputRawValue!==w,k=void 0!==this._lastSyncedMyHref&&w!==this._lastSyncedMyHref,A=this.urlInputFocused&&this._urlInputRawValue&&w&&!k;$&&!A?(this._urlInputRawValue=w,this._lastSyncedMyHref=w):$||(this._lastSyncedMyHref=w);const S=this.urlInputFocused&&void 0!==this._urlInputRawValue?this._urlInputRawValue:c,L={protocol:this.protocol,url:i,autofocus:this.autofocus,inputRef:(0,a.K)(this.inputRef),onChangeLink:this.onChangeLink.bind(this),onBlur:this.onUrlInputBlur.bind(this),onFocus:this.onUrlInputFocus.bind(this),onKeyDown:this.onKeyDown.bind(this),myHref:S},R="rtl"===getComputedStyle(this).getPropertyValue("--direction-locale").trim();return this.showAutomations?s.qy` <div class="root ${R?"rtl":""}">${this.renderAutomationsView()}</div>`:s.qy` <div class="root">
1018
- ${z=this.label,z?s.qy`<cdtr-title
1081
+ `}}}(s.WF)){constructor(){super(),this.inputRef=(0,a._)(),this.onBlur=this.onBlur.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.urlInputFocused=!1,this._urlInputRawValue="",this._lastSyncedMyHref=void 0,this._lastBodySyncHref=void 0,this.lastUrl=void 0,this.target="_blank",this.anchors=[],this.event=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0}),this.options=c,this.body="",this.subject="",this.name=o.M.get("lang",c[0].text),this.initAutomations()}onDispatch(){this.event=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0});const t=function(t){const{href:e,protocol:i,params:s,body:o,subject:r,target:n,dispatchEvent:a,event:l}=t;if(!e)return a(l),{dispatched:!0};const c=L(e,i,s,o,r,n);return c?{dispatched:!0,href:c.url,protocol:c.protocol,params:c.params,value:c.url,link:c.url,lastUrl:c.url}:{dispatched:!1}}({href:this.href,protocol:this.protocol,params:this.params,body:this.body,subject:this.subject,target:this.target,dispatchEvent:this.dispatchEvent.bind(this),event:this.event});if(t.dispatched){if(t.href){this.href=t.href,this.protocol=t.protocol,this.params=t.params?{...t.params}:{},this.value=t.value,this.link=t.link,this.lastUrl=t.lastUrl;const e="string"==typeof t.href?t.href:t.href?.href;this._urlInputRawValue=null!=e&&""!==e?String(e):""}this.dispatchEvent(this.event)}}onChangeLink(t){const e=t.target.value;this._urlInputRawValue=e;const i=R(e,this.protocol,this.href);null!==i?(this.href=i.href,this.protocol=i.protocol,i.clearParams&&(this.body="",this.subject=""),void 0!==i.body&&(this.body=i.body),void 0!==i.subject&&(this.subject=i.subject),i.shouldBlur&&this.onBlur()):this.href=e}onKeyDown(t){if("submit"===t.type){const t=this.inputRef?.value;void 0!==t?.value&&this.onChangeLink({target:{value:t.value}}),t&&"function"==typeof t.success&&t.success(),this.onDispatch()}}onUrlInputFocus(){const t=this.inputRef?.value?.value;null!=t&&(this._urlInputRawValue=t),this.urlInputFocused=!0}onUrlInputBlur(){this.urlInputFocused=!1,this.hasButton||this.onDispatch()}onBlur(){this.hasButton||this.onDispatch()}onClickOk(){this.onDispatch()}onChangeTarget(t){const e={target:t.target.value};this.target=e.target,t.stopPropagation(),!this.hasButton&&this.href&&this.onBlur()}resolveAnchors(){this.anchors=U()}onChangeType(t){if(t===C)return void this.onAutomationsClick();const e=function(t,e,i,s){const o=e.find(e=>e.type===t);if(!o)return{forceProtocolChange:!1};const r="anchor"===o.text,n=s!==o.type;return setTimeout(()=>{i&&i.value&&i.value.focus()},500),{protocol:o.type,forceProtocolChange:!0,shouldResolveAnchors:r,clearParams:n}}(t,this.options,this.inputRef,this.protocol);if(e.shouldResolveAnchors&&this.resolveAnchors(),this.protocol=e.protocol,this.forceProtocolChange=e.forceProtocolChange,e.clearParams&&(this.body="",this.subject=""),this.compact&&e.clearParams)return this.href="",this.params={},void(this._urlInputRawValue="");if(e.forceProtocolChange){const t=new r.A(this.href,{protocol:this.protocol});t.protocol=this.protocol,this.href=t,this.onBlur()}}connectedCallback(){super.connectedCallback(),this.href=new r.A(this.href);const t=String(this.href?.href||""),e=(0,m.r_)(t),i=this.href&&this.href.params&&this.href.params[p];(e||i)&&this.parseAutomationLink(this.href)}render(){const t=o.M.get("config","editor","configure","editorProps","linkPicker","savedVariables");this.resolveAnchors();const e=this.lastUrl!==this.href,i=new r.A(this.href,{protocol:e?null:this.protocol});this.protocol&&!e?i.protocol=this.protocol:i.protocol&&(this.protocol=i.protocol);const n=String(this.href?.href||this.href||"");if(this._lastBodySyncHref!==n){const t=void 0===this._lastBodySyncHref;this._lastBodySyncHref=n,i.params?(this.body=i.params.text||i.params.body||"",this.subject=i.params.subject||""):(this.body="",this.subject="");(0,m.r_)(n)||i.params&&i.params[p]?(this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,this.showAutomations=!0,this.parseAutomationLink(this.href)):(this.showAutomations=!1,this.selectedAutomation=null,this.activeAutomationId=null,this.selectedMailingLists=[],this.selectedMailingListsForAdd=[],this.selectedMailingListsForRemove=[],this.automationAction=null,t&&this.openAutomations&&B().length&&this.onAutomationsClick())}const l=function(t,e,i){let s=[];return t.isEmail?s=[]:t.isPhone?s=i.filter(t=>("tel:"===t.type||"sms:"===t.type||"whatsapp:"===t.type)&&t.type!==e):-1!==t.href.indexOf("http://")&&"https:"!==e&&(s=[{type:"https:",text:o.M.get("lang","is_user_wants_https"),reccomanded:!0}]),"anchor:"===e&&(s=[]),s}(i,this.protocol,this.options);let c=i.href;const h=String(i.href||""),d=(0,m.r_)(h),g=i.params&&i.params[p];if(d)c=h;else if(g){const t=u,e=[];i.params&&Object.keys(i.params).forEach(s=>{if(!t.includes(s)){const t=i.params[s];e.push(`${s}=${encodeURIComponent(t).replace(/%24/g,"$")}`)}});const s=i.url||"";c=i.protocol?"http:"===i.protocol||"https:"===i.protocol?`${i.protocol}//${s}`:`${i.protocol}${s}`:s,e.length>0&&(c+=`?${e.join("&")}`)}const f=function(t){switch(t){case"mailto:":return"what_the_email_address";case"tel:":return"what_the_phone_number";case"sms:":case"whatsapp:":return"what_the_phone_number_to_send_msg";case"anchor:":return"what_the_anchor_name";case"file:":return"what_the_file_name";default:return"what_the_url_address"}}(this.protocol),b=[...this.options],y=b.findIndex(t=>"http:"===t.type);y>-1&&b.splice(y,1);const x=B(),v={url:i,href:this.href,protocol:this.protocol,anchors:this.anchors,body:this.body,subject:this.subject,onChangeLink:this.onChangeLink.bind(this),onBlur:this.onBlur.bind(this),onRequest:this.onRequest,updateBody:t=>{this.body=t},updateSubject:t=>{this.subject=t}},w=null!=c&&""!==c?String(c):"",$=this._urlInputRawValue!==w,k=void 0!==this._lastSyncedMyHref&&w!==this._lastSyncedMyHref,A=this.urlInputFocused&&this._urlInputRawValue&&w&&!k;$&&!A?(this._urlInputRawValue=w,this._lastSyncedMyHref=w):$||(this._lastSyncedMyHref=w);const L=this.urlInputFocused&&void 0!==this._urlInputRawValue?this._urlInputRawValue:c,R={protocol:this.protocol,url:i,autofocus:this.autofocus,inputRef:(0,a.K)(this.inputRef),onChangeLink:this.onChangeLink.bind(this),onBlur:this.onUrlInputBlur.bind(this),onFocus:this.onUrlInputFocus.bind(this),onKeyDown:this.onKeyDown.bind(this),myHref:L},U="rtl"===getComputedStyle(this).getPropertyValue("--direction-locale").trim();if(this.showAutomations)return s.qy` <div class="root ${U?"rtl":""}">${this.renderAutomationsView()}</div>`;if(this.compact){const t=!this.protocol||"https:"===this.protocol||"http:"===this.protocol;return s.qy`<div class="compact">
1082
+ <div class="compact-row">
1083
+ ${M(b,this.protocol,this.onChangeType.bind(this),x)}
1084
+ ${"anchor:"===this.protocol?null:S({...R,value:L,onChange:R.onChangeLink,placeholder:o.M.get("lang",f)||"",style:"width:100%;--cdtr-input-height:32px;",width:"100%",coach:!1})}
1085
+ </div>
1086
+ ${_(this.protocol,v)}
1087
+ ${t?s.qy`<div
1088
+ class="compact-tab"
1089
+ @click=${t=>{t.target.closest("cdtr-checkbox")||t.currentTarget.querySelector("cdtr-checkbox").toggle()}}
1090
+ >
1091
+ <cdtr-checkbox
1092
+ .controlled=${!1}
1093
+ .checked=${"_blank"===this.target}
1094
+ @change=${t=>this.onChangeTarget({target:{value:t.currentTarget.checked?"_blank":"_self"},stopPropagation(){}})}
1095
+ ></cdtr-checkbox>
1096
+ <lang-text text="open_in_new_tab"></lang-text>
1097
+ </div>`:null}
1098
+ </div>`}return s.qy` <div class="root">
1099
+ ${E=this.label,E?s.qy`<cdtr-title
1019
1100
  style="font-weight: 700;
1020
1101
  font-size: 14.4px;
1021
1102
  margin-bottom: 0.6rem;
1022
1103
  color: #000000b0;"
1023
- ><lang-text text=${z}></lang-text
1104
+ ><lang-text text=${E}></lang-text
1024
1105
  ><cdtr-divider></cdtr-divider
1025
1106
  ></cdtr-title>`:null}
1026
1107
  <cdtr-row alignItems="center" justify="space-between" spacing="10">
1027
- ${function(t,e,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return s.qy`
1028
- <cdtr-dropdown @change=${t=>i(t.target.value)}>
1029
- <cdtr-dropdown-button
1030
- minWidth=${100}
1031
- class=" dropdown-button"
1032
- slot="trigger"
1033
- ><lang-text
1034
- .text="${t.find(t=>t.type===e)?.text||"link"}"
1035
- ></lang-text>
1036
- </cdtr-dropdown-button>
1037
- <div slot="content">
1038
- ${t.map(t=>s.qy`<cdtr-dropdown-item
1039
- .focused=${t.type===e}
1040
- .selected=${t.type===e}
1041
- value="${t.type}"
1042
- ><lang-text text="${t.text}"></lang-text>
1043
- </cdtr-dropdown-item>`)}
1044
- ${o.length?s.qy`<cdtr-dropdown-item value="${M}" class="special-links-item">
1045
- <span class="special-links-label">
1046
- <span class="special-links-title">
1047
- <svg viewBox="0 0 24 24" aria-hidden="true">
1048
- <path d="M13 2 4.5 13.5H11L10 22l8.5-11.5H12L13 2Z" />
1049
- </svg>
1050
- <lang-text text="link_automations_title"></lang-text>
1051
- </span>
1052
- <span class="special-links-desc">
1053
- ${o.map((t,e)=>s.qy`${e>0?" · ":""}<lang-text
1054
- text="${t.name}"
1055
- ></lang-text>`)}
1056
- </span>
1057
- </span>
1058
- </cdtr-dropdown-item>`:null}
1059
- </div>
1060
- </cdtr-dropdown>
1061
- `}(this.options,this.protocol,this.onChangeType.bind(this),x)}
1062
- ${F=this.target,E=this.onChangeTarget.bind(this),s.qy`
1063
- <cdtr-dropdown @change=${t=>E(t)} style="min-width: 120px;">
1108
+ ${M(this.options,this.protocol,this.onChangeType.bind(this),x)}
1109
+ ${F=this.target,T=this.onChangeTarget.bind(this),s.qy`
1110
+ <cdtr-dropdown @change=${t=>T(t)} style="min-width: 120px;">
1064
1111
  <cdtr-dropdown-button minWidth=${120} class="dropdown-button" slot="trigger">
1065
1112
  <lang-text .text=${F}></lang-text>
1066
1113
  </cdtr-dropdown-button>
@@ -1091,9 +1138,9 @@
1091
1138
 
1092
1139
  <div class="input-wrapper">
1093
1140
  <cdtr-title class="explain-title"
1094
- ><lang-text .text="${g}"></lang-text
1141
+ ><lang-text .text="${f}"></lang-text
1095
1142
  ></cdtr-title>
1096
- ${function(t){const{protocol:e,url:i,autofocus:s,inputRef:o,onChangeLink:r,onBlur:n,onFocus:a,onKeyDown:l,myHref:c}=t;return"anchor:"===e?null:U({value:c,inputRef:o,autofocus:s,onChange:r,onBlur:n,onFocus:a,onKeyDown:l})}(L)}
1143
+ ${function(t){const{protocol:e,url:i,autofocus:s,inputRef:o,onChangeLink:r,onBlur:n,onFocus:a,onKeyDown:l,myHref:c}=t;return"anchor:"===e?null:S({value:c,inputRef:o,autofocus:s,onChange:r,onBlur:n,onFocus:a,onKeyDown:l})}(R)}
1097
1144
  ${_(this.protocol,v)}
1098
1145
  ${function(t,e,i,o){return t&&Array.isArray(t)&&0!==t.length?s.qy`<cdtr-list-picker
1099
1146
  .selected=${e}
@@ -1103,10 +1150,10 @@
1103
1150
  ></cdtr-list-picker>`:null}(t,c,this.onChangeLink.bind(this),this.onBlur.bind(this))}
1104
1151
  </div>
1105
1152
 
1106
- ${C=this.hasButton,B=this.onClickOk.bind(this),C?s.qy`<hr style="margin: 1rem 0; border: none; border-top: 1px solid #e0e0e0;">
1153
+ ${C=this.hasButton,q=this.onClickOk.bind(this),C?s.qy`<hr style="margin: 1rem 0; border: none; border-top: 1px solid #e0e0e0;">
1107
1154
  <cdtr-row justify="flex-end" mt="1">
1108
- <paper-button fullWidth @click=${B} raised class="add-button">
1155
+ <paper-button fullWidth @click=${q} raised class="add-button">
1109
1156
  <lang-text text="add_now"></lang-text>
1110
1157
  </paper-button>
1111
1158
  </cdtr-row>`:null}
1112
- </div>`;var C,B,I,j,F,E,z}}j.styles=n,j.properties={href:{type:String,reflect:!0},value:{type:Object},protocol:{type:String},name:{type:String},label:{type:String},target:{type:String},hasButton:{type:Boolean},params:{type:Object},explain:{type:String},anchors:{type:Array},link:{},body:{type:String},subject:{type:String},autofocus:{type:Boolean},onRequest:{type:Function},openAutomations:{type:Boolean}},customElements.get("cdtr-link-element")||customElements.define("cdtr-link-element",j)},88385(t,e,i){i.d(e,{A:()=>a});const s=t=>!(!t||!t.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)),o=t=>!(!t||!t.replace("-","").match(/^[+]*[(]{0,1}[0-9]{9,9}[)]{0,1}[-\s\./0-9]*$/g)&&!t.match(/[0-9]{3}-[0-9]{3}-[0-9]{4}/));function r(t){const e={},i=/([^&=]+)=?([^&]*)/g,s=t=>{try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ")}},o=t.indexOf("?");let r,n=-1!==o?t.substring(o+1):"";for(;null!==(r=i.exec(n));){const t=s(r[1]),i=s(r[2]);t&&(e[t]=i)}return e}function n(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],encodeURIComponent(e).replace(/%24/g,"$")}class a{static getProtocol(t){if(!t)return"";const e=t.indexOf(":");return e>0?t.slice(0,e):""}constructor(t,e){if(this.protocol="",this.href="",this.fullHref="",this.target="_self",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.url="",this.isValid=!0,this.params={},"string"==typeof t?this.href=t:t&&"object"==typeof t&&Object.assign(this,t),/^\[\[[^\]]+\]\](?:\?|$)/.test(this.href)){const t=this.href;this.isValid=!1,this.protocol=e?.protocol??"",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.params={...this.params,...e?.params,...r(t)};const i=t.indexOf("?");return this.url=i>-1?t.slice(0,i):t,this.href=t,void(this.fullHref=t)}this.isValid=this.isValidUrl(this.href),this.protocol=e?.protocol||this.protocol||a.getProtocol(this.href);const i=function(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],e}(this.href);if(this.isEmail=s(i),this.isPhone=o(i),this.protocol||(this.isEmail?this.protocol="mailto:":this.isPhone?this.protocol="tel:":this.isValid&&(this.protocol="https:")),this.isAnchor=this.href.startsWith("#"),e?.target){if(!["_blank","_self","_parent","_top"].includes(e.target))throw new Error(`Url: invalid target "${e.target}"`);this.target=e.target}this.params={...this.params,...e?.params,...r(this.href)},this.url=n(this.href),this.protocol&&!this.protocol.endsWith(":")&&(this.protocol+=":");const l="http:"===this.protocol||"https:"===this.protocol;this.href=l?`${this.protocol}//${this.url}`:this.protocol+this.url,this.fullHref=this.getUrlWithParams(),this.href=this.getUrlWithParams(),this.isAnchor="anchor:"===this.protocol||this.href.startsWith("#")}addParam(t,e){this.params[t]=e,this.href=this.getUrlWithParams()}getUrlWithParams(){let t,e="";try{t=decodeURIComponent(this.url)}catch(e){t=this.url}if(Object.keys(this.params).length>0){t+="?",e="?";for(const i in this.params){const s=this.params[i],o=encodeURIComponent(i).replace(/%24/g,"$");if(s){const i=encodeURIComponent(s).replace(/%24/g,"$");t+=`${o}=${i}&`,e+=`${o}=${i}&`}else t+=`${o}&`,e+=`${o}&`}t=t.slice(0,-1)}const i=t=>{try{return decodeURIComponent(t)}catch{return t}};if(this.protocol&&("http:"===this.protocol||"https:"===this.protocol))return i(this.protocol+"//"+t);if(this.isAnchor||"anchor:"===this.protocol)return t?i(t.startsWith("#")?t:`#${t}`):"";if("whatsapp:"===this.protocol){const s=this.extractPhoneFromTextUsingRegex(t);return s.length>0?i("https://wa.me/"+s[0]+e):i("https://wa.me/"+e)}return i(this.protocol+t)}extractPhoneFromTextUsingRegex(t){if(!t)return[];const e=[...t.matchAll(/(?:whatsapp:([^?\s]+)|\+?[\d\s\-\(\)\.]{7,20})/g)];return Array.from(new Set(e.map(t=>t[1]||t[0]).filter(t=>{const e=t.replace(/\D/g,"");return e.length>=7&&e.length<=15}).map(t=>t.trim())))}isValidUrl(t){if(!t)return!1;return/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(t)}}a.resetURL=n}}]);
1159
+ </div>`;var C,q,I,j,F,T,E}}F.styles=n,F.properties={href:{type:String,reflect:!0},value:{type:Object},protocol:{type:String},name:{type:String},label:{type:String},target:{type:String},hasButton:{type:Boolean},params:{type:Object},explain:{type:String},anchors:{type:Array},link:{},body:{type:String},subject:{type:String},autofocus:{type:Boolean},onRequest:{type:Function},openAutomations:{type:Boolean},compact:{type:Boolean}},customElements.get("cdtr-link-element")||customElements.define("cdtr-link-element",F)},88385(t,e,i){i.d(e,{A:()=>a});const s=t=>!(!t||!t.match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/)),o=t=>!(!t||!t.replace("-","").match(/^[+]*[(]{0,1}[0-9]{9,9}[)]{0,1}[-\s\./0-9]*$/g)&&!t.match(/[0-9]{3}-[0-9]{3}-[0-9]{4}/));function r(t){const e={},i=/([^&=]+)=?([^&]*)/g,s=t=>{try{return decodeURIComponent(t.replace(/\+/g," "))}catch(e){return t.replace(/\+/g," ")}},o=t.indexOf("?");let r,n=-1!==o?t.substring(o+1):"";for(;null!==(r=i.exec(n));){const t=s(r[1]),i=s(r[2]);t&&(e[t]=i)}return e}function n(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],encodeURIComponent(e).replace(/%24/g,"$")}class a{static getProtocol(t){if(!t)return"";const e=t.indexOf(":");return e>0?t.slice(0,e):""}constructor(t,e){if(this.protocol="",this.href="",this.fullHref="",this.target="_self",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.url="",this.isValid=!0,this.params={},"string"==typeof t?this.href=t:t&&"object"==typeof t&&Object.assign(this,t),/^\[\[[^\]]+\]\](?:\?|$)/.test(this.href)){const t=this.href;this.isValid=!1,this.protocol=e?.protocol??"",this.isEmail=!1,this.isPhone=!1,this.isAnchor=!1,this.params={...this.params,...e?.params,...r(t)};const i=t.indexOf("?");return this.url=i>-1?t.slice(0,i):t,this.href=t,void(this.fullHref=t)}this.isValid=this.isValidUrl(this.href),this.protocol=e?.protocol||this.protocol||a.getProtocol(this.href);const i=function(t){if(!t)return"";let e=t.replace(/^[^:]+:(?:\/\/)?/,"");return e=e.replace(/^\/+/,""),e=e.split("?")[0],e}(this.href);if(this.isEmail=s(i),this.isPhone=o(i),this.protocol||(this.isEmail?this.protocol="mailto:":this.isPhone?this.protocol="tel:":this.isValid&&(this.protocol="https:")),this.isAnchor=this.href.startsWith("#"),e?.target){if(!["_blank","_self","_parent","_top"].includes(e.target))throw new Error(`Url: invalid target "${e.target}"`);this.target=e.target}this.params={...this.params,...e?.params,...r(this.href)},this.url=n(this.href),this.protocol&&!this.protocol.endsWith(":")&&(this.protocol+=":");const l="http:"===this.protocol||"https:"===this.protocol;this.href=l?`${this.protocol}//${this.url}`:this.protocol+this.url,this.fullHref=this.getUrlWithParams(),this.href=this.getUrlWithParams(),this.isAnchor="anchor:"===this.protocol||this.href.startsWith("#")}addParam(t,e){this.params[t]=e,this.href=this.getUrlWithParams()}getUrlWithParams(){let t,e="";try{t=decodeURIComponent(this.url)}catch(e){t=this.url}if(Object.keys(this.params).length>0){t+="?",e="?";for(const i in this.params){const s=this.params[i],o=encodeURIComponent(i).replace(/%24/g,"$");if(s){const i=encodeURIComponent(s).replace(/%24/g,"$");t+=`${o}=${i}&`,e+=`${o}=${i}&`}else t+=`${o}&`,e+=`${o}&`}t=t.slice(0,-1)}const i=t=>{try{return decodeURIComponent(t)}catch{return t}};if(this.protocol&&("http:"===this.protocol||"https:"===this.protocol))return i(this.protocol+"//"+t);if(this.isAnchor||"anchor:"===this.protocol)return t?i(t.startsWith("#")?t:`#${t}`):"";if("whatsapp:"===this.protocol){const s=this.extractPhoneFromTextUsingRegex(t);return s.length>0?i("https://wa.me/"+s[0]+e):i("https://wa.me/"+e)}return i(this.protocol+t)}extractPhoneFromTextUsingRegex(t){if(!t)return[];const e=[...t.matchAll(/(?:whatsapp:([^?\s]+)|\+?[\d\s\-\(\)\.]{7,20})/g)];return Array.from(new Set(e.map(t=>t[1]||t[0]).filter(t=>{const e=t.replace(/\D/g,"");return e.length>=7&&e.length<=15}).map(t=>t.trim())))}isValidUrl(t){if(!t)return!1;return/^(https?:\/\/)?([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}(\/.*)?$/.test(t)}}a.resetURL=n}}]);
Binary file
@@ -0,0 +1 @@
1
+ "use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[4e3],{84e3(e,n,t){t.d(n,{default:()=>F});var r=t(47493);const o=e=>{let{helpers:n,editor:t,getFocused:r}=e;return{set:(e,o,i)=>{switch(o){case"style":return e[o]=n.deepMerge(e[o],i),!0;case"text":return e.text=i,r()||t.chain().setContent(i).run(),!0;case"ripple":case"rippleColor":case"scaleOnHover":case"hasIcon":case"iconUrl":case"iconSize":case"iconDirection":case"modalBlockId":return e[o]=i,!0;case"onClick":if(i.link)return e[o]=i,!0}}}};var i=t(72591),s=t.n(i),a=t(88639),l=t.n(a),c=t(88128),A=t.n(c),d=t(30855),u=t.n(d),p=t(93051),m=t.n(p),h=t(49536),E={};E.setAttributes=u(),E.insert=A().bind(null,"head"),E.domAPI=l(),E.insertStyleElement=m();s()(h.A,E);const C=h.A&&h.A.locals?h.A.locals:void 0;var b=t(81318),g=t(1366),f=t(67291),y=t(85194),B=t(28396);const x=b.YY.create({addKeyboardShortcuts:()=>({Enter:()=>!0})});const F=()=>{const e="button";return{name:e,create:n=>{const{createElement:t,compose:i,helpers:s}=n,{arrayToString:a,mergeDiff:l}=s;let c=!1;const A=document.createElement("div"),d=document.createElement("div"),{editor:u}=function(e){let{content:n,element:t}=e;return{element:t,editor:new b.KE({element:t,extensions:[g.A,f.A,B.A,y.Ay,x],content:n})}}({content:i.props.text,element:d});A.appendChild(d);u.view.dom.setAttribute("dir","auto");const p=()=>{let e="";try{e=u.getText()||""}catch(n){e=""}A.setAttribute("dir",function(e){if(!e)return null;for(const n of String(e)){if(/[\u0590-\u05FF\u0600-\u07BF\u0860-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF]/.test(n))return"rtl";if(/\p{L}/u.test(n))return"ltr"}return null}(e)||"ltr")};return p(),u.on("update",e=>{let{editor:n}=e;const t=n.getText();p(),i.editor.store().updateComponent(i,"text",t)}),u.on("focus",e=>{let{event:n,editor:t}=e;c=!0}),u.on("blur",e=>{let{event:n,editor:t}=e;c=!1}),A.className=C.button,t({name:e,id:i.id,template:A,commands:{insertContent:e=>{u.commands.insertContent(e),u.chain().focus()}},defaultProps:{style:{height:"auto",width:"200px",padding:"10px",borderRadius:"5px",fontFamily:"Arial",fontSize:"16px"},text:"button"},render:()=>{try{i.props.style.display="",i.props.style.direction=""}catch(e){console.error(e)}l(A,{style:i.props.style});const e=i.props.hasIcon,n=i.props.iconUrl,t=i.props.iconDirection,r=i.props.iconSize,o="icon_in_button";p();let s=A.querySelector(`.${o}`)||document.createElement("img");e&&n?(s.className=o,s.src=n,s.style.width=(r||16)+"px",s.style.height=(r||16)+"px",s.style.marginRight="8px",s.style.marginLeft="8px","right"===t?A.appendChild(s):A.insertBefore(s,A.firstChild)):s.remove()},draggable:{group:"element"},droppable:{group:"element"},resizeable:()=>A,resizeAxis:"xy",handleBar:!0,validator:o({template:A,helpers:s,editor:u,getFocused:function(){return c}}),schema:i.schema,onSelect:e=>{A.classList.add(e)},onDeselect:e=>{A.classList.remove(e)},elementProps:i,destroy:()=>{u.destroy()},remove:()=>{A.remove()},createEditor:r.A})}}}},49536(e,n,t){t.d(n,{A:()=>a});var r=t(82001),o=t.n(r),i=t(40935),s=t.n(i)()(o());s.push([e.id,".BEr8unIfy4OEGYhlHclN {\n cursor: text !important;\n}\n.BEr8unIfy4OEGYhlHclN {\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.BEr8unIfy4OEGYhlHclN p {\n margin: 0;\n line-height: 1;\n}\n.cI3RTMAdk9qoZ8mu9Sm9 {\n width: 100%;\n}\n.VSumPf0Ui7b1pl8cMATP {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.Vo2Ewnq6ekWFdNMjxBIB {\n left: -8px;\n cursor: w-resize;\n}\n.WLZC84sb1rfaRnHCDyj8 {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.BEr8unIfy4OEGYhlHclN .VSumPf0Ui7b1pl8cMATP {\n display: none;\n}\n.BEr8unIfy4OEGYhlHclN.Qh20ei1Fa8QUbGinFFbw .VSumPf0Ui7b1pl8cMATP {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n","",{version:3,sources:["webpack://./../web-editors/button-editor-component/lib/style.module.css"],names:[],mappings:"AAAA;EACE,uBAAuB;AAOzB;AARA;EAEE,eAAe;EACf,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,kBAAkB;EAClB,YAAY;AACd;AACA;EACE,SAAS;EACT,cAAc;AAChB;AACA;EACE,WAAW;AACb;AACA;EACE,kBAAkB;EAClB,UAAU;EACV,UAAU;EACV,WAAW;EACX,gCAAgC;EAChC,mBAAmB;AACrB;AACA;EACE,UAAU;EACV,gBAAgB;AAClB;AACA;EACE,sBAAsB;EACtB,gBAAgB;AAClB;;AAEA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;;;;;GAKG",sourcesContent:[".button {\n cursor: text !important;\n min-width: 30px;\n display: flex;\n justify-content: center;\n align-items: center;\n text-align: center;\n padding:10px;\n}\n.button p {\n margin: 0;\n line-height: 1;\n}\n.contentEditable {\n width: 100%;\n}\n.margin {\n position: absolute;\n z-index: 9;\n width: 3px;\n height: 90%;\n background: var(--resizer-color);\n border-radius: 20px;\n}\n.marginLeft {\n left: -8px;\n cursor: w-resize;\n}\n.marginRight {\n left: calc(100% + 5px);\n cursor: e-resize;\n}\n\n.button .margin {\n display: none;\n}\n.button.selected .margin {\n display: block;\n}\n/* .handle{\n display: none;\n}\n.button.selected .handle{\n display: block;\n} */\n"],sourceRoot:""}]),s.locals={button:"BEr8unIfy4OEGYhlHclN",contentEditable:"cI3RTMAdk9qoZ8mu9Sm9",margin:"VSumPf0Ui7b1pl8cMATP",marginLeft:"Vo2Ewnq6ekWFdNMjxBIB",marginRight:"WLZC84sb1rfaRnHCDyj8",selected:"Qh20ei1Fa8QUbGinFFbw"};const a=s},67291(e,n,t){t.d(n,{A:()=>o});var r=t(81318);const o=r.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",(0,r.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})}}]);
Binary file