PluginProbe
Elementor Website Builder – more than just a page builder / 3.23.0-dev3
Elementor Website Builder – more than just a page builder v3.23.0-dev3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / modules / floating-buttons / base / widget-contact-button-base.php

widget-contact-button-base.php in Elementor Website Builder – more than just a page builder 3.23.0-dev3, at modules/floating-buttons/base/widget-contact-button-base.php

3,181 lines 83.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\FloatingButtons\Base;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Core\Base\Providers\Social_Network_Provider;
7 use Elementor\Core\Base\Traits\Shared_Widget_Controls_Trait;
8 use Elementor\Group_Control_Box_Shadow;
9 use Elementor\Group_Control_Typography;
10 use Elementor\Modules\FloatingButtons\Classes\Render\Contact_Buttons_Core_Render;
11 use Elementor\Plugin;
12 use Elementor\Repeater;
13 use Elementor\Utils;
14 use Elementor\Widget_Base;
15
16 abstract class Widget_Contact_Button_Base extends Widget_Base {
17
18 use Shared_Widget_Controls_Trait;
19
20 const TAB_ADVANCED = 'advanced-tab-floating-buttons';
21
22 public function show_in_panel() {
23 return false;
24 }
25
26 public function hide_on_search() {
27 return true;
28 }
29
30 protected function get_initial_config(): array {
31 return array_merge( parent::get_initial_config(), [
32 'commonMerged' => true,
33 ] );
34 }
35
36 public static function get_configuration() {
37 return [
38 'content' => [
39 'chat_button_section' => [
40 'section_name' => esc_html__( 'Chat Button', 'elementor' ),
41 'has_platform' => true,
42 'has_icon' => false,
43 'icon_default' => [
44 'value' => 'far fa-comment-dots',
45 'library' => 'fa-regular',
46 ],
47 'icons_recommended' => [
48 'fa-regular' => [
49 'comment',
50 'comment-dots',
51 'comment-alt',
52 ],
53 'fa-solid' => [
54 'ellipsis-v',
55 ],
56 ],
57 'has_notification_dot' => true,
58 'has_notification_dot_default_enabled' => true,
59 'has_active_tab' => false,
60 'has_display_text' => false,
61 'display_text_label' => esc_html__( 'Call now', 'elementor' ),
62 'has_display_text_select' => true,
63 'platform' => [
64 'group' => [
65 Social_Network_Provider::EMAIL,
66 Social_Network_Provider::SMS,
67 Social_Network_Provider::WHATSAPP,
68 Social_Network_Provider::SKYPE,
69 Social_Network_Provider::MESSENGER,
70 Social_Network_Provider::VIBER,
71 ],
72 'default' => Social_Network_Provider::WHATSAPP,
73 ],
74 'defaults' => [
75 'mail' => null,
76 'mail_subject' => null,
77 'mail_body' => null,
78 'number' => null,
79 'username' => null,
80 'location' => [
81 'is_external' => true,
82 ],
83 'url' => [
84 'is_external' => true,
85 ],
86 ],
87 ],
88 'top_bar_section' => [
89 'section_name' => esc_html__( 'Top Bar', 'elementor' ),
90 'has_image' => true,
91 'has_active_dot' => true,
92 'has_subtitle' => true,
93 'title' => [
94 'label' => esc_html__( 'Name', 'elementor' ),
95 'default' => esc_html__( 'Rob Jones', 'elementor' ),
96 'placeholder' => esc_html__( 'Type your name here', 'elementor' ),
97 'dynamic' => false,
98 'ai' => false,
99 'label_block' => false,
100 ],
101 'subtitle' => [
102 'label' => esc_html__( 'Title', 'elementor' ),
103 'default' => esc_html__( 'Store Manager', 'elementor' ),
104 'placeholder' => esc_html__( 'Type your title here', 'elementor' ),
105 'dynamic' => false,
106 'ai' => false,
107 'label_block' => false,
108 ],
109 ],
110 'message_bubble_section' => [
111 'has_typing_animation' => true,
112 ],
113 'contact_section' => [
114 'section_name' => esc_html__( 'Contact Buttons', 'elementor' ),
115 'has_cta_text' => true,
116 'repeater' => [
117 'has_tooltip' => false,
118 'tooltip_label' => esc_html__( 'Text', 'elementor' ),
119 'tooltip_default' => esc_html__( 'Tooltip', 'elementor' ),
120 'tooltip_placeholder' => esc_html__( 'Enter icon text', 'elementor' ),
121 'has_title' => false,
122 'has_description' => false,
123 ],
124 'platform' => [
125 'group-1' => [
126 Social_Network_Provider::EMAIL,
127 Social_Network_Provider::SMS,
128 Social_Network_Provider::WHATSAPP,
129 Social_Network_Provider::SKYPE,
130 Social_Network_Provider::MESSENGER,
131 Social_Network_Provider::VIBER,
132 ],
133 'limit' => 5,
134 'min_items' => 0,
135 ],
136 'default' => [
137 [
138 'contact_icon_platform' => Social_Network_Provider::WHATSAPP,
139 ],
140 [
141 'contact_icon_platform' => Social_Network_Provider::EMAIL,
142 ],
143 [
144 'contact_icon_platform' => Social_Network_Provider::SMS,
145 ],
146 [
147 'contact_icon_platform' => Social_Network_Provider::VIBER,
148 ],
149 [
150 'contact_icon_platform' => Social_Network_Provider::MESSENGER,
151 ],
152 ],
153 ],
154 'send_button_section' => [
155 'section_name' => esc_html__( 'Send Button', 'elementor' ),
156 'has_link' => false,
157 'text' => [
158 'default' => esc_html__( 'Click to start chat', 'elementor' ),
159 ],
160 ],
161 ],
162 'style' => [
163 'has_platform_colors' => true,
164 'chat_button_section' => [
165 'has_entrance_animation' => true,
166 'has_box_shadow' => true,
167 'has_drop_shadow' => false,
168 'has_padding' => false,
169 'has_button_size' => true,
170 'button_size_default' => 'small',
171 'has_typography' => false,
172 'has_icon_position' => false,
173 'has_icon_spacing' => false,
174 'has_tabs' => true,
175 'has_platform_color_controls' => false,
176 'hover_animation_type' => 'default',
177 'icon_color_label' => esc_html__( 'Icon Color', 'elementor' ),
178 'padding_defaults' => [
179 'top' => '16',
180 'bottom' => '16',
181 'left' => '20',
182 'right' => '20',
183 'unit' => 'px',
184 'isLinked' => false,
185 ],
186 ],
187 'top_bar_section' => [
188 'has_title_heading' => true,
189 'title_heading_label' => esc_html__( 'Name', 'elementor' ),
190 'subtitle_heading_label' => esc_html__( 'Title', 'elementor' ),
191 'has_style_close_button' => true,
192 'has_close_button_heading' => false,
193 'has_background' => true,
194 'has_background_heading' => false,
195 ],
196 'message_bubble_section' => [
197 'has_chat_background' => true,
198 ],
199 'contact_section' => [
200 'has_buttons_heading' => true,
201 'buttons_heading_label' => esc_html__( 'Buttons', 'elementor' ),
202 'has_buttons_size' => true,
203 'has_box_shadow' => false,
204 'has_buttons_spacing' => false,
205 'buttons_spacing_default' => [
206 'unit' => 'px',
207 'size' => 15,
208 ],
209 'has_hover_animation' => true,
210 'has_chat_box_animation' => false,
211 'has_icon_bg_color' => true,
212 'has_button_bar' => false,
213 'has_tabs' => true,
214 'has_text_color' => false,
215 'has_bg_color' => false,
216 'has_padding' => false,
217 'has_button_corners' => false,
218 'has_typography' => false,
219 'icon_color_label' => esc_html__( 'Icon Color', 'elementor' ),
220 'has_hover_transition_duration' => false,
221 ],
222 'send_button_section' => [
223 'has_platform_colors' => true,
224 'has_icon_color' => true,
225 'has_background_color' => true,
226 'has_text_color' => false,
227 'has_typography' => false,
228 ],
229 'chat_box_section' => [
230 'section_name' => esc_html__( 'Chat Box', 'elementor' ),
231 'width' => 360,
232 'has_width' => true,
233 'has_padding' => false,
234 ],
235 ],
236 'advanced' => [
237 'has_layout_position' => true,
238 'horizontal_position_default' => 'end',
239 'horizontal_offset_default' => 25,
240 'vertical_offset_default' => 25,
241 'has_mobile_full_width' => false,
242 'has_vertical_offset' => true,
243 'has_horizontal_offset' => true,
244 ],
245 ];
246 }
247
248 public function get_icon(): string {
249 return 'eicon-commenting-o';
250 }
251
252 public function get_categories(): array {
253 return [ 'general' ];
254 }
255
256 protected function register_controls(): void {
257
258 $this->add_content_tab();
259
260 $this->add_style_tab();
261
262 $this->add_advanced_tab();
263 }
264
265 const BOX_SHADOW_FIELDS_OPTIONS = [
266 'box_shadow_type' => [
267 'default' => 'yes',
268 ],
269 'box_shadow' => [
270 'default' => [
271 'horizontal' => 4,
272 'vertical' => 4,
273 'blur' => 10,
274 'spread' => 0,
275 'color' => 'rgba(0,0,0,0.15)',
276 ],
277 ],
278 ];
279
280 private function social_media_controls(): void {
281 $config = static::get_configuration();
282
283 $this->add_control(
284 'chat_button_mail',
285 [
286 'label' => esc_html__( 'Email', 'elementor' ),
287 'type' => Controls_Manager::TEXT,
288 'dynamic' => [
289 'active' => true,
290 ],
291 'ai' => [
292 'active' => false,
293 ],
294 'label_block' => true,
295 'placeholder' => esc_html__( '@', 'elementor' ),
296 'default' => $config['content']['chat_button_section']['defaults']['mail'],
297 'condition' => [
298 'chat_button_platform' => Social_Network_Provider::EMAIL,
299 ],
300 ],
301 );
302
303 $this->add_control(
304 'chat_button_mail_subject',
305 [
306 'label' => esc_html__( 'Subject', 'elementor' ),
307 'type' => Controls_Manager::TEXT,
308 'dynamic' => [
309 'active' => true,
310 ],
311 'label_block' => true,
312 'default' => $config['content']['chat_button_section']['defaults']['mail_subject'],
313 'condition' => [
314 'chat_button_platform' => Social_Network_Provider::EMAIL,
315 ],
316 ],
317 );
318
319 $this->add_control(
320 'chat_button_mail_body',
321 [
322 'label' => esc_html__( 'Message', 'elementor' ),
323 'type' => Controls_Manager::TEXTAREA,
324 'default' => $config['content']['chat_button_section']['defaults']['mail_body'],
325 'condition' => [
326 'chat_button_platform' => Social_Network_Provider::EMAIL,
327 ],
328 ]
329 );
330
331 $this->add_control(
332 'chat_button_number',
333 [
334 'label' => esc_html__( 'Number', 'elementor' ),
335 'type' => Controls_Manager::TEXT,
336 'dynamic' => [
337 'active' => true,
338 ],
339 'ai' => [
340 'active' => false,
341 ],
342 'label_block' => true,
343 'placeholder' => esc_html__( '+', 'elementor' ),
344 'default' => $config['content']['chat_button_section']['defaults']['number'],
345 'condition' => [
346 'chat_button_platform' => [
347 Social_Network_Provider::SMS,
348 Social_Network_Provider::WHATSAPP,
349 Social_Network_Provider::VIBER,
350 Social_Network_Provider::TELEPHONE,
351 ],
352 ],
353 ],
354 );
355
356 $this->add_control(
357 'chat_button_username',
358 [
359 'label' => esc_html__( 'Username', 'elementor' ),
360 'type' => Controls_Manager::TEXT,
361 'dynamic' => [
362 'active' => true,
363 ],
364 'ai' => [
365 'active' => false,
366 ],
367 'label_block' => true,
368 'default' => $config['content']['chat_button_section']['defaults']['username'],
369 'condition' => [
370 'chat_button_platform' => [
371 Social_Network_Provider::SKYPE,
372 Social_Network_Provider::MESSENGER,
373 ],
374 ],
375 ],
376 );
377
378 $this->add_control(
379 'chat_button_viber_action',
380 [
381 'label' => esc_html__( 'Action', 'elementor' ),
382 'type' => Controls_Manager::SELECT,
383 'default' => 'chat',
384 'options' => [
385 'chat' => 'Chat',
386 'contact' => 'Contact',
387 ],
388 'condition' => [
389 'chat_button_platform' => Social_Network_Provider::VIBER,
390 ],
391 ]
392 );
393
394 $this->add_control(
395 'chat_button_waze',
396 [
397 'label' => esc_html__( 'Location', 'elementor' ),
398 'type' => Controls_Manager::URL,
399 'dynamic' => [
400 'active' => true,
401 ],
402 'ai' => [
403 'active' => false,
404 ],
405 'label_block' => true,
406 'placeholder' => esc_html__( 'Paste Waze link', 'elementor' ),
407 'default' => $config['content']['chat_button_section']['defaults']['location'],
408 'condition' => [
409 'chat_button_platform' => [
410 Social_Network_Provider::WAZE,
411 ],
412 ],
413 ],
414 );
415
416 $this->add_control(
417 'chat_button_url',
418 [
419 'label' => esc_html__( 'Link', 'elementor' ),
420 'type' => Controls_Manager::URL,
421 'default' => [
422 'is_external' => true,
423 ],
424 'dynamic' => [
425 'active' => true,
426 ],
427 'ai' => [
428 'active' => false,
429 ],
430 'autocomplete' => true,
431 'label_block' => true,
432 'default' => $config['content']['chat_button_section']['defaults']['url'],
433 'condition' => [
434 'chat_button_platform' => [
435 Social_Network_Provider::URL,
436 ],
437 ],
438 ],
439 );
440 }
441
442 private function get_display_text_condition( $condition ) {
443 $config = static::get_configuration();
444
445 if ( true == $config['content']['chat_button_section']['has_display_text_select'] ) {
446 return $condition;
447 }
448
449 return null;
450 }
451
452 protected function add_chat_button_section(): void {
453 $config = static::get_configuration();
454
455 $this->start_controls_section(
456 'chat_button_section',
457 [
458 'label' => $config['content']['chat_button_section']['section_name'],
459 'tab' => Controls_Manager::TAB_CONTENT,
460 ]
461 );
462
463 if ( $config['content']['chat_button_section']['has_platform'] ) {
464
465 $this->add_control(
466 'chat_button_platform',
467 [
468 'label' => esc_html__( 'Platform', 'elementor' ),
469 'type' => Controls_Manager::SELECT,
470 'default' => $config['content']['chat_button_section']['platform']['default'],
471 'options' => Social_Network_Provider::get_social_networks_text(
472 $config['content']['chat_button_section']['platform']['group']
473 ),
474 ]
475 );
476
477 $this->social_media_controls();
478 }
479
480 if ( $config['content']['chat_button_section']['has_icon'] ) {
481 $this->add_control(
482 'chat_button_icon',
483 [
484 'label' => esc_html__( 'Icon', 'elementor' ),
485 'type' => Controls_Manager::ICONS,
486 'default' => $config['content']['chat_button_section']['icon_default'],
487 'recommended' => $config['content']['chat_button_section']['icons_recommended'],
488 ]
489 );
490 }
491
492 if ( $config['content']['chat_button_section']['has_notification_dot'] ) {
493
494 $notification_dot_return_value = 'yes';
495 $notification_dot_default = $notification_dot_return_value;
496
497 // Only clear if explicitly passed
498 if ( false === $config['content']['chat_button_section']['has_notification_dot_default_enabled'] ) {
499 $notification_dot_default = '';
500 }
501
502 $this->add_control(
503 'chat_button_show_dot',
504 [
505 'label' => esc_html__( 'Notification Dot', 'elementor' ),
506 'type' => Controls_Manager::SWITCHER,
507 'label_on' => esc_html__( 'Show', 'elementor' ),
508 'label_off' => esc_html__( 'Hide', 'elementor' ),
509 'return_value' => $notification_dot_return_value,
510 'default' => $notification_dot_default,
511 ]
512 );
513 }
514
515 if ( $config['content']['chat_button_section']['has_display_text'] ) {
516
517 if ( $config['content']['chat_button_section']['has_display_text_select'] ) {
518 $this->add_control(
519 'chat_button_display_text_select',
520 [
521 'label' => esc_html__( 'Display Text', 'elementor' ),
522 'type' => Controls_Manager::SELECT,
523 'default' => 'details',
524 'options' => [
525 'details' => esc_html__( 'Contact Details', 'elementor' ),
526 'cta' => esc_html__( 'Call to Action', 'elementor' ),
527 ],
528 ]
529 );
530 }
531
532 $this->add_control(
533 'chat_button_display_text',
534 [
535 'label' => esc_html__( 'Call to Action Text', 'elementor' ),
536 'type' => Controls_Manager::TEXT,
537 'dynamic' => [
538 'active' => true,
539 ],
540 'label_block' => true,
541 'placeholder' => esc_html__( 'Enter the text', 'elementor' ),
542 'default' => $config['content']['chat_button_section']['display_text_label'],
543 'condition' => $this->get_display_text_condition([
544 'chat_button_display_text_select' => 'cta',
545 ] ),
546 ],
547 );
548 }
549
550 $this->end_controls_section();
551 }
552
553 protected function add_top_bar_section(): void {
554 $config = static::get_configuration();
555
556 $this->start_controls_section(
557 'top_bar_section',
558 [
559 'label' => $config['content']['top_bar_section']['section_name'],
560 'tab' => Controls_Manager::TAB_CONTENT,
561 ]
562 );
563
564 $this->add_control(
565 'top_bar_title',
566 [
567 'label' => $config['content']['top_bar_section']['title']['label'],
568 'type' => Controls_Manager::TEXT,
569 'default' => $config['content']['top_bar_section']['title']['default'],
570 'placeholder' => $config['content']['top_bar_section']['title']['placeholder'],
571 'dynamic' => [
572 'active' => $config['content']['top_bar_section']['title']['dynamic'],
573 ],
574 'ai' => [
575 'active' => $config['content']['top_bar_section']['title']['ai'],
576 ],
577 'label_block' => $config['content']['top_bar_section']['title']['label_block'],
578 ]
579 );
580
581 if ( $config['content']['top_bar_section']['has_subtitle'] ) {
582 $this->add_control(
583 'top_bar_subtitle',
584 [
585 'label' => $config['content']['top_bar_section']['subtitle']['label'],
586 'type' => Controls_Manager::TEXT,
587 'default' => $config['content']['top_bar_section']['subtitle']['default'],
588 'placeholder' => $config['content']['top_bar_section']['subtitle']['placeholder'],
589 $config['content']['top_bar_section']['subtitle']['dynamic'],
590 'ai' => [
591 'active' => $config['content']['top_bar_section']['subtitle']['ai'],
592 ],
593 'label_block' => $config['content']['top_bar_section']['title']['label_block'],
594 ]
595 );
596 }
597
598 if ( $config['content']['top_bar_section']['has_image'] ) {
599 $this->add_control(
600 'top_bar_image',
601 [
602 'label' => esc_html__( 'Profile Image', 'elementor' ),
603 'type' => Controls_Manager::MEDIA,
604 'default' => [
605 'url' => Utils::get_placeholder_image_src(),
606 ],
607 ]
608 );
609 }
610
611 if ( $config['content']['top_bar_section']['has_active_dot'] ) {
612 $this->add_control(
613 'top_bar_show_dot',
614 [
615 'label' => esc_html__( 'Active Dot', 'elementor' ),
616 'type' => Controls_Manager::SWITCHER,
617 'label_on' => esc_html__( 'Show', 'elementor' ),
618 'label_off' => esc_html__( 'Hide', 'elementor' ),
619 'return_value' => 'yes',
620 'default' => 'yes',
621 ]
622 );
623 }
624
625 $this->end_controls_section();
626 }
627
628 protected function add_message_bubble_section(): void {
629 $config = static::get_configuration();
630
631 $this->start_controls_section(
632 'message_bubble_section',
633 [
634 'label' => esc_html__( 'Message Bubble', 'elementor' ),
635 'tab' => Controls_Manager::TAB_CONTENT,
636 ]
637 );
638
639 $this->add_control(
640 'message_bubble_name',
641 [
642 'label' => esc_html__( 'Name', 'elementor' ),
643 'type' => Controls_Manager::TEXT,
644 'default' => esc_html__( 'Rob', 'elementor' ),
645 'placeholder' => esc_html__( 'Type your name here', 'elementor' ),
646 ]
647 );
648
649 $this->add_control(
650 'message_bubble_body',
651 [
652 'label' => esc_html__( 'Message', 'elementor' ),
653 'type' => Controls_Manager::TEXTAREA,
654 'dynamic' => [
655 'active' => true,
656 ],
657 'label_block' => true,
658 'default' => esc_html__( 'Hey, how can I help you today?', 'elementor' ),
659 'placeholder' => esc_html__( 'Message', 'elementor' ),
660 ],
661 );
662
663 $this->add_control(
664 'chat_button_time_format',
665 [
666 'label' => esc_html__( 'Time format', 'elementor' ),
667 'type' => Controls_Manager::SELECT,
668 'default' => '12h',
669 'options' => [
670 '12h' => esc_html__( '2:20 PM', 'elementor' ),
671 '24h' => esc_html__( '14:20', 'elementor' ),
672 ],
673 ]
674 );
675
676 if ( $config['content']['message_bubble_section']['has_typing_animation'] ) {
677 $this->add_control(
678 'chat_button_show_animation',
679 [
680 'label' => esc_html__( 'Typing Animation', 'elementor' ),
681 'type' => Controls_Manager::SWITCHER,
682 'label_on' => esc_html__( 'Show', 'elementor' ),
683 'label_off' => esc_html__( 'Hide', 'elementor' ),
684 'return_value' => 'yes',
685 'default' => 'yes',
686 ]
687 );
688 }
689
690 $this->end_controls_section();
691 }
692
693 protected function add_contact_section(): void {
694 $config = static::get_configuration();
695
696 $this->start_controls_section(
697 'contact_section',
698 [
699 'label' => $config['content']['contact_section']['section_name'],
700 'tab' => Controls_Manager::TAB_CONTENT,
701 ]
702 );
703
704 if ( $config['content']['contact_section']['has_cta_text'] ) {
705 $this->add_control(
706 'contact_cta_text',
707 [
708 'label' => esc_html__( 'Call to Action Text', 'elementor' ),
709 'type' => Controls_Manager::TEXT,
710 'default' => esc_html__( 'Start conversation:', 'elementor' ),
711 'placeholder' => esc_html__( 'Type your text here', 'elementor' ),
712 ]
713 );
714 }
715
716 if ( $config['content']['contact_section']['platform']['limit'] ) {
717 if ( $config['content']['contact_section']['platform']['min_items'] ) {
718 $this->add_control(
719 'contact_custom_panel_alert',
720 [
721 'type' => Controls_Manager::ALERT,
722 'alert_type' => 'info',
723 'content' => sprintf(
724 __( 'Add between <b>%1$d</b> to <b>%2$d</b> icons', 'elementor' ),
725 $config['content']['contact_section']['platform']['min_items'],
726 $config['content']['contact_section']['platform']['limit']
727 ),
728 ]
729 );
730 } else {
731 $this->add_control(
732 'contact_custom_panel_alert',
733 [
734 'type' => Controls_Manager::ALERT,
735 'alert_type' => 'info',
736 'content' => sprintf(
737 __( 'Add up to <b>%d</b> icons', 'elementor' ),
738 $config['content']['contact_section']['platform']['limit']
739 ),
740 ]
741 );
742 }
743 }
744
745 $repeater = new Repeater();
746
747 $repeater->add_control(
748 'contact_icon_platform',
749 [
750 'label' => esc_html__( 'Platform', 'elementor' ),
751 'type' => Controls_Manager::SELECT,
752 'options' => Social_Network_Provider::get_social_networks_text(
753 $config['content']['contact_section']['platform']['group-1']
754 ),
755 'default' => Social_Network_Provider::WHATSAPP,
756 ],
757 );
758
759 if ( $config['content']['contact_section']['repeater']['has_tooltip'] ) {
760 $repeater->add_control(
761 'contact_tooltip',
762 [
763 'label' => $config['content']['contact_section']['repeater']['tooltip_label'],
764 'type' => Controls_Manager::TEXT,
765 'dynamic' => [
766 'active' => true,
767 ],
768 'default' => $config['content']['contact_section']['repeater']['tooltip_default'],
769 'placeholder' => $config['content']['contact_section']['repeater']['tooltip_placeholder'],
770 ],
771 );
772 }
773
774 if ( $config['content']['contact_section']['repeater']['has_title'] ) {
775 $repeater->add_control(
776 'contact_title',
777 [
778 'label' => 'Title',
779 'type' => Controls_Manager::TEXT,
780 'dynamic' => [
781 'active' => true,
782 ],
783 'default' => 'Title',
784 'placeholder' => esc_html__( 'Enter title', 'elementor' ),
785 ],
786 );
787 }
788
789 if ( $config['content']['contact_section']['repeater']['has_description'] ) {
790 $repeater->add_control(
791 'contact_description',
792 [
793 'label' => 'Description',
794 'type' => Controls_Manager::TEXT,
795 'dynamic' => [
796 'active' => true,
797 ],
798 'default' => 'Description',
799 'placeholder' => esc_html__( 'Enter description', 'elementor' ),
800 ],
801 );
802 }
803
804 $repeater->add_control(
805 'contact_icon_mail',
806 [
807 'label' => esc_html__( 'Email', 'elementor' ),
808 'type' => Controls_Manager::TEXT,
809 'placeholder' => esc_html__( 'Enter your email', 'elementor' ),
810 'dynamic' => [
811 'active' => true,
812 ],
813 'ai' => [
814 'active' => false,
815 ],
816 'label_block' => true,
817 'condition' => [
818 'contact_icon_platform' => [
819 Social_Network_Provider::EMAIL,
820 ],
821 ],
822 ],
823 );
824
825 $repeater->add_control(
826 'contact_icon_mail_subject',
827 [
828 'label' => esc_html__( 'Subject', 'elementor' ),
829 'type' => Controls_Manager::TEXT,
830 'placeholder' => esc_html__( 'Subject', 'elementor' ),
831 'label_block' => true,
832 'condition' => [
833 'contact_icon_platform' => [
834 Social_Network_Provider::EMAIL,
835 ],
836 ],
837 ]
838 );
839
840 $repeater->add_control(
841 'contact_icon_mail_body',
842 [
843 'label' => esc_html__( 'Message', 'elementor' ),
844 'type' => Controls_Manager::TEXTAREA,
845 'placeholder' => esc_html__( 'Message', 'elementor' ),
846 'label_block' => true,
847 'condition' => [
848 'contact_icon_platform' => [
849 Social_Network_Provider::EMAIL,
850 ],
851 ],
852 ]
853 );
854
855 $repeater->add_control(
856 'contact_icon_number',
857 [
858 'label' => esc_html__( 'Number', 'elementor' ),
859 'type' => Controls_Manager::TEXT,
860 'dynamic' => [
861 'active' => true,
862 ],
863 'ai' => [
864 'active' => false,
865 ],
866 'label_block' => true,
867 'placeholder' => esc_html__( '+', 'elementor' ),
868 'condition' => [
869 'contact_icon_platform' => [
870 Social_Network_Provider::SMS,
871 Social_Network_Provider::WHATSAPP,
872 Social_Network_Provider::VIBER,
873 Social_Network_Provider::TELEPHONE,
874 ],
875 ],
876 ],
877 );
878
879 $repeater->add_control(
880 'contact_icon_username',
881 [
882 'label' => esc_html__( 'Username', 'elementor' ),
883 'type' => Controls_Manager::TEXT,
884 'dynamic' => [
885 'active' => true,
886 ],
887 'ai' => [
888 'active' => false,
889 ],
890 'label_block' => true,
891 'placeholder' => esc_html__( 'Enter your username', 'elementor' ),
892 'condition' => [
893 'contact_icon_platform' => [
894 Social_Network_Provider::MESSENGER,
895 Social_Network_Provider::SKYPE,
896 ],
897 ],
898 ],
899 );
900
901 $repeater->add_control(
902 'contact_icon_url',
903 [
904 'label' => esc_html__( 'Link', 'elementor' ),
905 'type' => Controls_Manager::URL,
906 'dynamic' => [
907 'active' => true,
908 ],
909 'ai' => [
910 'active' => false,
911 ],
912 'autocomplete' => true,
913 'label_block' => true,
914 'condition' => [
915 'contact_icon_platform' => [
916 Social_Network_Provider::URL,
917 ],
918 ],
919 'default' => [
920 'is_external' => true,
921 ],
922 'placeholder' => esc_html__( 'Paste URL or type', 'elementor' ),
923 ],
924 );
925
926 $repeater->add_control(
927 'contact_icon_waze',
928 [
929 'label' => esc_html__( 'Location', 'elementor' ),
930 'type' => Controls_Manager::URL,
931 'default' => [
932 'is_external' => true,
933 ],
934 'dynamic' => [
935 'active' => true,
936 ],
937 'label_block' => true,
938 'placeholder' => esc_html__( 'Paste Waze link', 'elementor' ),
939 'condition' => [
940 'contact_icon_platform' => [
941 Social_Network_Provider::WAZE,
942 ],
943 ],
944 'ai' => [
945 'active' => false,
946 ],
947 ],
948 );
949
950 $repeater->add_control(
951 'contact_icon_viber_action',
952 [
953 'label' => esc_html__( 'Action', 'elementor' ),
954 'type' => Controls_Manager::SELECT,
955 'default' => 'chat',
956 'dynamic' => [
957 'active' => true,
958 ],
959 'options' => [
960 'chat' => 'Chat',
961 'contact' => 'Contact',
962 ],
963 'condition' => [
964 'contact_icon_platform' => Social_Network_Provider::VIBER,
965 ],
966 ]
967 );
968
969 $this->add_control(
970 'contact_repeater',
971 [
972 'max_items' => $config['content']['contact_section']['platform']['limit'],
973 'min_items' => $config['content']['contact_section']['platform']['min_items'],
974 'type' => Controls_Manager::REPEATER,
975 'fields' => $repeater->get_controls(),
976 'title_field' => $this->get_icon_title_field(),
977 'prevent_empty' => true,
978 'button_text' => esc_html__( 'Add Item', 'elementor' ),
979 'default' => $config['content']['contact_section']['default'],
980 ]
981 );
982
983 $this->end_controls_section();
984 }
985
986 protected function get_icon_title_field(): string {
987 $platform_icons_js = json_encode( Social_Network_Provider::get_social_networks_icons() );
988 $platform_text_js = json_encode( Social_Network_Provider::get_social_networks_text() );
989
990 return <<<JS
991 <#
992 elementor.helpers.enqueueIconFonts( 'fa-solid' );
993 elementor.helpers.enqueueIconFonts( 'fa-brands' );
994 const mapping = {$platform_icons_js};
995 const text_mapping = {$platform_text_js};
996 #>
997 <i class='{{{ mapping[contact_icon_platform] }}}' ></i> {{{ text_mapping[contact_icon_platform] }}}
998 JS;
999 }
1000
1001 protected function add_send_button_section(): void {
1002 $config = static::get_configuration();
1003
1004 $this->start_controls_section(
1005 'send_button_section',
1006 [
1007 'label' => $config['content']['send_button_section']['section_name'],
1008 'tab' => Controls_Manager::TAB_CONTENT,
1009 ]
1010 );
1011
1012 $this->add_control(
1013 'send_button_text',
1014 [
1015 'label' => esc_html__( 'Text', 'elementor' ),
1016 'type' => Controls_Manager::TEXT,
1017 'default' => $config['content']['send_button_section']['text']['default'],
1018 'placeholder' => esc_html__( 'Type your text here', 'elementor' ),
1019 'dynamic' => [
1020 'active' => true,
1021 ],
1022 'ai' => [
1023 'active' => false,
1024 ],
1025 ]
1026 );
1027
1028 if ( $config['content']['send_button_section']['has_link'] ) {
1029 $this->add_control(
1030 'send_button_url',
1031 [
1032 'label' => esc_html__( 'Link', 'elementor' ),
1033 'type' => Controls_Manager::URL,
1034 'default' => [
1035 'is_external' => true,
1036 ],
1037 'dynamic' => [
1038 'active' => true,
1039 ],
1040 'ai' => [
1041 'active' => false,
1042 ],
1043 'autocomplete' => true,
1044 'label_block' => true,
1045 ],
1046 );
1047 }
1048
1049 $this->end_controls_section();
1050 }
1051
1052 protected function add_content_tab(): void {
1053 $this->add_chat_button_section();
1054
1055 $this->add_top_bar_section();
1056
1057 $this->add_message_bubble_section();
1058
1059 $this->add_send_button_section();
1060 }
1061
1062 private function get_platform_color_condition( $condition ) {
1063 $config = static::get_configuration();
1064
1065 if ( true == $config['style']['has_platform_colors'] ) {
1066 return $condition;
1067 }
1068
1069 return null;
1070 }
1071
1072 protected function add_style_chat_button_section(): void {
1073 $config = static::get_configuration();
1074
1075 $this->start_controls_section(
1076 'style_chat_button',
1077 [
1078 'label' => $config['content']['chat_button_section']['section_name'],
1079 'tab' => Controls_Manager::TAB_STYLE,
1080 ]
1081 );
1082
1083 if ( $config['style']['chat_button_section']['has_button_size'] ) {
1084 $this->add_control(
1085 'style_chat_button_size',
1086 [
1087 'label' => esc_html__( 'Size', 'elementor' ),
1088 'type' => Controls_Manager::SELECT,
1089 'default' => $config['style']['chat_button_section']['button_size_default'],
1090 'options' => [
1091 'small' => esc_html__( 'Small', 'elementor' ),
1092 'medium' => esc_html__( 'Medium', 'elementor' ),
1093 'large' => esc_html__( 'Large', 'elementor' ),
1094 ],
1095 ]
1096 );
1097 }
1098
1099 if ( $config['style']['chat_button_section']['has_icon_position'] ) {
1100 $this->add_responsive_control(
1101 'style_chat_button_horizontal_position',
1102 [
1103 'label' => esc_html__( 'Icon Position', 'elementor' ),
1104 'type' => Controls_Manager::CHOOSE,
1105 'options' => [
1106 'start' => [
1107 'title' => esc_html__( 'Left', 'elementor' ),
1108 'icon' => 'eicon-h-align-left',
1109 ],
1110 'end' => [
1111 'title' => esc_html__( 'Right', 'elementor' ),
1112 'icon' => 'eicon-h-align-right',
1113 ],
1114 ],
1115 'default' => 'start',
1116 'toggle' => true,
1117 ]
1118 );
1119 }
1120
1121 if ( $config['style']['chat_button_section']['has_icon_spacing'] ) {
1122 $this->add_responsive_control(
1123 'style_chat_button_spacing',
1124 [
1125 'label' => esc_html__( 'Icon Spacing', 'elementor' ),
1126 'type' => Controls_Manager::SLIDER,
1127 'range' => [
1128 '%' => [
1129 'min' => 10,
1130 'max' => 100,
1131 ],
1132 'px' => [
1133 'min' => 0,
1134 'max' => 100,
1135 ],
1136 ],
1137 'default' => [
1138 'unit' => 'px',
1139 'size' => 8,
1140 ],
1141 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
1142 'selectors' => [
1143 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-button-gap: {{SIZE}}{{UNIT}}',
1144 ],
1145 'separator' => 'before',
1146 ]
1147 );
1148 }
1149
1150 if ( $config['style']['chat_button_section']['has_typography'] ) {
1151 $this->add_group_control(
1152 Group_Control_Typography::get_type(),
1153 [
1154 'name' => 'style_top_bar_title_typography',
1155 'selector' => '{{WRAPPER}} .e-contact-buttons__chat-button',
1156 ]
1157 );
1158 }
1159
1160 if ( $config['style']['chat_button_section']['has_tabs'] ) {
1161 $this->start_controls_tabs(
1162 'style_button_color_tabs'
1163 );
1164
1165 $this->start_controls_tab(
1166 'style_button_color_tabs_normal',
1167 [
1168 'label' => esc_html__( 'Normal', 'elementor' ),
1169 ]
1170 );
1171
1172 if ( $config['style']['has_platform_colors'] ) {
1173 $this->add_control(
1174 'style_button_color_select',
1175 [
1176 'label' => esc_html__( 'Colors', 'elementor' ),
1177 'type' => Controls_Manager::SELECT,
1178 'default' => 'default',
1179 'options' => [
1180 'default' => esc_html__( 'Default', 'elementor' ),
1181 'custom' => esc_html__( 'Custom', 'elementor' ),
1182 ],
1183 ]
1184 );
1185 }
1186
1187 $this->add_control(
1188 'style_button_color_icon',
1189 [
1190 'label' => $config['style']['chat_button_section']['icon_color_label'],
1191 'type' => Controls_Manager::COLOR,
1192 'selectors' => [
1193 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon: {{VALUE}}',
1194 ],
1195 'condition' => $this->get_platform_color_condition( [
1196 'style_button_color_select' => 'custom',
1197 ] ),
1198 ]
1199 );
1200
1201 $this->add_control(
1202 'style_button_color_background',
1203 [
1204 'label' => esc_html__( 'Background Color', 'elementor' ),
1205 'type' => Controls_Manager::COLOR,
1206 'selectors' => [
1207 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg: {{VALUE}}',
1208 ],
1209 'condition' => $this->get_platform_color_condition( [
1210 'style_button_color_select' => 'custom',
1211 ] ),
1212 ]
1213 );
1214
1215 $this->end_controls_tab();
1216
1217 $this->start_controls_tab(
1218 'style_button_color_tabs_hover',
1219 [
1220 'label' => esc_html__( 'Hover', 'elementor' ),
1221 ]
1222 );
1223
1224 if ( $config['style']['has_platform_colors'] ) {
1225 $this->add_control(
1226 'style_button_color_select_hover',
1227 [
1228 'label' => esc_html__( 'Colors', 'elementor' ),
1229 'type' => Controls_Manager::SELECT,
1230 'default' => 'default',
1231 'options' => [
1232 'default' => esc_html__( 'Default', 'elementor' ),
1233 'custom' => esc_html__( 'Custom', 'elementor' ),
1234 ],
1235 ]
1236 );
1237 }
1238
1239 $this->add_control(
1240 'style_button_color_icon_hover',
1241 [
1242 'label' => $config['style']['chat_button_section']['icon_color_label'],
1243 'type' => Controls_Manager::COLOR,
1244 'selectors' => [
1245 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon-hover: {{VALUE}}',
1246 ],
1247 'condition' => $this->get_platform_color_condition( [
1248 'style_button_color_select_hover' => 'custom',
1249 ] ),
1250 ]
1251 );
1252
1253 $this->add_control(
1254 'style_button_color_background_hover',
1255 [
1256 'label' => esc_html__( 'Background Color', 'elementor' ),
1257 'type' => Controls_Manager::COLOR,
1258 'selectors' => [
1259 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg-hover: {{VALUE}}',
1260 ],
1261 'condition' => $this->get_platform_color_condition( [
1262 'style_button_color_select_hover' => 'custom',
1263 ] ),
1264 ]
1265 );
1266
1267 if ( 'default' == $config['style']['chat_button_section']['hover_animation_type'] ) {
1268 $this->add_hover_animation_control(
1269 'style_button_color_hover_animation',
1270 );
1271 }
1272
1273 $this->end_controls_tab();
1274
1275 if ( $config['content']['chat_button_section']['has_active_tab'] ) {
1276 $this->start_controls_tab(
1277 'style_button_color_tabs_active',
1278 [
1279 'label' => esc_html__( 'Active', 'elementor' ),
1280 ]
1281 );
1282
1283 $this->add_control(
1284 'style_button_color_icon_active',
1285 [
1286 'label' => esc_html__( 'Icon Color', 'elementor' ),
1287 'type' => Controls_Manager::COLOR,
1288 'selectors' => [
1289 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-active-button-color: {{VALUE}}',
1290 ],
1291 ]
1292 );
1293
1294 $this->add_control(
1295 'style_button_color_background_active',
1296 [
1297 'label' => esc_html__( 'Background Color', 'elementor' ),
1298 'type' => Controls_Manager::COLOR,
1299 'selectors' => [
1300 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-active-button-bg: {{VALUE}}',
1301 ],
1302 ]
1303 );
1304
1305 $this->end_controls_tab();
1306 }
1307
1308 $this->end_controls_tabs();
1309 }
1310
1311 if ( $config['style']['chat_button_section']['has_platform_color_controls'] ) {
1312 $this->add_control(
1313 'style_platform_control_select',
1314 [
1315 'label' => esc_html__( 'Colors', 'elementor' ),
1316 'type' => Controls_Manager::SELECT,
1317 'default' => 'default',
1318 'options' => [
1319 'default' => esc_html__( 'Default', 'elementor' ),
1320 'custom' => esc_html__( 'Custom', 'elementor' ),
1321 ],
1322 'separator' => 'before',
1323 ]
1324 );
1325
1326 $this->add_control(
1327 'style_button_color_icon',
1328 [
1329 'label' => $config['style']['chat_button_section']['icon_color_label'],
1330 'type' => Controls_Manager::COLOR,
1331 'selectors' => [
1332 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon: {{VALUE}}',
1333 ],
1334 'condition' => [
1335 'style_platform_control_select' => 'custom',
1336 ],
1337 ]
1338 );
1339
1340 $this->add_control(
1341 'style_button_color_background',
1342 [
1343 'label' => esc_html__( 'Background Color', 'elementor' ),
1344 'type' => Controls_Manager::COLOR,
1345 'selectors' => [
1346 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg: {{VALUE}}',
1347 ],
1348 'condition' => [
1349 'style_platform_control_select' => 'custom',
1350 ],
1351 ]
1352 );
1353 }
1354
1355 if ( $config['style']['chat_button_section']['has_entrance_animation'] ) {
1356 $this->add_responsive_control(
1357 'style_chat_button_animation',
1358 [
1359 'label' => esc_html__( 'Entrance Animation', 'elementor' ),
1360 'type' => Controls_Manager::ANIMATION,
1361 'frontend_available' => true,
1362 'separator' => 'before',
1363 ]
1364 );
1365
1366 $this->add_control(
1367 'style_chat_button_animation_duration',
1368 [
1369 'label' => esc_html__( 'Animation Duration', 'elementor' ),
1370 'type' => Controls_Manager::SELECT,
1371 'default' => 'normal',
1372 'options' => [
1373 'slow' => esc_html__( 'Slow', 'elementor' ),
1374 'normal' => esc_html__( 'Normal', 'elementor' ),
1375 'fast' => esc_html__( 'Fast', 'elementor' ),
1376 ],
1377 'prefix_class' => 'animated-',
1378 ]
1379 );
1380
1381 $this->add_control(
1382 'style_chat_button_animation_delay',
1383 [
1384 'label' => esc_html__( 'Animation Delay', 'elementor' ) . ' (ms)',
1385 'type' => Controls_Manager::NUMBER,
1386 'default' => 0,
1387 'min' => 0,
1388 'step' => 100,
1389 'selectors' => [
1390 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-button-chat-button-animation-delay: {{SIZE}}ms;',
1391 ],
1392 'render_type' => 'none',
1393 'frontend_available' => true,
1394 'separator' => 'after',
1395 ]
1396 );
1397 }
1398
1399 if ( $config['style']['chat_button_section']['has_box_shadow'] ) {
1400 $this->add_group_control(
1401 Group_Control_Box_Shadow::get_type(),
1402 [
1403 'name' => 'style_chat_button_box_shadow',
1404 'selector' => '{{WRAPPER}} .e-contact-buttons__chat-button-shadow',
1405 'fields_options' => static::BOX_SHADOW_FIELDS_OPTIONS,
1406 ]
1407 );
1408 }
1409
1410 if ( $config['style']['chat_button_section']['has_drop_shadow'] ) {
1411 $this->add_group_control(
1412 Group_Control_Box_Shadow::get_type(),
1413 [
1414 'name' => 'style_chat_button_box_shadow',
1415 'fields_options' => [
1416 'box_shadow_type' => [
1417 'default' => 'yes',
1418 ],
1419 'box_shadow' => [
1420 'default' => [
1421 'horizontal' => 4,
1422 'vertical' => 4,
1423 'blur' => 10,
1424 'spread' => 0,
1425 'color' => 'rgba(0,0,0,0.15)',
1426 ],
1427 'selectors' => [
1428 '{{WRAPPER}} .e-contact-buttons__chat-button-drop-shadow' => 'filter: drop-shadow({{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{COLOR}});',
1429 ],
1430 ],
1431 ],
1432 ]
1433 );
1434 }
1435
1436 if ( $config['style']['chat_button_section']['has_padding'] ) {
1437 $this->add_responsive_control(
1438 'style_chat_button_padding',
1439 [
1440 'label' => esc_html__( 'Padding', 'elementor' ),
1441 'type' => Controls_Manager::DIMENSIONS,
1442 'size_units' => [ 'px', '%', 'em', 'rem' ],
1443 'default' => $config['style']['chat_button_section']['padding_defaults'],
1444 'selectors' => [
1445 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-button-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-chat-button-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-chat-button-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-chat-button-padding-inline-start: {{LEFT}}{{UNIT}};',
1446 ],
1447 'separator' => 'before',
1448 ]
1449 );
1450 }
1451
1452 if ( 'custom' == $config['style']['chat_button_section']['hover_animation_type'] ) {
1453 $this->add_control(
1454 'style_chat_button_custom_animation_heading',
1455 [
1456 'label' => esc_html__( 'Hover Animation', 'elementor' ),
1457 'type' => Controls_Manager::HEADING,
1458 'separator' => 'before',
1459 ]
1460 );
1461
1462 $this->add_control(
1463 'style_chat_button_custom_animation_alert',
1464 [
1465 'type' => Controls_Manager::ALERT,
1466 'alert_type' => 'info',
1467 'content' => __( 'Hover animation is <b>desktop only</b>', 'elementor' ),
1468 ]
1469 );
1470
1471 $this->add_control(
1472 'style_chat_button_custom_animation_transition',
1473 [
1474 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
1475 'type' => Controls_Manager::SLIDER,
1476 'range' => [
1477 's' => [
1478 'min' => 0,
1479 'max' => 3,
1480 'step' => 0.1,
1481 ],
1482 ],
1483 'default' => [
1484 'unit' => 's',
1485 'size' => 0.3,
1486 ],
1487 'selectors' => [
1488 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-transition-duration: {{SIZE}}{{UNIT}}',
1489 ],
1490 ]
1491 );
1492 }
1493
1494 $this->end_controls_section();
1495 }
1496
1497 protected function add_style_top_bar_section(): void {
1498 $config = static::get_configuration();
1499
1500 $this->start_controls_section(
1501 'style_top_bar_section',
1502 [
1503 'label' => $config['content']['top_bar_section']['section_name'],
1504 'tab' => Controls_Manager::TAB_STYLE,
1505 ]
1506 );
1507
1508 if ( $config['content']['top_bar_section']['has_image'] ) {
1509 $this->add_control(
1510 'style_top_bar_profile_heading',
1511 [
1512 'label' => esc_html__( 'Profile Image', 'elementor' ),
1513 'type' => Controls_Manager::HEADING,
1514 'separator' => 'before',
1515 ]
1516 );
1517
1518 $this->add_control(
1519 'style_top_bar_image_size',
1520 [
1521 'label' => esc_html__( 'Size', 'elementor' ),
1522 'type' => Controls_Manager::SELECT,
1523 'default' => 'medium',
1524 'options' => [
1525 'small' => esc_html__( 'Small', 'elementor' ),
1526 'medium' => esc_html__( 'Medium', 'elementor' ),
1527 'large' => esc_html__( 'Large', 'elementor' ),
1528 ],
1529 ]
1530 );
1531 }
1532
1533 if ( $config['style']['has_platform_colors'] ) {
1534 $this->add_control(
1535 'style_top_bar_colors',
1536 [
1537 'label' => esc_html__( 'Colors', 'elementor' ),
1538 'type' => Controls_Manager::SELECT,
1539 'default' => 'default',
1540 'options' => [
1541 'default' => esc_html__( 'Default', 'elementor' ),
1542 'custom' => esc_html__( 'Custom', 'elementor' ),
1543 ],
1544 'separator' => 'before',
1545 ]
1546 );
1547 }
1548
1549 if ( $config['style']['top_bar_section']['has_title_heading'] ) {
1550 $this->add_control(
1551 'style_top_bar_title_heading',
1552 [
1553 'label' => $config['style']['top_bar_section']['title_heading_label'],
1554 'type' => Controls_Manager::HEADING,
1555 'separator' => ! $config['style']['has_platform_colors'] ? 'before' : false,
1556 ]
1557 );
1558 }
1559
1560 $this->add_control(
1561 'style_top_bar_title_color',
1562 [
1563 'label' => esc_html__( 'Text Color', 'elementor' ),
1564 'type' => Controls_Manager::COLOR,
1565 'selectors' => [
1566 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-title: {{VALUE}}',
1567 ],
1568 'condition' => $this->get_platform_color_condition( [
1569 'style_top_bar_colors' => 'custom',
1570 ] ),
1571 ]
1572 );
1573
1574 $this->add_group_control(
1575 Group_Control_Typography::get_type(),
1576 [
1577 'name' => 'style_top_bar_title_typography',
1578 'selector' => '{{WRAPPER}} .e-contact-buttons__top-bar-title',
1579 ]
1580 );
1581
1582 if ( $config['content']['top_bar_section']['has_subtitle'] ) {
1583 $this->add_control(
1584 'style_top_bar_subtitle_heading',
1585 [
1586 'label' => $config['style']['top_bar_section']['subtitle_heading_label'],
1587 'type' => Controls_Manager::HEADING,
1588 'separator' => false,
1589 ]
1590 );
1591
1592 $this->add_control(
1593 'style_top_bar_subtitle_color',
1594 [
1595 'label' => esc_html__( 'Text Color', 'elementor' ),
1596 'type' => Controls_Manager::COLOR,
1597 'selectors' => [
1598 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-subtitle: {{VALUE}}',
1599 ],
1600 'condition' => $this->get_platform_color_condition( [
1601 'style_top_bar_colors' => 'custom',
1602 ] ),
1603 ]
1604 );
1605
1606 $this->add_group_control(
1607 Group_Control_Typography::get_type(),
1608 [
1609 'name' => 'style_top_bar_subtitle_typography',
1610 'selector' => '{{WRAPPER}} .e-contact-buttons__top-bar-subtitle',
1611 ]
1612 );
1613 }
1614
1615 $close_and_background_partial_divider = 'before';
1616
1617 if ( $config['style']['top_bar_section']['has_style_close_button'] ) {
1618
1619 if ( $config['style']['top_bar_section']['has_close_button_heading'] ) {
1620 $this->add_control(
1621 'style_top_bar_close_button_heading',
1622 [
1623 'label' => esc_html__( 'Close Button', 'elementor' ),
1624 'type' => Controls_Manager::HEADING,
1625 'separator' => $close_and_background_partial_divider,
1626 'condition' => $this->get_platform_color_condition( [
1627 'style_top_bar_colors' => 'custom',
1628 ] ),
1629 ]
1630 );
1631 $close_and_background_partial_divider = false;
1632 }
1633
1634 $this->add_control(
1635 'style_top_bar_close_button_color',
1636 [
1637 'label' => esc_html__( 'Close Button Color', 'elementor' ),
1638 'type' => Controls_Manager::COLOR,
1639 'selectors' => [
1640 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-close-button-color: {{VALUE}}',
1641 ],
1642 'condition' => $this->get_platform_color_condition( [
1643 'style_top_bar_colors' => 'custom',
1644 ] ),
1645 'separator' => $close_and_background_partial_divider,
1646 ]
1647 );
1648
1649 $close_and_background_partial_divider = false;
1650 }
1651
1652 if ( $config['style']['top_bar_section']['has_background'] ) {
1653
1654 if ( $config['style']['top_bar_section']['has_background_heading'] ) {
1655 $this->add_control(
1656 'style_top_bar_background_heading',
1657 [
1658 'label' => esc_html__( 'Background', 'elementor' ),
1659 'type' => Controls_Manager::HEADING,
1660 'separator' => $close_and_background_partial_divider,
1661 'condition' => $this->get_platform_color_condition( [
1662 'style_top_bar_colors' => 'custom',
1663 ] ),
1664 ]
1665 );
1666 $close_and_background_partial_divider = false;
1667 }
1668
1669 $this->add_control(
1670 'style_top_bar_background_color',
1671 [
1672 'label' => esc_html__( 'Background Color', 'elementor' ),
1673 'type' => Controls_Manager::COLOR,
1674 'selectors' => [
1675 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-bg: {{VALUE}}',
1676 ],
1677 'condition' => $this->get_platform_color_condition( [
1678 'style_top_bar_colors' => 'custom',
1679 ] ),
1680 'separator' => $close_and_background_partial_divider,
1681 ]
1682 );
1683 }
1684
1685 $this->end_controls_section();
1686 }
1687
1688 protected function add_style_message_bubble_section(): void {
1689 $config = static::get_configuration();
1690
1691 $this->start_controls_section(
1692 'style_bubble_section',
1693 [
1694 'label' => esc_html__( 'Message Bubble', 'elementor' ),
1695 'tab' => Controls_Manager::TAB_STYLE,
1696 ]
1697 );
1698
1699 if ( $config['style']['has_platform_colors'] ) {
1700 $this->add_control(
1701 'style_bubble_colors',
1702 [
1703 'label' => esc_html__( 'Colors', 'elementor' ),
1704 'type' => Controls_Manager::SELECT,
1705 'default' => 'default',
1706 'options' => [
1707 'default' => esc_html__( 'Default', 'elementor' ),
1708 'custom' => esc_html__( 'Custom', 'elementor' ),
1709 ],
1710 ]
1711 );
1712 }
1713
1714 $this->add_control(
1715 'style_bubble_name_heading',
1716 [
1717 'label' => esc_html__( 'Name', 'elementor' ),
1718 'type' => Controls_Manager::HEADING,
1719 'separator' => false,
1720 ]
1721 );
1722
1723 $this->add_control(
1724 'style_bubble_name_color',
1725 [
1726 'label' => esc_html__( 'Text Color', 'elementor' ),
1727 'type' => Controls_Manager::COLOR,
1728 'selectors' => [
1729 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-name: {{VALUE}}',
1730 ],
1731 'condition' => $this->get_platform_color_condition( [
1732 'style_bubble_colors' => 'custom',
1733 ] ),
1734 ]
1735 );
1736
1737 $this->add_group_control(
1738 Group_Control_Typography::get_type(),
1739 [
1740 'name' => 'style_bubble_name_typography',
1741 'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-name',
1742 ]
1743 );
1744
1745 $this->add_control(
1746 'style_bubble_message_heading',
1747 [
1748 'label' => esc_html__( 'Message', 'elementor' ),
1749 'type' => Controls_Manager::HEADING,
1750 'separator' => false,
1751 ]
1752 );
1753
1754 $this->add_control(
1755 'style_bubble_message_color',
1756 [
1757 'label' => esc_html__( 'Text Color', 'elementor' ),
1758 'type' => Controls_Manager::COLOR,
1759 'selectors' => [
1760 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-body: {{VALUE}}',
1761 ],
1762 'condition' => $this->get_platform_color_condition( [
1763 'style_bubble_colors' => 'custom',
1764 ] ),
1765 ]
1766 );
1767
1768 $this->add_group_control(
1769 Group_Control_Typography::get_type(),
1770 [
1771 'name' => 'style_bubble_message_typography',
1772 'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-body',
1773 ]
1774 );
1775
1776 $this->add_control(
1777 'style_bubble_time_heading',
1778 [
1779 'label' => esc_html__( 'Time', 'elementor' ),
1780 'type' => Controls_Manager::HEADING,
1781 'separator' => false,
1782 ]
1783 );
1784
1785 $this->add_control(
1786 'style_bubble_time_color',
1787 [
1788 'label' => esc_html__( 'Text Color', 'elementor' ),
1789 'type' => Controls_Manager::COLOR,
1790 'selectors' => [
1791 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-time: {{VALUE}}',
1792 ],
1793 'condition' => $this->get_platform_color_condition( [
1794 'style_bubble_colors' => 'custom',
1795 ] ),
1796 ]
1797 );
1798
1799 $this->add_group_control(
1800 Group_Control_Typography::get_type(),
1801 [
1802 'name' => 'style_bubble_time_typography',
1803 'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-time',
1804 ]
1805 );
1806
1807 $this->add_control(
1808 'style_bubble_background_color',
1809 [
1810 'label' => esc_html__( 'Bubble Background Color', 'elementor' ),
1811 'type' => Controls_Manager::COLOR,
1812 'selectors' => [
1813 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-bubble-bg: {{VALUE}}',
1814 ],
1815 'condition' => $this->get_platform_color_condition( [
1816 'style_bubble_colors' => 'custom',
1817 ] ),
1818 'separator' => 'before',
1819 ]
1820 );
1821
1822 if ( $config['style']['message_bubble_section']['has_chat_background'] ) {
1823 $this->add_control(
1824 'style_bubble_chat_color',
1825 [
1826 'label' => esc_html__( 'Chat Background Color', 'elementor' ),
1827 'type' => Controls_Manager::COLOR,
1828 'selectors' => [
1829 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-chat-bg: {{VALUE}}',
1830 ],
1831 'condition' => $this->get_platform_color_condition( [
1832 'style_bubble_colors' => 'custom',
1833 ] ),
1834 ]
1835 );
1836 }
1837
1838 $this->end_controls_section();
1839 }
1840
1841 protected function add_style_contact_section(): void {
1842 $config = static::get_configuration();
1843
1844 $this->start_controls_section(
1845 'style_contact_section',
1846 [
1847 'label' => $config['content']['contact_section']['section_name'],
1848 'tab' => Controls_Manager::TAB_STYLE,
1849 ]
1850 );
1851
1852 if ( $config['content']['contact_section']['has_cta_text'] ) {
1853 $this->add_control(
1854 'style_contact_text_heading',
1855 [
1856 'label' => esc_html__( 'Call to Action Text', 'elementor' ),
1857 'type' => Controls_Manager::HEADING,
1858 'separator' => false,
1859 'condition' => $this->get_platform_color_condition( [
1860 'style_bubble_colors' => 'custom',
1861 ] ),
1862 ]
1863 );
1864
1865 $this->add_control(
1866 'style_contact_text_color',
1867 [
1868 'label' => esc_html__( 'Color', 'elementor' ),
1869 'type' => Controls_Manager::COLOR,
1870 'selectors' => [
1871 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-text: {{VALUE}}',
1872 ],
1873 ]
1874 );
1875
1876 $this->add_group_control(
1877 Group_Control_Typography::get_type(),
1878 [
1879 'name' => 'style_contact_text_typography',
1880 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-text',
1881 ]
1882 );
1883 }
1884
1885 if ( $config['style']['contact_section']['has_buttons_heading'] ) {
1886 $this->add_control(
1887 'style_contact_buttons_heading',
1888 [
1889 'label' => $config['style']['contact_section']['buttons_heading_label'],
1890 'type' => Controls_Manager::HEADING,
1891 'separator' => false,
1892 'condition' => $this->get_platform_color_condition( [
1893 'style_bubble_colors' => 'custom',
1894 ] ),
1895 ]
1896 );
1897 }
1898
1899 if ( $config['style']['contact_section']['has_buttons_size'] ) {
1900 $this->add_control(
1901 'style_contact_button_size',
1902 [
1903 'label' => esc_html__( 'Size', 'elementor' ),
1904 'type' => Controls_Manager::SELECT,
1905 'default' => 'small',
1906 'options' => [
1907 'small' => esc_html__( 'Small', 'elementor' ),
1908 'medium' => esc_html__( 'Medium', 'elementor' ),
1909 'large' => esc_html__( 'Large', 'elementor' ),
1910 ],
1911 ]
1912 );
1913 }
1914
1915 if ( $config['style']['contact_section']['has_text_color'] ) {
1916 $this->add_control(
1917 'style_contact_button_text_color',
1918 [
1919 'label' => $config['style']['contact_section']['icon_color_label'],
1920 'type' => Controls_Manager::COLOR,
1921 'selectors' => [
1922 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}',
1923 ],
1924 ]
1925 );
1926 }
1927
1928 if ( $config['style']['contact_section']['has_typography'] ) {
1929 $this->add_group_control(
1930 Group_Control_Typography::get_type(),
1931 [
1932 'name' => 'style_contact_typography',
1933 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-icon-link',
1934 ]
1935 );
1936 }
1937
1938 if ( $config['style']['contact_section']['has_bg_color'] ) {
1939 $this->add_control(
1940 'style_contact_button_bg_color',
1941 [
1942 'label' => esc_html__( 'Background Color', 'elementor' ),
1943 'type' => Controls_Manager::COLOR,
1944 'selectors' => [
1945 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}',
1946 ],
1947 ]
1948 );
1949 }
1950
1951 if ( $config['style']['contact_section']['has_tabs'] ) {
1952 $this->start_controls_tabs(
1953 'style_contact_button_color_tabs'
1954 );
1955
1956 $this->start_controls_tab(
1957 'style_contact_button_color_tabs_normal',
1958 [
1959 'label' => esc_html__( 'Normal', 'elementor' ),
1960 ]
1961 );
1962
1963 $this->add_control(
1964 'style_contact_button_color_icon',
1965 [
1966 'label' => $config['style']['contact_section']['icon_color_label'],
1967 'type' => Controls_Manager::COLOR,
1968 'selectors' => [
1969 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}',
1970 ],
1971 ]
1972 );
1973
1974 if ( $config['style']['contact_section']['has_icon_bg_color'] ) {
1975 $this->add_control(
1976 'style_contact_button_color_background',
1977 [
1978 'label' => esc_html__( 'Background Color', 'elementor' ),
1979 'type' => Controls_Manager::COLOR,
1980 'selectors' => [
1981 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}',
1982 ],
1983 ]
1984 );
1985 }
1986
1987 $this->end_controls_tab();
1988
1989 $this->start_controls_tab(
1990 'style_contact_button_color_tabs_hover',
1991 [
1992 'label' => esc_html__( 'Hover', 'elementor' ),
1993 ]
1994 );
1995
1996 $this->add_control(
1997 'style_contact_button_color_icon_hover',
1998 [
1999 'label' => esc_html__( 'Icon Color', 'elementor' ),
2000 'type' => Controls_Manager::COLOR,
2001 'selectors' => [
2002 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon-hover: {{VALUE}}',
2003 ],
2004 ]
2005 );
2006
2007 if ( $config['style']['contact_section']['has_icon_bg_color'] ) {
2008 $this->add_control(
2009 'style_contact_button_color_background_hover',
2010 [
2011 'label' => esc_html__( 'Background Color', 'elementor' ),
2012 'type' => Controls_Manager::COLOR,
2013 'selectors' => [
2014 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg-hover: {{VALUE}}',
2015 ],
2016 ]
2017 );
2018 }
2019
2020 if ( $config['style']['contact_section']['has_hover_animation'] ) {
2021 $this->add_hover_animation_control(
2022 'style_contact_button_hover_animation',
2023 );
2024 }
2025
2026 $this->end_controls_tab();
2027
2028 $this->end_controls_tabs();
2029 }
2030
2031 if ( $config['style']['contact_section']['has_buttons_spacing'] ) {
2032
2033 $this->add_responsive_control(
2034 'style_contact_buttons_spacing',
2035 [
2036 'label' => esc_html__( 'Buttons Spacing', 'elementor' ),
2037 'type' => Controls_Manager::SLIDER,
2038 'range' => [
2039 '%' => [
2040 'min' => 10,
2041 'max' => 100,
2042 ],
2043 'px' => [
2044 'min' => 0,
2045 'max' => 100,
2046 ],
2047 ],
2048 'default' => $config['style']['contact_section']['buttons_spacing_default'],
2049 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2050 'selectors' => [
2051 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-gap: {{SIZE}}{{UNIT}}',
2052 ],
2053 'separator' => 'before',
2054 ]
2055 );
2056 }
2057
2058 if ( $config['style']['contact_section']['has_button_corners'] ) {
2059 $this->add_control(
2060 'style_contact_corners',
2061 [
2062 'label' => esc_html__( 'Corners', 'elementor' ),
2063 'type' => Controls_Manager::SELECT,
2064 'default' => 'round',
2065 'options' => [
2066 'round' => esc_html__( 'Round', 'elementor' ),
2067 'rounded' => esc_html__( 'Rounded', 'elementor' ),
2068 'sharp' => esc_html__( 'Sharp', 'elementor' ),
2069 ],
2070 ]
2071 );
2072 }
2073
2074 if ( $config['style']['contact_section']['has_box_shadow'] ) {
2075 $this->add_group_control(
2076 Group_Control_Box_Shadow::get_type(),
2077 [
2078 'name' => 'style_contact_icons_box_shadow',
2079 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-box-shadow',
2080 'fields_options' => static::BOX_SHADOW_FIELDS_OPTIONS,
2081 ]
2082 );
2083 }
2084
2085 if ( $config['content']['contact_section']['repeater']['has_tooltip'] ) {
2086 $this->add_control(
2087 'style_contact_tooltip_heading',
2088 [
2089 'label' => esc_html__( 'Tooltips', 'elementor' ),
2090 'type' => Controls_Manager::HEADING,
2091 'separator' => 'before',
2092 ]
2093 );
2094
2095 $this->add_control(
2096 'style_contact_tooltip_text_color',
2097 [
2098 'label' => esc_html__( 'Text Color', 'elementor' ),
2099 'type' => Controls_Manager::COLOR,
2100 'selectors' => [
2101 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-tooltip-text: {{VALUE}}',
2102 ],
2103 ]
2104 );
2105
2106 $this->add_group_control(
2107 Group_Control_Typography::get_type(),
2108 [
2109 'name' => 'style_contact_tooltip_typography',
2110 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-tooltip',
2111 ]
2112 );
2113
2114 $this->add_control(
2115 'style_contact_tooltip_bg_color',
2116 [
2117 'label' => esc_html__( 'Background Color', 'elementor' ),
2118 'type' => Controls_Manager::COLOR,
2119 'selectors' => [
2120 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-tooltip-bg: {{VALUE}}',
2121 ],
2122 ]
2123 );
2124 }
2125
2126 if ( $config['style']['contact_section']['has_chat_box_animation'] ) {
2127 $this->chat_box_animation_controls();
2128 }
2129
2130 if ( $config['style']['contact_section']['has_button_bar'] ) {
2131 $this->add_control(
2132 'style_contact_button_bar_heading',
2133 [
2134 'label' => esc_html__( 'Button Bar', 'elementor' ),
2135 'type' => Controls_Manager::HEADING,
2136 'separator' => 'before',
2137 ]
2138 );
2139
2140 $this->add_control(
2141 'style_contact_button_bar_bg_color',
2142 [
2143 'label' => esc_html__( 'Background Color', 'elementor' ),
2144 'type' => Controls_Manager::COLOR,
2145 'selectors' => [
2146 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bar-bg: {{VALUE}}',
2147 ],
2148 ]
2149 );
2150
2151 $this->add_control(
2152 'style_contact_button_bar_corners',
2153 [
2154 'label' => esc_html__( 'Corners', 'elementor' ),
2155 'type' => Controls_Manager::SELECT,
2156 'default' => 'round',
2157 'options' => [
2158 'round' => esc_html__( 'Round', 'elementor' ),
2159 'rounded' => esc_html__( 'Rounded', 'elementor' ),
2160 'sharp' => esc_html__( 'Sharp', 'elementor' ),
2161 ],
2162 ]
2163 );
2164
2165 $this->add_responsive_control(
2166 'style_contact_button_bar_padding',
2167 [
2168 'label' => esc_html__( 'Padding', 'elementor' ),
2169 'type' => Controls_Manager::DIMENSIONS,
2170 'size_units' => [ 'px', '%', 'em', 'rem' ],
2171 'default' => [
2172 'top' => '12',
2173 'bottom' => '12',
2174 'left' => '12',
2175 'right' => '12',
2176 'unit' => 'px',
2177 'isLinked' => true,
2178 ],
2179 'selectors' => [
2180 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bar-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-button-bar-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-button-bar-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-button-bar-padding-inline-start: {{LEFT}}{{UNIT}};',
2181 ],
2182 'separator' => 'before',
2183 ]
2184 );
2185 }
2186
2187 if ( $config['style']['contact_section']['has_padding'] ) {
2188 $this->add_responsive_control(
2189 'style_contact_padding',
2190 [
2191 'label' => esc_html__( 'Padding', 'elementor' ),
2192 'type' => Controls_Manager::DIMENSIONS,
2193 'size_units' => [ 'px', '%', 'em', 'rem' ],
2194 'default' => [
2195 'top' => '8',
2196 'bottom' => '8',
2197 'left' => '12',
2198 'right' => '12',
2199 'unit' => 'px',
2200 'isLinked' => false,
2201 ],
2202 'selectors' => [
2203 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-contact-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-contact-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-contact-padding-inline-start: {{LEFT}}{{UNIT}};',
2204 ],
2205 'separator' => 'before',
2206 ]
2207 );
2208 }
2209
2210 if ( $config['style']['contact_section']['has_hover_transition_duration'] ) {
2211 $this->add_control(
2212 'style_contact_custom_animation_heading',
2213 [
2214 'label' => esc_html__( 'Animation', 'elementor' ),
2215 'type' => Controls_Manager::HEADING,
2216 ]
2217 );
2218
2219 $this->add_control(
2220 'style_contact_custom_animation_alert',
2221 [
2222 'type' => Controls_Manager::ALERT,
2223 'alert_type' => 'info',
2224 'content' => __( 'Adjust transition duration to change the speed of the <b>hover animation on desktop</b> and the <b>click animation on touchscreen</b>.', 'elementor' ),
2225 ]
2226 );
2227
2228 $this->add_control(
2229 'style_contact_custom_animation_transition',
2230 [
2231 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
2232 'type' => Controls_Manager::SLIDER,
2233 'range' => [
2234 's' => [
2235 'min' => 0,
2236 'max' => 3,
2237 'step' => 0.1,
2238 ],
2239 ],
2240 'default' => [
2241 'unit' => 's',
2242 'size' => 0.3,
2243 ],
2244 'selectors' => [
2245 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-transition-duration: {{SIZE}}{{UNIT}}',
2246 ],
2247 ]
2248 );
2249 }
2250
2251 $this->end_controls_section();
2252 }
2253
2254 protected function add_style_resource_links_section(): void {
2255 $this->start_controls_section(
2256 'style_resource_links_section',
2257 [
2258 'label' => esc_html__( 'Resource Links', 'elementor' ),
2259 'tab' => Controls_Manager::TAB_STYLE,
2260 ]
2261 );
2262
2263 $this->add_control(
2264 'style_resource_links_icons_heading',
2265 [
2266 'label' => esc_html__( 'Icons', 'elementor' ),
2267 'type' => Controls_Manager::HEADING,
2268 'separator' => false,
2269 ]
2270 );
2271
2272 $this->add_control(
2273 'style_resource_links_button_size',
2274 [
2275 'label' => esc_html__( 'Size', 'elementor' ),
2276 'type' => Controls_Manager::SELECT,
2277 'default' => 'small',
2278 'options' => [
2279 'small' => esc_html__( 'Small', 'elementor' ),
2280 'medium' => esc_html__( 'Medium', 'elementor' ),
2281 'large' => esc_html__( 'Large', 'elementor' ),
2282 ],
2283 ]
2284 );
2285
2286 $this->add_control(
2287 'style_resource_links_color_select',
2288 [
2289 'label' => esc_html__( 'Color', 'elementor' ),
2290 'type' => Controls_Manager::SELECT,
2291 'default' => 'custom',
2292 'options' => [
2293 'default' => esc_html__( 'Default', 'elementor' ),
2294 'custom' => esc_html__( 'Custom', 'elementor' ),
2295 ],
2296 ]
2297 );
2298
2299 $this->add_control(
2300 'style_contact_icon_color',
2301 [
2302 'label' => esc_html__( 'Color', 'elementor' ),
2303 'type' => Controls_Manager::COLOR,
2304 'selectors' => [
2305 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}',
2306 ],
2307 'condition' => [
2308 'style_resource_links_color_select' => 'custom',
2309 ],
2310 ]
2311 );
2312
2313 $this->add_control(
2314 'style_resource_links_title_heading',
2315 [
2316 'label' => esc_html__( 'Title', 'elementor' ),
2317 'type' => Controls_Manager::HEADING,
2318 'separator' => false,
2319 ]
2320 );
2321
2322 $this->add_control(
2323 'style_resource_links_title_color',
2324 [
2325 'label' => esc_html__( 'Text Color', 'elementor' ),
2326 'type' => Controls_Manager::COLOR,
2327 'selectors' => [
2328 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-title-text-color: {{VALUE}}',
2329 ],
2330 ]
2331 );
2332
2333 $this->add_group_control(
2334 Group_Control_Typography::get_type(),
2335 [
2336 'name' => 'style_resource_links_title_typography',
2337 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-title',
2338 ]
2339 );
2340
2341 $this->add_control(
2342 'style_resource_links_description_heading',
2343 [
2344 'label' => esc_html__( 'Description', 'elementor' ),
2345 'type' => Controls_Manager::HEADING,
2346 'separator' => false,
2347 ]
2348 );
2349
2350 $this->add_control(
2351 'style_resource_links_description_color',
2352 [
2353 'label' => esc_html__( 'Text Color', 'elementor' ),
2354 'type' => Controls_Manager::COLOR,
2355 'selectors' => [
2356 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-description-text-color: {{VALUE}}',
2357 ],
2358 ]
2359 );
2360
2361 $this->add_group_control(
2362 Group_Control_Typography::get_type(),
2363 [
2364 'name' => 'style_resource_links_description_typography',
2365 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-description',
2366 ]
2367 );
2368
2369 $this->add_control(
2370 'style_resource_links_bg_color',
2371 [
2372 'label' => esc_html__( 'Background Color', 'elementor' ),
2373 'type' => Controls_Manager::COLOR,
2374 'selectors' => [
2375 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}',
2376 ],
2377 'separator' => 'before',
2378 ]
2379 );
2380
2381 $this->add_hover_animation_control(
2382 'style_resource_links_hover_animation',
2383 );
2384
2385 $this->end_controls_section();
2386 }
2387
2388 protected function add_style_info_links_section(): void {
2389 $this->start_controls_section(
2390 'style_info_links_section',
2391 [
2392 'label' => esc_html__( 'Info Links', 'elementor' ),
2393 'tab' => Controls_Manager::TAB_STYLE,
2394 ]
2395 );
2396
2397 $this->add_control(
2398 'style_info_links_icon_position',
2399 [
2400 'label' => esc_html__( 'Icon Position', 'elementor' ),
2401 'type' => Controls_Manager::CHOOSE,
2402 'options' => [
2403 'start' => [
2404 'title' => esc_html__( 'Left', 'elementor' ),
2405 'icon' => 'eicon-h-align-left',
2406 ],
2407 'end' => [
2408 'title' => esc_html__( 'Right', 'elementor' ),
2409 'icon' => 'eicon-h-align-right',
2410 ],
2411 ],
2412 'default' => 'start',
2413 'toggle' => true,
2414 ]
2415 );
2416
2417 $this->add_control(
2418 'style_info_links_icon_spacing',
2419 [
2420 'label' => esc_html__( 'Icon Spacing', 'elementor' ),
2421 'type' => Controls_Manager::SLIDER,
2422 'range' => [
2423 '%' => [
2424 'min' => 10,
2425 'max' => 100,
2426 ],
2427 'px' => [
2428 'min' => 0,
2429 'max' => 20,
2430 ],
2431 ],
2432 'default' => [
2433 'unit' => 'px',
2434 'size' => 12,
2435 ],
2436 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2437 'selectors' => [
2438 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-gap: {{SIZE}}{{UNIT}}',
2439 ],
2440 ]
2441 );
2442
2443 $this->add_responsive_control(
2444 'style_info_links_link_spacing',
2445 [
2446 'label' => esc_html__( 'Link Spacing', 'elementor' ),
2447 'type' => Controls_Manager::SLIDER,
2448 'range' => [
2449 '%' => [
2450 'min' => 10,
2451 'max' => 100,
2452 ],
2453 'px' => [
2454 'min' => 0,
2455 'max' => 10,
2456 ],
2457 ],
2458 'default' => [
2459 'unit' => 'px',
2460 'size' => 12,
2461 ],
2462 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2463 'selectors' => [
2464 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-spacing: {{SIZE}}{{UNIT}}',
2465 ],
2466 ]
2467 );
2468
2469 $this->add_group_control(
2470 Group_Control_Typography::get_type(),
2471 [
2472 'name' => 'style_info_links_typography',
2473 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-icon-link',
2474 ]
2475 );
2476
2477 $this->start_controls_tabs(
2478 'style_info_links_tabs'
2479 );
2480
2481 $this->start_controls_tab(
2482 'style_info_links_tabs_normal',
2483 [
2484 'label' => esc_html__( 'Normal', 'elementor' ),
2485 ]
2486 );
2487
2488 $this->add_control(
2489 'style_info_links_normal_text_color',
2490 [
2491 'label' => esc_html__( 'Text and Icon Color', 'elementor' ),
2492 'type' => Controls_Manager::COLOR,
2493 'selectors' => [
2494 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-text-color: {{VALUE}}',
2495 ],
2496 ]
2497 );
2498
2499 $this->end_controls_tab();
2500
2501 $this->start_controls_tab(
2502 'style_info_links_tabs_hover',
2503 [
2504 'label' => esc_html__( 'Hover', 'elementor' ),
2505 ]
2506 );
2507
2508 $this->add_control(
2509 'style_info_links_hover_text_color',
2510 [
2511 'label' => esc_html__( 'Text and Icon Color', 'elementor' ),
2512 'type' => Controls_Manager::COLOR,
2513 'selectors' => [
2514 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-text-color-hover: {{VALUE}}',
2515 ],
2516 ]
2517 );
2518
2519 $this->add_control(
2520 'style_info_links_hover_animation',
2521 [
2522 'label' => esc_html__( 'Hover Animation', 'elementor' ),
2523 'type' => Controls_Manager::HOVER_ANIMATION,
2524 'frontend_available' => true,
2525 ]
2526 );
2527
2528 $this->end_controls_tab();
2529
2530 $this->end_controls_tabs();
2531
2532 $this->add_control(
2533 'style_info_links_dividers',
2534 [
2535 'label' => esc_html__( 'Dividers', 'elementor' ),
2536 'type' => Controls_Manager::SWITCHER,
2537 'label_on' => esc_html__( 'Show', 'elementor' ),
2538 'label_off' => esc_html__( 'Hide', 'elementor' ),
2539 'return_value' => 'yes',
2540 'default' => 'yes',
2541 'separator' => 'before',
2542 ]
2543 );
2544
2545 $this->add_control(
2546 'style_info_links_divider_color',
2547 [
2548 'label' => esc_html__( 'Color', 'elementor' ),
2549 'type' => Controls_Manager::COLOR,
2550 'selectors' => [
2551 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-divider-color: {{VALUE}}',
2552 ],
2553 'condition' => [
2554 'style_info_links_dividers' => 'yes',
2555 ],
2556 ]
2557 );
2558
2559 $this->add_responsive_control(
2560 'style_info_links_divider_weight',
2561 [
2562 'label' => esc_html__( 'Weight', 'elementor' ),
2563 'type' => Controls_Manager::SLIDER,
2564 'range' => [
2565 '%' => [
2566 'min' => 10,
2567 'max' => 100,
2568 ],
2569 'px' => [
2570 'min' => 1,
2571 'max' => 10,
2572 ],
2573 ],
2574 'default' => [
2575 'unit' => 'px',
2576 'size' => 1,
2577 ],
2578 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2579 'selectors' => [
2580 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-divider-weight: {{SIZE}}{{UNIT}}',
2581 ],
2582 'condition' => [
2583 'style_info_links_dividers' => 'yes',
2584 ],
2585 ]
2586 );
2587
2588 $this->end_controls_section();
2589 }
2590
2591 protected function add_style_send_button_section(): void {
2592 $config = static::get_configuration();
2593
2594 $this->start_controls_section(
2595 'style_send_section',
2596 [
2597 'label' => $config['content']['send_button_section']['section_name'],
2598 'tab' => Controls_Manager::TAB_STYLE,
2599 ]
2600 );
2601
2602 if ( $config['style']['send_button_section']['has_typography'] ) {
2603 $this->add_group_control(
2604 Group_Control_Typography::get_type(),
2605 [
2606 'name' => 'style_send_typography',
2607 'selector' => '{{WRAPPER}} .e-contact-buttons__cta-button',
2608 ]
2609 );
2610 }
2611
2612 $this->start_controls_tabs(
2613 'style_send_tabs'
2614 );
2615
2616 $this->start_controls_tab(
2617 'style_send_tabs_normal',
2618 [
2619 'label' => esc_html__( 'Normal', 'elementor' ),
2620 ]
2621 );
2622
2623 if ( $config['style']['send_button_section']['has_platform_colors'] ) {
2624 $this->add_control(
2625 'style_send_normal_colors',
2626 [
2627 'label' => esc_html__( 'Colors', 'elementor' ),
2628 'type' => Controls_Manager::SELECT,
2629 'default' => 'default',
2630 'options' => [
2631 'default' => esc_html__( 'Default', 'elementor' ),
2632 'custom' => esc_html__( 'Custom', 'elementor' ),
2633 ],
2634 ]
2635 );
2636 }
2637
2638 if ( $config['style']['send_button_section']['has_icon_color'] ) {
2639 $this->add_control(
2640 'style_send_normal_icon_color',
2641 [
2642 'label' => esc_html__( 'Icon Color', 'elementor' ),
2643 'type' => Controls_Manager::COLOR,
2644 'selectors' => [
2645 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-icon: {{VALUE}}',
2646 ],
2647 'condition' => [
2648 'style_send_normal_colors' => 'custom',
2649 ],
2650 ]
2651 );
2652 }
2653
2654 if ( $config['style']['send_button_section']['has_text_color'] ) {
2655 $this->add_control(
2656 'style_send_normal_text_color',
2657 [
2658 'label' => esc_html__( 'Text Color', 'elementor' ),
2659 'type' => Controls_Manager::COLOR,
2660 'selectors' => [
2661 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-text: {{VALUE}}',
2662 ],
2663 ]
2664 );
2665 }
2666
2667 if ( $config['style']['send_button_section']['has_background_color'] ) {
2668 $this->add_control(
2669 'style_send_normal_background_color',
2670 [
2671 'label' => esc_html__( 'Background Color', 'elementor' ),
2672 'type' => Controls_Manager::COLOR,
2673 'selectors' => [
2674 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-bg: {{VALUE}}',
2675 ],
2676 'condition' => $this->get_platform_color_condition( [
2677 'style_send_normal_colors' => 'custom',
2678 ] ),
2679 ]
2680 );
2681 }
2682
2683 $this->end_controls_tab();
2684
2685 $this->start_controls_tab(
2686 'style_send_tabs_hover',
2687 [
2688 'label' => esc_html__( 'Hover', 'elementor' ),
2689 ]
2690 );
2691
2692 if ( $config['style']['send_button_section']['has_platform_colors'] ) {
2693 $this->add_control(
2694 'style_send_hover_colors',
2695 [
2696 'label' => esc_html__( 'Colors', 'elementor' ),
2697 'type' => Controls_Manager::SELECT,
2698 'default' => 'default',
2699 'options' => [
2700 'default' => esc_html__( 'Default', 'elementor' ),
2701 'custom' => esc_html__( 'Custom', 'elementor' ),
2702 ],
2703 ]
2704 );
2705 }
2706
2707 if ( $config['style']['send_button_section']['has_icon_color'] ) {
2708 $this->add_control(
2709 'style_send_hover_icon_color',
2710 [
2711 'label' => esc_html__( 'Icon Color', 'elementor' ),
2712 'type' => Controls_Manager::COLOR,
2713 'selectors' => [
2714 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-icon-hover: {{VALUE}}',
2715 ],
2716 'condition' => [
2717 'style_send_hover_colors' => 'custom',
2718 ],
2719 ]
2720 );
2721 }
2722
2723 if ( $config['style']['send_button_section']['has_text_color'] ) {
2724 $this->add_control(
2725 'style_send_hover_text_color',
2726 [
2727 'label' => esc_html__( 'Text Color', 'elementor' ),
2728 'type' => Controls_Manager::COLOR,
2729 'selectors' => [
2730 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-text-hover: {{VALUE}}',
2731 ],
2732 ]
2733 );
2734 }
2735
2736 if ( $config['style']['send_button_section']['has_background_color'] ) {
2737 $this->add_control(
2738 'style_send_hover_background_color',
2739 [
2740 'label' => esc_html__( 'Background Color', 'elementor' ),
2741 'type' => Controls_Manager::COLOR,
2742 'selectors' => [
2743 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-bg-hover: {{VALUE}}',
2744 ],
2745 'condition' => $this->get_platform_color_condition( [
2746 'style_send_hover_colors' => 'custom',
2747 ] ),
2748 ]
2749 );
2750 }
2751
2752 $this->add_hover_animation_control(
2753 'style_send_hover_animation',
2754 );
2755
2756 $this->end_controls_tab();
2757
2758 $this->end_controls_tabs();
2759
2760 $this->add_responsive_control(
2761 'style_chat_button_padding',
2762 [
2763 'label' => esc_html__( 'Padding', 'elementor' ),
2764 'type' => Controls_Manager::DIMENSIONS,
2765 'size_units' => [ 'px', '%', 'em', 'rem' ],
2766 'default' => [
2767 'top' => '8',
2768 'bottom' => '8',
2769 'left' => '16',
2770 'right' => '16',
2771 'unit' => 'px',
2772 'isLinked' => true,
2773 ],
2774 'selectors' => [
2775 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-send-button-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-send-button-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-send-button-padding-inline-start: {{LEFT}}{{UNIT}};',
2776 ],
2777 'separator' => 'before',
2778 ]
2779 );
2780
2781 $this->end_controls_section();
2782 }
2783
2784 protected function chat_box_animation_controls(): void {
2785 $this->add_responsive_control(
2786 'style_chat_box_entrance_animation',
2787 [
2788 'label' => esc_html__( 'Open Animation', 'elementor' ),
2789 'type' => Controls_Manager::ANIMATION,
2790 'frontend_available' => true,
2791 'separator' => 'before',
2792 ]
2793 );
2794
2795 $this->add_responsive_control(
2796 'style_chat_box_exit_animation',
2797 [
2798 'label' => esc_html__( 'Close Animation', 'elementor' ),
2799 'type' => Controls_Manager::EXIT_ANIMATION,
2800 'frontend_available' => true,
2801 ]
2802 );
2803
2804 $this->add_control(
2805 'style_chat_box_animation_duration',
2806 [
2807 'label' => esc_html__( 'Animation Duration', 'elementor' ),
2808 'type' => Controls_Manager::SELECT,
2809 'default' => 'normal',
2810 'options' => [
2811 'slow' => esc_html__( 'Slow', 'elementor' ),
2812 'normal' => esc_html__( 'Normal', 'elementor' ),
2813 'fast' => esc_html__( 'Fast', 'elementor' ),
2814 ],
2815 'prefix_class' => 'animated-',
2816 ]
2817 );
2818 }
2819
2820 protected function add_style_chat_box_section(): void {
2821 $config = static::get_configuration();
2822
2823 $this->start_controls_section(
2824 'style_chat_box_section',
2825 [
2826 'label' => $config['style']['chat_box_section']['section_name'],
2827 'tab' => Controls_Manager::TAB_STYLE,
2828 ]
2829 );
2830
2831 if ( $config['style']['has_platform_colors'] ) {
2832 $this->add_control(
2833 'style_chat_box_bg_select',
2834 [
2835 'label' => esc_html__( 'Background Color', 'elementor' ),
2836 'type' => Controls_Manager::SELECT,
2837 'default' => 'default',
2838 'options' => [
2839 'default' => esc_html__( 'Default', 'elementor' ),
2840 'custom' => esc_html__( 'Custom', 'elementor' ),
2841 ],
2842 ]
2843 );
2844 }
2845
2846 $this->add_control(
2847 'style_chat_box_bg_color',
2848 [
2849 'label' => esc_html__( 'Background Color', 'elementor' ),
2850 'type' => Controls_Manager::COLOR,
2851 'selectors' => [
2852 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-bg: {{VALUE}}',
2853 ],
2854 'condition' => $this->get_platform_color_condition( [
2855 'style_chat_box_bg_select' => 'custom',
2856 ] ),
2857 ]
2858 );
2859
2860 if ( $config['style']['chat_box_section']['has_width'] ) {
2861 $this->add_responsive_control(
2862 'style_chat_box_width',
2863 [
2864 'label' => esc_html__( 'Width', 'elementor' ),
2865 'type' => Controls_Manager::SLIDER,
2866 'range' => [
2867 '%' => [
2868 'min' => 10,
2869 'max' => 100,
2870 ],
2871 'px' => [
2872 'min' => 0,
2873 'max' => 400,
2874 ],
2875 ],
2876 'default' => [
2877 'unit' => 'px',
2878 'size' => $config['style']['chat_box_section']['width'],
2879 ],
2880 'mobile_default' => [
2881 'unit' => 'vw',
2882 'size' => 100,
2883 ],
2884 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2885 'selectors' => [
2886 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-width: {{SIZE}}{{UNIT}}',
2887 ],
2888 ]
2889 );
2890 }
2891
2892 $this->add_control(
2893 'style_chat_box_corners',
2894 [
2895 'label' => esc_html__( 'Corners', 'elementor' ),
2896 'type' => Controls_Manager::SELECT,
2897 'default' => 'rounded',
2898 'options' => [
2899 'round' => esc_html__( 'Round', 'elementor' ),
2900 'rounded' => esc_html__( 'Rounded', 'elementor' ),
2901 'sharp' => esc_html__( 'Sharp', 'elementor' ),
2902 ],
2903 'separator' => 'before',
2904 ]
2905 );
2906
2907 $this->add_group_control(
2908 Group_Control_Box_Shadow::get_type(),
2909 [
2910 'name' => 'style_chat_box_box_shadow',
2911 'selector' => '{{WRAPPER}} .e-contact-buttons__content',
2912 'fields_options' => static::BOX_SHADOW_FIELDS_OPTIONS,
2913 ]
2914 );
2915
2916 if ( $config['style']['chat_box_section']['has_padding'] ) {
2917 $this->add_responsive_control(
2918 'style_chat_box_padding',
2919 [
2920 'label' => esc_html__( 'Padding', 'elementor' ),
2921 'type' => Controls_Manager::DIMENSIONS,
2922 'size_units' => [ 'px', '%', 'em', 'rem' ],
2923 'default' => [
2924 'top' => '16',
2925 'bottom' => '16',
2926 'left' => '16',
2927 'right' => '16',
2928 'unit' => 'px',
2929 'isLinked' => true,
2930 ],
2931 'selectors' => [
2932 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-chat-box-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-chat-box-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-chat-box-padding-inline-start: {{LEFT}}{{UNIT}};',
2933 ],
2934 ]
2935 );
2936 }
2937
2938 $this->chat_box_animation_controls();
2939
2940 $this->end_controls_section();
2941 }
2942
2943 protected function add_style_tab(): void {
2944 $this->add_style_chat_button_section();
2945
2946 $this->add_style_top_bar_section();
2947
2948 $this->add_style_message_bubble_section();
2949
2950 $this->add_style_send_button_section();
2951
2952 $this->add_style_chat_box_section();
2953 }
2954
2955 private function add_advanced_tab(): void {
2956 $config = static::get_configuration();
2957
2958 Controls_Manager::add_tab(
2959 static::TAB_ADVANCED,
2960 esc_html__( 'Advanced', 'elementor' )
2961 );
2962
2963 if ( $config['advanced']['has_layout_position'] ) {
2964 $this->start_controls_section(
2965 'advanced_layout_section',
2966 [
2967 'label' => esc_html__( 'Layout', 'elementor' ),
2968 'tab' => static::TAB_ADVANCED,
2969 ]
2970 );
2971
2972 $this->add_responsive_control(
2973 'advanced_horizontal_position',
2974 [
2975 'label' => esc_html__( 'Horizontal Position', 'elementor' ),
2976 'type' => Controls_Manager::CHOOSE,
2977 'options' => [
2978 'start' => [
2979 'title' => esc_html__( 'Left', 'elementor' ),
2980 'icon' => 'eicon-h-align-left',
2981 ],
2982 'center' => [
2983 'title' => esc_html__( 'Center', 'elementor' ),
2984 'icon' => 'eicon-h-align-center',
2985 ],
2986 'end' => [
2987 'title' => esc_html__( 'Right', 'elementor' ),
2988 'icon' => 'eicon-h-align-right',
2989 ],
2990 ],
2991 'default' => $config['advanced']['horizontal_position_default'],
2992 'toggle' => false,
2993 ]
2994 );
2995
2996 if ( $config['advanced']['has_horizontal_offset'] ) {
2997 $this->add_responsive_control(
2998 'advanced_horizontal_offset',
2999 [
3000 'label' => esc_html__( 'Offset', 'elementor' ),
3001 'type' => Controls_Manager::SLIDER,
3002 'range' => [
3003 '%' => [
3004 'min' => 10,
3005 'max' => 100,
3006 ],
3007 'px' => [
3008 'min' => 0,
3009 'max' => 100,
3010 ],
3011 ],
3012 'default' => [
3013 'unit' => 'px',
3014 'size' => $config['advanced']['horizontal_offset_default'],
3015 ],
3016 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
3017 'selectors' => [
3018 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-horizontal-offset: {{SIZE}}{{UNIT}}',
3019 ],
3020 'condition' => [
3021 'advanced_horizontal_position' => [
3022 'start',
3023 'end',
3024 ],
3025 ],
3026 ]
3027 );
3028 }
3029
3030 $this->add_responsive_control(
3031 'advanced_vertical_position',
3032 [
3033 'label' => esc_html__( 'Vertical Position', 'elementor' ),
3034 'type' => Controls_Manager::CHOOSE,
3035 'options' => [
3036 'top' => [
3037 'title' => esc_html__( 'Top', 'elementor' ),
3038 'icon' => 'eicon-v-align-top',
3039 ],
3040 'middle' => [
3041 'title' => esc_html__( 'Middle', 'elementor' ),
3042 'icon' => 'eicon-v-align-middle',
3043 ],
3044 'bottom' => [
3045 'title' => esc_html__( 'Bottom', 'elementor' ),
3046 'icon' => 'eicon-v-align-bottom',
3047 ],
3048 ],
3049 'default' => 'bottom',
3050 'toggle' => false,
3051 ]
3052 );
3053
3054 if ( $config['advanced']['has_vertical_offset'] ) {
3055 $this->add_responsive_control(
3056 'advanced_vertical_offset',
3057 [
3058 'label' => esc_html__( 'Offset', 'elementor' ),
3059 'type' => Controls_Manager::SLIDER,
3060 'range' => [
3061 '%' => [
3062 'min' => 10,
3063 'max' => 100,
3064 ],
3065 'px' => [
3066 'min' => 0,
3067 'max' => 100,
3068 ],
3069 ],
3070 'default' => [
3071 'unit' => 'px',
3072 'size' => $config['advanced']['vertical_offset_default'],
3073 ],
3074 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
3075 'selectors' => [
3076 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-vertical-offset: {{SIZE}}{{UNIT}}',
3077 ],
3078 'condition' => [
3079 'advanced_vertical_position' => [
3080 'top',
3081 'bottom',
3082 ],
3083 ],
3084 ]
3085 );
3086 }
3087
3088 if ( $config['advanced']['has_mobile_full_width'] ) {
3089 $this->add_control(
3090 'advanced_mobile_full_width',
3091 [
3092 'label' => esc_html__( 'Full Width on Mobile', 'elementor' ),
3093 'type' => Controls_Manager::SWITCHER,
3094 'label_on' => esc_html__( 'Yes', 'elementor' ),
3095 'label_off' => esc_html__( 'No', 'elementor' ),
3096 'return_value' => 'yes',
3097 'default' => 'yes',
3098 ]
3099 );
3100 }
3101
3102 $this->end_controls_section();
3103 }
3104
3105 $this->start_controls_section(
3106 'advanced_responsive_section',
3107 [
3108 'label' => esc_html__( 'Responsive', 'elementor' ),
3109 'tab' => static::TAB_ADVANCED,
3110 ]
3111 );
3112
3113 $this->add_control(
3114 'responsive_description',
3115 [
3116 'raw' => __( 'Responsive visibility will take effect only on preview mode or live page, and not while editing in Elementor.', 'elementor' ),
3117 'type' => Controls_Manager::RAW_HTML,
3118 'content_classes' => 'elementor-descriptor',
3119 ]
3120 );
3121
3122 $this->add_hidden_device_controls();
3123
3124 $this->end_controls_section();
3125
3126 $this->start_controls_section(
3127 'advanced_custom_controls_section',
3128 [
3129 'label' => esc_html__( 'CSS', 'elementor' ),
3130 'tab' => static::TAB_ADVANCED,
3131 ]
3132 );
3133
3134 $this->add_control(
3135 'advanced_custom_css_id',
3136 [
3137 'label' => esc_html__( 'CSS ID', 'elementor' ),
3138 'type' => Controls_Manager::TEXT,
3139 'default' => '',
3140 'ai' => [
3141 'active' => false,
3142 ],
3143 'dynamic' => [
3144 'active' => true,
3145 ],
3146 'title' => esc_html__( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ),
3147 'style_transfer' => false,
3148 ]
3149 );
3150
3151 $this->add_control(
3152 'advanced_custom_css_classes',
3153 [
3154 'label' => esc_html__( 'CSS Classes', 'elementor' ),
3155 'type' => Controls_Manager::TEXT,
3156 'default' => '',
3157 'ai' => [
3158 'active' => false,
3159 ],
3160 'dynamic' => [
3161 'active' => true,
3162 ],
3163 'title' => esc_html__( 'Add your custom class WITHOUT the dot. e.g: my-class', 'elementor' ),
3164 ]
3165 );
3166
3167 $this->end_controls_section();
3168
3169 Plugin::$instance->controls_manager->add_custom_css_controls( $this, static::TAB_ADVANCED );
3170
3171 Plugin::$instance->controls_manager->add_custom_attributes_controls( $this, static::TAB_ADVANCED );
3172
3173 }
3174
3175 protected function render(): void {
3176 $render_strategy = new Contact_Buttons_Core_Render( $this );
3177
3178 $render_strategy->render();
3179 }
3180 }
3181