@creaditor/web-starterkit 1.0.62 → 1.0.63

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 (202) hide show
  1. package/dist/112.creaditor.bundle.js.gz +0 -0
  2. package/dist/1142.creaditor.bundle.js.gz +0 -0
  3. package/dist/1204.creaditor.bundle.js.gz +0 -0
  4. package/dist/1271.creaditor.bundle.js.gz +0 -0
  5. package/dist/1317.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  6. package/dist/1317.creaditor.bundle.js.gz +0 -0
  7. package/dist/1334.creaditor.bundle.js.gz +0 -0
  8. package/dist/1396.creaditor.bundle.js.gz +0 -0
  9. package/dist/1403.creaditor.bundle.js.gz +0 -0
  10. package/dist/1456.creaditor.bundle.js.gz +0 -0
  11. package/dist/1529.creaditor.bundle.js.gz +0 -0
  12. package/dist/168.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  13. package/dist/168.creaditor.bundle.js.gz +0 -0
  14. package/dist/170.creaditor.bundle.js.gz +0 -0
  15. package/dist/175.creaditor.bundle.js.gz +0 -0
  16. package/dist/1972.creaditor.bundle.js.gz +0 -0
  17. package/dist/211.creaditor.bundle.js.gz +0 -0
  18. package/dist/2112.creaditor.bundle.js.gz +0 -0
  19. package/dist/2154.creaditor.bundle.js.gz +0 -0
  20. package/dist/2234.creaditor.bundle.js.gz +0 -0
  21. package/dist/2298.creaditor.bundle.js.gz +0 -0
  22. package/dist/235.creaditor.bundle.js.gz +0 -0
  23. package/dist/2350.creaditor.bundle.js.gz +0 -0
  24. package/dist/2377.creaditor.bundle.js.gz +0 -0
  25. package/dist/2384.creaditor.bundle.js.gz +0 -0
  26. package/dist/2397.creaditor.bundle.js.gz +0 -0
  27. package/dist/2409.creaditor.bundle.js.gz +0 -0
  28. package/dist/2547.creaditor.bundle.js.gz +0 -0
  29. package/dist/2550.creaditor.bundle.js.gz +0 -0
  30. package/dist/2590.creaditor.bundle.js.gz +0 -0
  31. package/dist/2655.creaditor.bundle.js.gz +0 -0
  32. package/dist/2706.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  33. package/dist/2706.creaditor.bundle.js.gz +0 -0
  34. package/dist/271.creaditor.bundle.js.gz +0 -0
  35. package/dist/2717.creaditor.bundle.js.gz +0 -0
  36. package/dist/2765.creaditor.bundle.js.gz +0 -0
  37. package/dist/2773.creaditor.bundle.js.gz +0 -0
  38. package/dist/2833.creaditor.bundle.js.gz +0 -0
  39. package/dist/2837.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  40. package/dist/2837.creaditor.bundle.js.gz +0 -0
  41. package/dist/2956.creaditor.bundle.js.gz +0 -0
  42. package/dist/2963.creaditor.bundle.js.gz +0 -0
  43. package/dist/3105.creaditor.bundle.js.gz +0 -0
  44. package/dist/3233.creaditor.bundle.js.gz +0 -0
  45. package/dist/3418.creaditor.bundle.js.gz +0 -0
  46. package/dist/3521.creaditor.bundle.js.gz +0 -0
  47. package/dist/353.creaditor.bundle.js.gz +0 -0
  48. package/dist/3545.creaditor.bundle.js.gz +0 -0
  49. package/dist/3553.creaditor.bundle.js.gz +0 -0
  50. package/dist/3601.creaditor.bundle.js +288 -0
  51. package/dist/3601.creaditor.bundle.js.gz +0 -0
  52. package/dist/3606.creaditor.bundle.js.gz +0 -0
  53. package/dist/3792.creaditor.bundle.js.gz +0 -0
  54. package/dist/380.creaditor.bundle.js.gz +0 -0
  55. package/dist/3827.creaditor.bundle.js.gz +0 -0
  56. package/dist/3847.creaditor.bundle.js +114 -67
  57. package/dist/3847.creaditor.bundle.js.gz +0 -0
  58. package/dist/3875.creaditor.bundle.js.gz +0 -0
  59. package/dist/3971.creaditor.bundle.js.gz +0 -0
  60. package/dist/4061.creaditor.bundle.js.gz +0 -0
  61. package/dist/407.creaditor.bundle.js.gz +0 -0
  62. package/dist/4074.creaditor.bundle.js.gz +0 -0
  63. package/dist/4100.creaditor.bundle.js.gz +0 -0
  64. package/dist/4109.creaditor.bundle.js.gz +0 -0
  65. package/dist/4114.creaditor.bundle.js.gz +0 -0
  66. package/dist/4161.creaditor.bundle.js.gz +0 -0
  67. package/dist/4186.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  68. package/dist/4186.creaditor.bundle.js.gz +0 -0
  69. package/dist/4288.creaditor.bundle.js.gz +0 -0
  70. package/dist/4413.creaditor.bundle.js.gz +0 -0
  71. package/dist/4475.creaditor.bundle.js.gz +0 -0
  72. package/dist/453.creaditor.bundle.js.gz +0 -0
  73. package/dist/4615.creaditor.bundle.js.gz +0 -0
  74. package/dist/4639.creaditor.bundle.js.gz +0 -0
  75. package/dist/467.creaditor.bundle.js.gz +0 -0
  76. package/dist/4762.creaditor.bundle.js.gz +0 -0
  77. package/dist/4770.creaditor.bundle.js.gz +0 -0
  78. package/dist/4947.creaditor.bundle.js.gz +0 -0
  79. package/dist/4987.creaditor.bundle.js.gz +0 -0
  80. package/dist/4988.creaditor.bundle.js.gz +0 -0
  81. package/dist/507.creaditor.bundle.js +334 -0
  82. package/dist/507.creaditor.bundle.js.gz +0 -0
  83. package/dist/5119.creaditor.bundle.js.gz +0 -0
  84. package/dist/5133.creaditor.bundle.js.gz +0 -0
  85. package/dist/5156.creaditor.bundle.js.gz +0 -0
  86. package/dist/5284.creaditor.bundle.js.gz +0 -0
  87. package/dist/5379.creaditor.bundle.js.gz +0 -0
  88. package/dist/5391.creaditor.bundle.js.gz +0 -0
  89. package/dist/5411.creaditor.bundle.js.gz +0 -0
  90. package/dist/5501.creaditor.bundle.js.gz +0 -0
  91. package/dist/5530.creaditor.bundle.js.gz +0 -0
  92. package/dist/5666.creaditor.bundle.js.gz +0 -0
  93. package/dist/567.creaditor.bundle.js.gz +0 -0
  94. package/dist/5713.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  95. package/dist/5713.creaditor.bundle.js.gz +0 -0
  96. package/dist/574.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  97. package/dist/574.creaditor.bundle.js.gz +0 -0
  98. package/dist/578.creaditor.bundle.js.gz +0 -0
  99. package/dist/5839.creaditor.bundle.js.gz +0 -0
  100. package/dist/5849.creaditor.bundle.js.gz +0 -0
  101. package/dist/5850.creaditor.bundle.js.gz +0 -0
  102. package/dist/5884.creaditor.bundle.js.gz +0 -0
  103. package/dist/59.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  104. package/dist/59.creaditor.bundle.js.gz +0 -0
  105. package/dist/5926.creaditor.bundle.js.gz +0 -0
  106. package/dist/6036.creaditor.bundle.js.gz +0 -0
  107. package/dist/6151.creaditor.bundle.js.gz +0 -0
  108. package/dist/6216.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  109. package/dist/6216.creaditor.bundle.js.gz +0 -0
  110. package/dist/{4819.creaditor.bundle.js → 6323.creaditor.bundle.js} +7 -7
  111. package/dist/6323.creaditor.bundle.js.gz +0 -0
  112. package/dist/638.creaditor.bundle.js.gz +0 -0
  113. package/dist/6442.creaditor.bundle.js.gz +0 -0
  114. package/dist/6496.creaditor.bundle.js.gz +0 -0
  115. package/dist/653.creaditor.bundle.js.gz +0 -0
  116. package/dist/6751.creaditor.bundle.js.gz +0 -0
  117. package/dist/6814.creaditor.bundle.js.gz +0 -0
  118. package/dist/6937.creaditor.bundle.js.gz +0 -0
  119. package/dist/7055.creaditor.bundle.js.gz +0 -0
  120. package/dist/7155.creaditor.bundle.js.gz +0 -0
  121. package/dist/7209.creaditor.bundle.js.gz +0 -0
  122. package/dist/7238.creaditor.bundle.js.gz +0 -0
  123. package/dist/7255.creaditor.bundle.js.gz +0 -0
  124. package/dist/738.creaditor.bundle.js.gz +0 -0
  125. package/dist/7380.creaditor.bundle.js.gz +0 -0
  126. package/dist/7463.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  127. package/dist/7463.creaditor.bundle.js.gz +0 -0
  128. package/dist/7466.creaditor.bundle.js.gz +0 -0
  129. package/dist/752.creaditor.bundle.js.gz +0 -0
  130. package/dist/7523.creaditor.bundle.js.gz +0 -0
  131. package/dist/7564.creaditor.bundle.js.gz +0 -0
  132. package/dist/7654.creaditor.bundle.js.gz +0 -0
  133. package/dist/767.creaditor.bundle.js.gz +0 -0
  134. package/dist/7789.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  135. package/dist/7789.creaditor.bundle.js.gz +0 -0
  136. package/dist/7838.creaditor.bundle.js.gz +0 -0
  137. package/dist/7937.creaditor.bundle.js.gz +0 -0
  138. package/dist/7997.creaditor.bundle.js.gz +0 -0
  139. package/dist/8042.creaditor.bundle.js.gz +0 -0
  140. package/dist/8064.creaditor.bundle.js.gz +0 -0
  141. package/dist/8088.creaditor.bundle.js +141 -0
  142. package/dist/8088.creaditor.bundle.js.gz +0 -0
  143. package/dist/8141.creaditor.bundle.js.gz +0 -0
  144. package/dist/8173.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  145. package/dist/8173.creaditor.bundle.js.gz +0 -0
  146. package/dist/8196.creaditor.bundle.js.gz +0 -0
  147. package/dist/823.creaditor.bundle.js.gz +0 -0
  148. package/dist/8250.creaditor.bundle.js.gz +0 -0
  149. package/dist/8251.creaditor.bundle.js.gz +0 -0
  150. package/dist/8299.creaditor.bundle.js.gz +0 -0
  151. package/dist/8315.creaditor.bundle.js.gz +0 -0
  152. package/dist/8443.creaditor.bundle.js.gz +0 -0
  153. package/dist/8516.creaditor.bundle.js.gz +0 -0
  154. package/dist/8533.creaditor.bundle.js.gz +0 -0
  155. package/dist/8547.creaditor.bundle.js.gz +0 -0
  156. package/dist/8570.creaditor.bundle.js.gz +0 -0
  157. package/dist/8646.creaditor.bundle.js.gz +0 -0
  158. package/dist/8654.creaditor.bundle.js.gz +0 -0
  159. package/dist/8854.creaditor.bundle.js.gz +0 -0
  160. package/dist/8878.creaditor.bundle.js.gz +0 -0
  161. package/dist/8916.creaditor.bundle.js.gz +0 -0
  162. package/dist/8921.creaditor.bundle.js.gz +0 -0
  163. package/dist/898.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  164. package/dist/898.creaditor.bundle.js.gz +0 -0
  165. package/dist/8983.creaditor.bundle.js.gz +0 -0
  166. package/dist/9041.creaditor.bundle.js.gz +0 -0
  167. package/dist/9158.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  168. package/dist/9158.creaditor.bundle.js.gz +0 -0
  169. package/dist/9250.creaditor.bundle.js.gz +0 -0
  170. package/dist/9386.creaditor.bundle.js.gz +0 -0
  171. package/dist/9431.creaditor.bundle.js.gz +0 -0
  172. package/dist/9453.creaditor.bundle.js.gz +0 -0
  173. package/dist/9570.creaditor.bundle.js.gz +0 -0
  174. package/dist/9694.creaditor.bundle.js.gz +0 -0
  175. package/dist/975.creaditor.bundle.js.gz +0 -0
  176. package/dist/976.creaditor.bundle.js.gz +0 -0
  177. package/dist/9986.creaditor.bundle.js.gz +0 -0
  178. package/dist/9990.creaditor.bundle.js.gz +0 -0
  179. package/dist/9994.creaditor.bundle.js.gz +0 -0
  180. package/dist/creaditor.bundle.js +249 -83
  181. package/dist/creaditor.bundle.js.LICENSE.txt.gz +0 -0
  182. package/dist/creaditor.bundle.js.gz +0 -0
  183. package/dist/index.html.gz +0 -0
  184. package/dist/service-worker.js +1 -1
  185. package/dist/service-worker.js.gz +0 -0
  186. package/dist/workbox-f3063069.js.gz +0 -0
  187. package/package.json +1 -1
  188. package/dist/2001.creaditor.bundle.js +0 -335
  189. package/dist/2001.creaditor.bundle.js.LICENSE.txt +0 -11
  190. package/dist/2001.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  191. package/dist/2001.creaditor.bundle.js.gz +0 -0
  192. package/dist/4819.creaditor.bundle.js.gz +0 -0
  193. package/dist/5791.creaditor.bundle.js +0 -288
  194. package/dist/5791.creaditor.bundle.js.gz +0 -0
  195. package/dist/7051.creaditor.bundle.js +0 -162
  196. package/dist/7051.creaditor.bundle.js.LICENSE.txt +0 -17
  197. package/dist/7051.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  198. package/dist/7051.creaditor.bundle.js.gz +0 -0
  199. package/dist/715.creaditor.bundle.js +0 -142
  200. package/dist/715.creaditor.bundle.js.LICENSE.txt +0 -11
  201. package/dist/715.creaditor.bundle.js.LICENSE.txt.gz +0 -0
  202. package/dist/715.creaditor.bundle.js.gz +0 -0
@@ -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 C(){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 M="automation:";function U(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="${M}" 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,7 +1078,24 @@
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">
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(){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=C()}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=""),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},C="rtl"===getComputedStyle(this).getPropertyValue("--direction-locale").trim();if(this.showAutomations)return s.qy` <div class="root ${C?"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
+ ${U(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">
1018
1099
  ${z=this.label,z?s.qy`<cdtr-title
1019
1100
  style="font-weight: 700;
1020
1101
  font-size: 14.4px;
@@ -1024,43 +1105,9 @@
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
+ ${U(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
+ ${M=this.hasButton,q=this.onClickOk.bind(this),M?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 M,q,I,j,F,T,z}}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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file