

bgcolorSelectOptions =
    [{
        text: "Lütfen Seçim Yapınız",
        value: "default"
    }];
categoryoption =
    [{
        text: "Lütfen Seçim Yapınız",
        value: "0"
    }];
pagecategoryoption =
    [{
        text: "Tümü",
        value: "0"
    }];
faqscategoryoption =
    [{
        text: "Hepsi",
        value: "0"
    }];
ListType =
    [{
        text: "Lütfen Seçim Yapınız",
        value: "default",
        selected: true
    },{
        text: "Son Yayınlanlar",
        value: "recent"
    },{
        text: "Özel Seçilenler",
        value: "featured"
    },{
        text: "Kategoriye Göre",
        value: "category"
    }];
var lang =  $('html').attr('lang');

data_property =[
    { key: 'listType',  value: 'default'},
    { key: 'limit',  value: '6'},
    { key: 'category',  value: '0'},
    { key: 'lang',  value: lang}

];
teams_data_property =[
    { key: 'limit',  value: '6'},
    { key: 'category',  value: '0'},
    { key: 'lang',  value: lang}


];
faqs_data_property =[
    { key: 'limit',  value: '3'},
    { key: 'category',  value: '0'},
    { key: 'lang',  value: lang},
    { key: 'buttontitle',  value: 'Soru'}
];

testimonials_data_property =[
    { key: 'limit',  value: '6'},
    { key: 'image',  value: 'block'},
];
posts_data_property =[
    { key: 'listType',  value: 'default'},
    { key: 'limit',  value: '3'},
    { key: 'post_category',  value: '0'},
    { key: 'lang',  value: lang},
    { key: 'buttontitle',  value: 'Devamını Oku'}

];
page_portfolios_data_property =[
    { key: 'limit',  value: '3'},
    { key: 'category',  value: '0'},
    { key: 'lang',  value: lang},
    { key: 'buttontitle',  value: 'Devamını Oku'}

];
map_display_type =[{
    text: "Lütfen Seçim Yapınız",
    value: "default",
    selected: true
},{
    text: "Adres ile",
    value: "with_address"
},{
    text: "Yerleştirme Kodu ile (Iframe)",
    value: "with_iframe"
}];

function changeNodeName(node, newNodeName)
{
    var newNode;
    newNode = document.createElement(newNodeName);
    attributes = node.get(0).attributes;

    for (i = 0, len = attributes.length; i < len; i++) {
        newNode.setAttribute(attributes[i].nodeName, attributes[i].nodeValue);
    }

    $(newNode).append($(node).contents());
    $(node).replaceWith(newNode);

    return newNode;
}
Vvveb.Components.add("components/disable", {
    name: languageData.disable_area,
    attributes: ["data-component-disable"],
    html: '',
    afterDrop: function (node) {

    },
    beforeInit: function (node) {

        $("[data-vvveb-disabled-noback]", window.FrameDocument).parent().on("dblclick", function (e) {
            e.preventDefault();
            return false;
        });


    },

});
datalist = {source: 'automatic'};

Vvveb.Components.add("components/menu", {
    name: languageData.page_title_menus,
    attributes: ["data-component-menu"],
    classes :'sss',

    image: "icons/slider.svg",
    html: '',

    afterDrop: function (node) {},
    beforeInit: function (node) {
        $("[data-vvveb-disabled-noback]", window.FrameDocument).parent().on("dblclick", function (e) {
            $('#mySpan').show();
            return false;
        });
        $("[data-vvveb-disabled-noback]", window.FrameDocument).mouseenter(function(){
            $('#mySpan').show();
        }).mouseleave(function(){
            $('#mySpan').hide();
        });
    },
    onChange: function (node, property, value) {
           $.ajax({
            url: window.location.origin+'/panel/ajax',
            type: 'POST',
            dataType: 'json',
            data : {'data': value ,'action': 'menus'},
            success: function(data) {
                $(node).html(data);

            }
        })
        return node;
    },
    init: function (node)
    {

        $.ajax({
            url: window.location.origin + '/panel/editordata/menus',
            type: 'GET',
            dataType: 'json',
            success: function(data) {
                // node.dataset.vCategory değerini al
                var selectedMenus = node.dataset.id;

                // Gelen verileri select kutusuna ekle
                $.each(data, function(key, value) {
                    var o = new Option(value['title'], value['id']);
                    $('.component-properties select[name="Menus"]').append(o);
                });

                // Gelen kategoriye göre seçeneği seçili yap
                if (selectedMenus) {
                    $('.component-properties select[name="Menus"]').val(selectedMenus);
                }
            }
        });

    },
    properties: [{
        name: "Menuler",
        key: "Menus",
        htmlAttr: "data-id",
        inputtype: SelectInput,
        data: {
            options: bgcolorSelectOptions
        }
    },{
        name:"",
        key: "notice",
        inline:false,
        col:12,
        inputtype: NoticeInput,
        data: {
            type:'info',
            title:'Bilgilendirme',
            text:'Menu Ekleme/Düzenleme/Silme işlemlerini  <a href="'+window.location.origin+'/panel/menu/lists" target="_blank"><b>Menuler</b></a> Bölümünden Yapabilirsiniz.'
        }
    }
    ]
});

Vvveb.Components.add("components/brands", {
    name: languageData.brand,
    attributes: ["data-component-brands"],
    image: "icons/portfolios.svg",
    html: '',
    afterDrop: function (node) {

    },
    beforeInit: function (node) {
        body = Vvveb.Builder.frameBodyy;

        var slickScript = '<script id="brandsSlickScript">function brandSlick() {' +
            '$(".brand-active").slick({\n' +
            '\tdots: false,\n' +
            '\tinfinite: true,\n' +
            '\tspeed: 1000,\n' +
            '\tautoplay: true,\n' +
            '\tarrows: false,\n' +
            '\tslidesToShow: 5,\n' +
            '\tslidesToScroll: 1,\n' +
            '\tresponsive: [\n' +
            '\t\t{\n' +
            '\t\t\tbreakpoint: 1200,\n' +
            '\t\t\tsettings: {\n' +
            '\t\t\t\tslidesToShow: 5,\n' +
            '\t\t\t\tslidesToScroll: 1,\n' +
            '\t\t\t\tinfinite: true,\n' +
            '\t\t\t}\n' +
            '\t\t},\n' +
            '\t\t{\n' +
            '\t\t\tbreakpoint: 992,\n' +
            '\t\t\tsettings: {\n' +
            '\t\t\t\tslidesToShow: 4,\n' +
            '\t\t\t\tslidesToScroll: 1\n' +
            '\t\t\t}\n' +
            '\t\t},\n' +
            '\t\t{\n' +
            '\t\t\tbreakpoint: 767,\n' +
            '\t\t\tsettings: {\n' +
            '\t\t\t\tslidesToShow: 3,\n' +
            '\t\t\t\tslidesToScroll: 1,\n' +
            '\t\t\t\tarrows: false,\n' +
            '\t\t\t}\n' +
            '\t\t},\n' +
            '\t\t{\n' +
            '\t\t\tbreakpoint: 575,\n' +
            '\t\t\tsettings: {\n' +
            '\t\t\t\tslidesToShow: 2,\n' +
            '\t\t\t\tslidesToScroll: 1,\n' +
            '\t\t\t\tarrows: false,\n' +
            '\t\t\t}\n' +
            '\t\t},\n' +
            '\t]\n' +
            '});' +
            '}\n' +
            '$(document).ready(brandSlick);</script>';

        var existingScript = $('#brandsSlickScript');
        if (existingScript.length > 0) {
            existingScript.html(slickScript);
        } else {
            // Yoksa, yeni bir script elementi ekle
            $(body).append(slickScript);
        }

        $("[data-vvveb-disabled-noback]", window.FrameDocument).parent().on("dblclick", function (e) {
            e.preventDefault();
            return false;
        });


    },
    onChange: function (node, property, value) {
        var foundIndex = teams_data_property.findIndex (el => el.key === property.key);
        teams_data_property[foundIndex].value = value;
        $.ajaxSetup({
            headers: {
                'X-CSRF-Token': $('meta[name="_token"]').attr('content')
            }
        });
        $.ajax({
            url: window.location.origin + '/ajax/teams_ajaxOwl',
            type: 'POST',
            dataType: 'json',
            data: {'data': teams_data_property},
            success: function (data) {
                if (data['warning']) {
                    $(node[0]).find('#team-slider').html('<div class="col-md-12" data-vvveb-disabled-noback><p style="font-size: 36px; color:black;">'+data['warning']+'</p></div> ');
                } else {
                    $(node[0]).find('#team-slider').html(data['teams']);

                    $(node).find("#team-slider").trigger('destroy.owl.carousel').removeClass('owl-loaded');

                    $(node).find("#team-slider").owlCarousel({
                        items: 1,
                        margin: 30,
                        loop: true,
                        nav: false,
                        slideBy: 1,
                        dots: true,
                        center: false,
                        autoplay: false,
                        autoheight: true,
                        navText: ['<i class="icofont-rounded-left"></i>', '<i class="icofont-rounded-right"></i>'],
                    });
                    $(node).find(".owl-nav").show();

                }

            }
        });

    },
    init: function (node)
    {



    },
    properties: [
        {
            name:"",
            key: "notice",
            inline:false,
            col:12,
            inputtype: NoticeInput,
            data: {
                type:'info',
                title:'Bilgilendirme',
                text:'Marka Ekleme/Düzenleme/Silme  <a href="'+window.location.origin+'/panel/theme_options/lists><b>Marka</b></a> Bölümünden Yapabilirsiniz.'
            }
        }
    ]
});

Vvveb.Components.add("components/odometer", {
    name: languageData.counter,
    classes: ["odometer"],
    image: "icons/portfolios.svg",
    html: '',
    afterDrop: function (node) {


    },
    beforeInit: function (node) {
        body = Vvveb.Builder.frameBodyy;

        var Script = '<script id="countScript">function Count() {' +
            '$(\'.odometer\').appear(function (e) {\n' +
            '\tvar odo = $(".odometer");\n' +
            '\todo.each(function () {\n' +
            '\t\tvar countNumber = $(this).attr("data-count");\n' +
            '\t\t$(this).html(countNumber);\n' +
            '\t});\n' +
            '});' +

            '}\n' +
            '$(document).ready(Count);</script>';

        var existingScript = $('#countScript');
        if (existingScript.length > 0) {
            existingScript.html(Script);
        } else {
            // Yoksa, yeni bir script elementi ekle
            $(body).append(Script);
        }

        $("[data-vvveb-disabled-noback]", window.FrameDocument).parent().on("dblclick", function (e) {
            e.preventDefault();
            return false;
        });


    },
    onChange: function (node, property, value) {
        body = Vvveb.Builder.frameBodyy;

        var Script = '<script id="countScript">function Count() {' +
            '$(\'.odometer\').appear(function (e) {\n' +
            '\tvar odo = $(".odometer");\n' +
            '\todo.each(function () {\n' +
            '\t\tvar countNumber = $(this).attr("data-count");\n' +
            '\t\t$(this).html(countNumber);\n' +
            '\t});\n' +
            '});' +

            '}\n' +
            '$(document).ready(Count);</script>';

        var existingScript = $('#countScript');
        if (existingScript.length > 0) {
            existingScript.html(Script);
        } else {
            // Yoksa, yeni bir script elementi ekle
            $(body).append(Script);
        }

    },
    init: function (node)
    {



    },
    properties: [
        {
            name: "Sayı",
            key: "count",
            inputtype: NumberInput,
            htmlAttr: "data-count",
        }
        ]
});

Vvveb.Components.add("components/slider", {
    name: languageData.page_title_sliders,
    attributes: ["data-component-sliders"],
    html: '',
    afterDrop: function (node) {

    },
    beforeInit: function (node) {

        body = Vvveb.Builder.frameBodyy;

        var slickScript = '<script id="slidersSlickScript">function sliderSlick() {' +
            '$(".slider-active").slick({\n' +
            '                    autoplay: false,\n' +
            '                    autoplaySpeed: 10000,\n' +
            '                    dots: false,\n' +
            '                    fade: true,\n' +
            '                    arrows: false,\n' +
            '                    responsive: [\n' +
            '                        { breakpoint: 767, settings: { dots: false, arrows: false } }\n' +
            '                    ]\n' +
            '                });' +

            '}\n' +
            '$(document).ready(sliderSlick);</script>';

        var existingScript = $('#slidersSlickScript');
        if (existingScript.length > 0) {
            existingScript.html(slickScript);
        } else {
            // Yoksa, yeni bir script elementi ekle
            $(body).append(slickScript);
        }
        $("[data-vvveb-disabled-noback]", window.FrameDocument).parent().on("dblclick", function (e) {
            e.preventDefault();
            return false;
        });


    },

    onChange: function (node, property, value) {

        $.ajax({
            url: window.location.origin+'/panel/ajax',
            type: 'POST',
            dataType: 'json',
            data : {'data': value ,'action': 'sliders'},
            success: function(data) {
                $(node).html(data);
                body = Vvveb.Builder.frameBodyy;

                var slickScript = '<script id="slidersSlickScript">function sliderSlick() {' +
                    '$(".slider-active").slick({\n' +
                    '                    autoplay: false,\n' +
                    '                    autoplaySpeed: 10000,\n' +
                    '                    dots: false,\n' +
                    '                    fade: true,\n' +
                    '                    arrows: false,\n' +
                    '                    responsive: [\n' +
                    '                        { breakpoint: 767, settings: { dots: false, arrows: false } }\n' +
                    '                    ]\n' +
                    '                });' +

                    '}\n' +
                    '$(document).ready(sliderSlick);</script>';

                var existingScript = $('#slidersSlickScript');
                if (existingScript.length > 0) {
                    existingScript.html(slickScript);
                } else {
                    // Yoksa, yeni bir script elementi ekle
                    $(body).append(slickScript);
                }

            }
        })

    },
    init: function (node)
    {
        $.ajax({
            url: window.location.origin+'/panel/editordata/sliders',
            type: 'GET',
            dataType: 'json',
            success: function(data) {
                $.each(data, function( key, value ) {
                    var o = new Option(value['title'], value['id']);
                    $('.component-properties select[name="sliders"]').append(o);
                });

            }
        })


    },
    properties: [
        {
            name: "Slaytlar",
            key: "sliders",
            htmlAttr: "data-id",
            inputtype: SelectInput,
            data: {
                options: bgcolorSelectOptions
            }
        },
        {
            name:"",
            key: "notice",
            inline:false,
            col:12,
            inputtype: NoticeInput,
            data: {
                type:'info',
                title:'Bilgilendirme',
                text:'Marka Ekleme/Düzenleme/Silme  <a href="'+window.location.origin+'/panel/theme_options/lists><b>Marka</b></a> Bölümünden Yapabilirsiniz.'
            }
        }
    ]
});

Vvveb.Components.add("components/services", {
    name: languageData.services,
    attributes: ["data-component-services"],
    image: "icons/products.svg",
    html: '<div class="mb-3"><label>Your response:</label><textarea class="form-control"></textarea></div>',

    beforeInit: function (node) {

        $("[data-vvveb-disabled-noback]", window.FrameDocument).parent().on("dblclick", function (e) {
            e.preventDefault();
            return false;
        });


    },

    init: function (node)
    {

        $('.mb-3[data-group]').attr('style','display:none !important');
        let source = node.dataset.vSource;
        datalist['ids'] = node.dataset.vService_id;
        datalist['limit'] = node.dataset.vLimit;
        datalist['order'] = node.dataset.vOrder_by;
        datalist['direction'] = node.dataset.vDirection;
        datalist['module'] = node.dataset.vModule;
        datalist['style'] = node.dataset.vStyle;
        datalist['category_id'] = node.dataset.vCategory;
        if (!source) {
            source = "automatic";
        }
        $('.mb-3[data-group="'+ source + '"]').attr('style','');
        $.ajax({
            url: window.location.origin + '/panel/editordata/service_categories',
            type: 'GET',
            dataType: 'json',
            success: function(data) {
                // node.dataset.vCategory değerini al
                var selectedCategory = node.dataset.vCategory;

                // Gelen verileri select kutusuna ekle
                $.each(data, function(key, value) {
                    var o = new Option(value['title'], value['id']);
                    $('.component-properties select[name="category_id"]').append(o);
                });

                // Gelen kategoriye göre seçeneği seçili yap
                if (selectedCategory) {
                    $('.component-properties select[name="category_id"]').val(selectedCategory);
                }
            }
        });
    },
    onChange: function (node, property, value) {

        datalist['lang'] = lang;
        datalist[property.key] = value;
        $.ajax({
            url: window.location.origin+'/panel/autocompleteAjax',
            type: 'POST',
            dataType: 'json',
            data : {'data': datalist ,'action': datalist['module']},
            success: function(data) {
                $(node).html(data);


            }
        })
    },
    properties: [
        {
            name: false,
            key: "source",
            inputtype: RadioButtonInput,
            inline:false,
            col:12,
            htmlAttr:"data-v-source",
            data: {
                inline: true,
                extraclass:"btn-group-fullwidth",
                options: [{
                    value: "automatic",
                    icon:"la la-cog",
                    text: "Configuration",
                    title: "Configuration",
                    extraclass:"btn-sm",
                    checked:true,
                }, {
                    value: "autocomplete",
                    text: "Autocomplete",
                    title: "Autocomplete",
                    icon:"la la-search",
                    extraclass:"btn-sm",
                }],
            },

            setGroup: group => {
                $('.mb-3[data-group]').attr('style','display:none !important');
                $('.mb-3[data-group="'+ group + '"]').attr('style','');
                //return element;
            },
            onChange : function(element, value, input)  {
                this.setGroup(input.value);
                return element;
            },
            init: function (node) {
                //this.setGroup(node.dataset.vSource);
                //return 'autocomplete';
                return node.dataset.vSource;
            },
        },
        {
            name: languageData.services,
            key: "ids",
            group:"autocomplete",
            htmlAttr:"data-v-service_id",
            inline:false,
            col:12,
            inputtype: AutocompleteList,
            data: {
                url: window.location.origin+'/panel/autocomplete/services',
            },
        },
        {
            name: "Gösterim Sayısı",
            group:"automatic",
            col:12,
            inline:false,
            key: "limit",
            htmlAttr:"data-v-limit",
            inputtype: NumberInput,
            data: {
                value: "8",//default
                min: "1",
                max: "1024",
                step: "1"
            },
        },
        {
            name: "Liste Sıralaması",
            group:"automatic",
            key: "order",
            col:6,
            inline:false,
            htmlAttr:"data-v-order_by",
            inputtype: SelectInput,
            data: {
                options: [{
                    value: "id",
                    text: "Varsayılan"
                }, {
                    value: "created_at",
                    text: "Ekleme Tarihi"
                }, {
                    value: "updated_at",
                    text: "Değiştirilme Tarihi"
                }/*, {
					value: "sales",
					text: "Sales"
				}*/]
            }
        },
        {
            name: "Sıralama Yönü",
            group:"automatic",
            key: "direction",
            col:6,
            inline:false,
            htmlAttr:"data-v-direction",
            inputtype: SelectInput,
            data: {
                options: [{
                    value: "asc",
                    text: "Artan"
                }, {
                    value: "desc",
                    text: "Azalan"
                }]
            }
        },
        {
            name: languageData.menu_categories,
            group:"automatic",
            key: "category_id",
            col:12,
            inline:false,
            htmlAttr: "data-v-category",
            inputtype: SelectInput,
            data: {
                options: bgcolorSelectOptions
            }
        },
    ]
});

Vvveb.Components.add("components/teams", {
    name: languageData.page_title_teams,
    attributes: ["data-component-teams"],
    image: "icons/products.svg",
    html: '<div class="mb-3"><label>Your response:</label><textarea class="form-control"></textarea></div>',

    beforeInit: function (node) {

        $("[data-vvveb-disabled-noback]", window.FrameDocument).parent().on("dblclick", function (e) {
            e.preventDefault();
            return false;
        });


    },

    init: function (node)
    {

        $('.mb-3[data-group]').attr('style','display:none !important');
        let source = node.dataset.vSource;
        datalist['ids'] = node.dataset.vService_id;
        datalist['limit'] = node.dataset.vLimit;
        datalist['order'] = node.dataset.vOrder_by;
        datalist['direction'] = node.dataset.vDirection;
        datalist['module'] = node.dataset.vModule;
        datalist['style'] = node.dataset.vStyle;
        if (!source) {
            source = "automatic";
        }
        $('.mb-3[data-group="'+ source + '"]').attr('style','');
    },
    onChange: function (node, property, value) {

        datalist['lang'] = lang;
        datalist[property.key] = value;
        $.ajax({
            url: window.location.origin+'/panel/autocompleteAjax',
            type: 'POST',
            dataType: 'json',
            data : {'data': datalist ,'action': datalist['module']},
            success: function(data) {
                $(node).html(data);


            }
        })
    },
    properties: [
        {
            name: false,
            key: "source",
            inputtype: RadioButtonInput,
            inline:false,
            col:12,
            htmlAttr:"data-v-source",
            data: {
                inline: true,
                extraclass:"btn-group-fullwidth",
                options: [{
                    value: "automatic",
                    icon:"la la-cog",
                    text: "Configuration",
                    title: "Configuration",
                    extraclass:"btn-sm",
                    checked:true,
                }, {
                    value: "autocomplete",
                    text: "Autocomplete",
                    title: "Autocomplete",
                    icon:"la la-search",
                    extraclass:"btn-sm",
                }],
            },

            setGroup: group => {
                $('.mb-3[data-group]').attr('style','display:none !important');
                $('.mb-3[data-group="'+ group + '"]').attr('style','');
                //return element;
            },
            onChange : function(element, value, input)  {
                this.setGroup(input.value);
                return element;
            },
            init: function (node) {
                //this.setGroup(node.dataset.vSource);
                //return 'autocomplete';
                return node.dataset.vSource;
            },
        },
        {
            name: languageData.services,
            key: "ids",
            group:"autocomplete",
            htmlAttr:"data-v-service_id",
            inline:false,
            col:12,
            inputtype: AutocompleteList,
            data: {
                url: window.location.origin+'/panel/autocomplete/teams',
            },
        },
        {
            name: "Gösterim Sayısı",
            group:"automatic",
            col:12,
            inline:false,
            key: "limit",
            htmlAttr:"data-v-limit",
            inputtype: NumberInput,
            data: {
                value: "8",//default
                min: "1",
                max: "1024",
                step: "1"
            },
        },
        {
            name: "Liste Sıralaması",
            group:"automatic",
            key: "order",
            col:6,
            inline:false,
            htmlAttr:"data-v-order_by",
            inputtype: SelectInput,
            data: {
                options: [{
                    value: "id",
                    text: "Varsayılan"
                }, {
                    value: "created_at",
                    text: "Ekleme Tarihi"
                }, {
                    value: "updated_at",
                    text: "Değiştirilme Tarihi"
                }/*, {
					value: "sales",
					text: "Sales"
				}*/]
            }
        },
        {
            name: "Sıralama Yönü",
            group:"automatic",
            key: "direction",
            col:6,
            inline:false,
            htmlAttr:"data-v-direction",
            inputtype: SelectInput,
            data: {
                options: [{
                    value: "asc",
                    text: "Artan"
                }, {
                    value: "desc",
                    text: "Azalan"
                }]
            }
        },
    ]
});

Vvveb.Components.add("components/projects", {
    name: languageData.project,
    attributes: ["data-component-projects"],
    image: "icons/products.svg",
    html: '<div class="mb-3"><label>Your response:</label><textarea class="form-control"></textarea></div>',

    beforeInit: function (node) {

        $("[data-vvveb-disabled-noback]", window.FrameDocument).parent().on("dblclick", function (e) {
            e.preventDefault();
            return false;
        });


    },

    init: function (node)
    {

        $('.mb-3[data-group]').attr('style','display:none !important');
        let source = node.dataset.vSource;
        datalist['ids'] = node.dataset.vService_id;
        datalist['limit'] = node.dataset.vLimit;
        datalist['order'] = node.dataset.vOrder_by;
        datalist['direction'] = node.dataset.vDirection;
        datalist['module'] = node.dataset.vModule;
        datalist['style'] = node.dataset.vStyle;
        datalist['category_id'] = node.dataset.vCategory;

        if (!source) {
            source = "automatic";
        }
        $('.mb-3[data-group="'+ source + '"]').attr('style','');
        $.ajax({
            url: window.location.origin + '/panel/editordata/project_categories',
            type: 'GET',
            dataType: 'json',
            success: function(data) {
                // node.dataset.vCategory değerini al
                var selectedCategory = node.dataset.vCategory;

                // Gelen verileri select kutusuna ekle
                $.each(data, function(key, value) {
                    var o = new Option(value['title'], value['id']);
                    $('.component-properties select[name="category_id"]').append(o);
                });

                // Gelen kategoriye göre seçeneği seçili yap
                if (selectedCategory) {
                    $('.component-properties select[name="category_id"]').val(selectedCategory);
                }
            }
        });

    },
    onChange: function (node, property, value) {

        datalist['lang'] = lang;
        datalist[property.key] = value;
        $.ajax({
            url: window.location.origin+'/panel/autocompleteAjax',
            type: 'POST',
            dataType: 'json',
            data : {'data': datalist ,'action': datalist['module']},
            success: function(data) {
                $(node).html(data);


            }
        })
    },
    properties: [
        {
            name: false,
            key: "source",
            inputtype: RadioButtonInput,
            inline:false,
            col:12,
            htmlAttr:"data-v-source",
            data: {
                inline: true,
                extraclass:"btn-group-fullwidth",
                options: [{
                    value: "automatic",
                    icon:"la la-cog",
                    text: "Configuration",
                    title: "Configuration",
                    extraclass:"btn-sm",
                    checked:true,
                }, {
                    value: "autocomplete",
                    text: "Autocomplete",
                    title: "Autocomplete",
                    icon:"la la-search",
                    extraclass:"btn-sm",
                }],
            },

            setGroup: group => {
                $('.mb-3[data-group]').attr('style','display:none !important');
                $('.mb-3[data-group="'+ group + '"]').attr('style','');
                //return element;
            },
            onChange : function(element, value, input)  {
                this.setGroup(input.value);
                return element;
            },
            init: function (node) {
                //this.setGroup(node.dataset.vSource);
                //return 'autocomplete';
                return node.dataset.vSource;
            },
        },
        {
            name: languageData.services,
            key: "ids",
            group:"autocomplete",
            htmlAttr:"data-v-service_id",
            inline:false,
            col:12,
            inputtype: AutocompleteList,
            data: {
                url: window.location.origin+'/panel/autocomplete/projects',
            },
        },
        {
            name: "Gösterim Sayısı",
            group:"automatic",
            col:12,
            inline:false,
            key: "limit",
            htmlAttr:"data-v-limit",
            inputtype: NumberInput,
            data: {
                value: "8",//default
                min: "1",
                max: "1024",
                step: "1"
            },
        },
        {
            name: "Liste Sıralaması",
            group:"automatic",
            key: "order",
            col:6,
            inline:false,
            htmlAttr:"data-v-order_by",
            inputtype: SelectInput,
            data: {
                options: [{
                    value: "id",
                    text: "Varsayılan"
                }, {
                    value: "created_at",
                    text: "Ekleme Tarihi"
                }, {
                    value: "updated_at",
                    text: "Değiştirilme Tarihi"
                }/*, {
					value: "sales",
					text: "Sales"
				}*/]
            }
        },
        {
            name: "Sıralama Yönü",
            group:"automatic",
            key: "direction",
            col:6,
            inline:false,
            htmlAttr:"data-v-direction",
            inputtype: SelectInput,
            data: {
                options: [{
                    value: "asc",
                    text: "Artan"
                }, {
                    value: "desc",
                    text: "Azalan"
                }]
            }
        },
        {
            name: languageData.menu_categories,
            group:"automatic",
            key: "category_id",
            col:12,
            inline:false,
            htmlAttr: "data-v-category",
            inputtype: SelectInput,
            data: {
                options: bgcolorSelectOptions
            }
        },
    ]
});

Vvveb.Components.add("components/testimonials", {
    name: languageData.testimonial,
    attributes: ["data-component-testimonials"],
    image: "icons/products.svg",
    html: '<div class="mb-3"><label>Your response:</label><textarea class="form-control"></textarea></div>',

    beforeInit: function (node) {

        $("[data-vvveb-disabled-noback]", window.FrameDocument).parent().on("dblclick", function (e) {
            e.preventDefault();
            return false;
        });
        body = Vvveb.Builder.frameBodyy;

        var slickScript = '<script id="testimonialsSlickScript">function testimonialsSlick() {' +
            '$(\'.testimonial-active-two\').slick({\n' +
            '\tdots: false,\n' +
            '\tinfinite: true,\n' +
            '\tspeed: 1000,\n' +
            '\tautoplay: true,\n' +
            '\tarrows: true,\n' +
            '\tprevArrow: \'<button type="button" class="slick-prev"><i class="flaticon-right-arrow"></i></button>\',\n' +
            '\tnextArrow: \'<button type="button" class="slick-next"><i class="flaticon-right-arrow"></i></button>\',\n' +
            '\tappendArrows: ".testimonial-nav-two",\n' +
            '\tslidesToShow: 2,\n' +
            '\tslidesToScroll: 1,\n' +
            '\tresponsive: [\n' +
            '\t\t{\n' +
            '\t\t\tbreakpoint: 1200,\n' +
            '\t\t\tsettings: {\n' +
            '\t\t\t\tslidesToShow: 2,\n' +
            '\t\t\t\tslidesToScroll: 1,\n' +
            '\t\t\t\tinfinite: true,\n' +
            '\t\t\t}\n' +
            '\t\t},\n' +
            '\t\t{\n' +
            '\t\t\tbreakpoint: 992,\n' +
            '\t\t\tsettings: {\n' +
            '\t\t\t\tslidesToShow: 1,\n' +
            '\t\t\t\tslidesToScroll: 1\n' +
            '\t\t\t}\n' +
            '\t\t},\n' +
            '\t\t{\n' +
            '\t\t\tbreakpoint: 767,\n' +
            '\t\t\tsettings: {\n' +
            '\t\t\t\tslidesToShow: 1,\n' +
            '\t\t\t\tslidesToScroll: 1,\n' +
            '\t\t\t}\n' +
            '\t\t},\n' +
            '\t\t{\n' +
            '\t\t\tbreakpoint: 575,\n' +
            '\t\t\tsettings: {\n' +
            '\t\t\t\tslidesToShow: 1,\n' +
            '\t\t\t\tslidesToScroll: 1,\n' +
            '\t\t\t}\n' +
            '\t\t},\n' +
            '\t]\n' +
            '});\n'+
            '}\n' +
            '$(document).ready(testimonialsSlick);</script>';

        var existingScript = $('#testimonialsSlickScript');
        if (existingScript.length > 0) {
            existingScript.html(slickScript);
        } else {
            // Yoksa, yeni bir script elementi ekle
            $(body).append(slickScript);
        }


    },

    init: function (node)
    {

        $('.mb-3[data-group]').attr('style','display:none !important');
        let source = node.dataset.vSource;
        datalist['ids'] = node.dataset.vService_id;
        datalist['limit'] = node.dataset.vLimit;
        datalist['order'] = node.dataset.vOrder_by;
        datalist['direction'] = node.dataset.vDirection;
        datalist['module'] = node.dataset.vModule;
        datalist['style'] = node.dataset.vStyle;
        if (!source) {
            source = "automatic";
        }
        $('.mb-3[data-group="'+ source + '"]').attr('style','');
    },
    onChange: function (node, property, value) {

        datalist['lang'] = lang;
        datalist[property.key] = value;
        $.ajax({
            url: window.location.origin+'/panel/autocompleteAjax',
            type: 'POST',
            dataType: 'json',
            data : {'data': datalist ,'action': datalist['module']},
            success: function(data) {
                $(node).html(data);
                body = Vvveb.Builder.frameBodyy;

                var slickScript = '<script id="testimonialsSlickScript">function testimonialsSlick() {' +
                    '$(\'.testimonial-active-two\').slick({\n' +
                    '\tdots: false,\n' +
                    '\tinfinite: true,\n' +
                    '\tspeed: 1000,\n' +
                    '\tautoplay: true,\n' +
                    '\tarrows: true,\n' +
                    '\tprevArrow: \'<button type="button" class="slick-prev"><i class="flaticon-right-arrow"></i></button>\',\n' +
                    '\tnextArrow: \'<button type="button" class="slick-next"><i class="flaticon-right-arrow"></i></button>\',\n' +
                    '\tappendArrows: ".testimonial-nav-two",\n' +
                    '\tslidesToShow: 2,\n' +
                    '\tslidesToScroll: 1,\n' +
                    '\tresponsive: [\n' +
                    '\t\t{\n' +
                    '\t\t\tbreakpoint: 1200,\n' +
                    '\t\t\tsettings: {\n' +
                    '\t\t\t\tslidesToShow: 2,\n' +
                    '\t\t\t\tslidesToScroll: 1,\n' +
                    '\t\t\t\tinfinite: true,\n' +
                    '\t\t\t}\n' +
                    '\t\t},\n' +
                    '\t\t{\n' +
                    '\t\t\tbreakpoint: 992,\n' +
                    '\t\t\tsettings: {\n' +
                    '\t\t\t\tslidesToShow: 1,\n' +
                    '\t\t\t\tslidesToScroll: 1\n' +
                    '\t\t\t}\n' +
                    '\t\t},\n' +
                    '\t\t{\n' +
                    '\t\t\tbreakpoint: 767,\n' +
                    '\t\t\tsettings: {\n' +
                    '\t\t\t\tslidesToShow: 1,\n' +
                    '\t\t\t\tslidesToScroll: 1,\n' +
                    '\t\t\t}\n' +
                    '\t\t},\n' +
                    '\t\t{\n' +
                    '\t\t\tbreakpoint: 575,\n' +
                    '\t\t\tsettings: {\n' +
                    '\t\t\t\tslidesToShow: 1,\n' +
                    '\t\t\t\tslidesToScroll: 1,\n' +
                    '\t\t\t}\n' +
                    '\t\t},\n' +
                    '\t]\n' +
                    '});\n'+
                    '}\n' +
                    '$(document).ready(testimonialsSlick);</script>';

                var existingScript = $('#testimonialsSlickScript');
                if (existingScript.length > 0) {
                    existingScript.html(slickScript);
                } else {
                    // Yoksa, yeni bir script elementi ekle
                    $(body).append(slickScript);
                }


            }
        })
    },
    properties: [
        {
            name: false,
            key: "source",
            inputtype: RadioButtonInput,
            inline:false,
            col:12,
            htmlAttr:"data-v-source",
            data: {
                inline: true,
                extraclass:"btn-group-fullwidth",
                options: [{
                    value: "automatic",
                    icon:"la la-cog",
                    text: "Configuration",
                    title: "Configuration",
                    extraclass:"btn-sm",
                    checked:true,
                }, {
                    value: "autocomplete",
                    text: "Autocomplete",
                    title: "Autocomplete",
                    icon:"la la-search",
                    extraclass:"btn-sm",
                }],
            },

            setGroup: group => {
                $('.mb-3[data-group]').attr('style','display:none !important');
                $('.mb-3[data-group="'+ group + '"]').attr('style','');
                //return element;
            },
            onChange : function(element, value, input)  {
                this.setGroup(input.value);
                return element;
            },
            init: function (node) {
                //this.setGroup(node.dataset.vSource);
                //return 'autocomplete';
                return node.dataset.vSource;
            },
        },
        {
            name: languageData.services,
            key: "ids",
            group:"autocomplete",
            htmlAttr:"data-v-service_id",
            inline:false,
            col:12,
            inputtype: AutocompleteList,
            data: {
                url: window.location.origin+'/panel/autocomplete/testimonials',
            },
        },
        {
            name: "Gösterim Sayısı",
            group:"automatic",
            col:12,
            inline:false,
            key: "limit",
            htmlAttr:"data-v-limit",
            inputtype: NumberInput,
            data: {
                value: "8",//default
                min: "1",
                max: "1024",
                step: "1"
            },
        },
        {
            name: "Liste Sıralaması",
            group:"automatic",
            key: "order",
            col:6,
            inline:false,
            htmlAttr:"data-v-order_by",
            inputtype: SelectInput,
            data: {
                options: [{
                    value: "id",
                    text: "Varsayılan"
                }, {
                    value: "created_at",
                    text: "Ekleme Tarihi"
                }, {
                    value: "updated_at",
                    text: "Değiştirilme Tarihi"
                }/*, {
					value: "sales",
					text: "Sales"
				}*/]
            }
        },
        {
            name: "Sıralama Yönü",
            group:"automatic",
            key: "direction",
            col:6,
            inline:false,
            htmlAttr:"data-v-direction",
            inputtype: SelectInput,
            data: {
                options: [{
                    value: "asc",
                    text: "Artan"
                }, {
                    value: "desc",
                    text: "Azalan"
                }]
            }
        },
    ]
});

Vvveb.Components.add("components/posts", {
    name: languageData.blog,
    attributes: ["data-component-posts"],
    image: "icons/products.svg",
    html: '<div class="mb-3"><label>Your response:</label><textarea class="form-control"></textarea></div>',

    beforeInit: function (node) {

        $("[data-vvveb-disabled-noback]", window.FrameDocument).parent().on("dblclick", function (e) {
            e.preventDefault();
            return false;
        });


    },

    init: function (node)
    {

        $('.mb-3[data-group]').attr('style','display:none !important');
        let source = node.dataset.vSource;
        datalist['ids'] = node.dataset.vService_id;
        datalist['limit'] = node.dataset.vLimit;
        datalist['order'] = node.dataset.vOrder_by;
        datalist['direction'] = node.dataset.vDirection;
        datalist['module'] = node.dataset.vModule;
        datalist['style'] = node.dataset.vStyle;
        datalist['category_id'] = node.dataset.vCategory;
        if (!source) {
            source = "automatic";
        }
        $('.mb-3[data-group="'+ source + '"]').attr('style','');

        $.ajax({
            url: window.location.origin+'/panel/editordata/post_categories',
            type: 'GET',
            dataType: 'json',
            success: function(data) {
                $.each(data, function( key, value ) {
                    var o = new Option(value['title'], value['id']);
                    $('.component-properties select[name="category_id"]').append(o);
                });

            }
        })


    },
    onChange: function (node, property, value) {

        datalist['lang'] = lang;
        datalist[property.key] = value;
        $.ajax({
            url: window.location.origin+'/panel/autocompleteAjax',
            type: 'POST',
            dataType: 'json',
            data : {'data': datalist ,'action': datalist['module']},
            success: function(data) {
                $(node).html(data);


            }
        })
    },
    properties: [
        {
            name: false,
            key: "source",
            inputtype: RadioButtonInput,
            inline:false,
            col:12,
            htmlAttr:"data-v-source",
            data: {
                inline: true,
                extraclass:"btn-group-fullwidth",
                options: [{
                    value: "automatic",
                    icon:"la la-cog",
                    text: "Configuration",
                    title: "Configuration",
                    extraclass:"btn-sm",
                    checked:true,
                }, {
                    value: "autocomplete",
                    text: "Autocomplete",
                    title: "Autocomplete",
                    icon:"la la-search",
                    extraclass:"btn-sm",
                }],
            },

            setGroup: group => {
                $('.mb-3[data-group]').attr('style','display:none !important');
                $('.mb-3[data-group="'+ group + '"]').attr('style','');
                //return element;
            },
            onChange : function(element, value, input)  {
                this.setGroup(input.value);
                return element;
            },
            init: function (node) {
                //this.setGroup(node.dataset.vSource);
                //return 'autocomplete';
                return node.dataset.vSource;
            },
        },
        {
            name: languageData.blog,
            key: "ids",
            group:"autocomplete",
            htmlAttr:"data-v-service_id",
            inline:false,
            col:12,
            inputtype: AutocompleteList,
            data: {
                url: window.location.origin+'/panel/autocomplete/posts',
            },
        },
        {
            name: "Gösterim Sayısı",
            group:"automatic",
            col:12,
            inline:false,
            key: "limit",
            htmlAttr:"data-v-limit",
            inputtype: NumberInput,
            data: {
                value: "8",//default
                min: "1",
                max: "1024",
                step: "1"
            },
        },
        {
            name: "Liste Sıralaması",
            group:"automatic",
            key: "order",
            col:6,
            inline:false,
            htmlAttr:"data-v-order_by",
            inputtype: SelectInput,
            data: {
                options: [{
                    value: "id",
                    text: "Varsayılan"
                }, {
                    value: "created_at",
                    text: "Ekleme Tarihi"
                }, {
                    value: "updated_at",
                    text: "Değiştirilme Tarihi"
                }/*, {
					value: "sales",
					text: "Sales"
				}*/]
            }
        },
        {
            name: "Sıralama Yönü",
            group:"automatic",
            key: "direction",
            col:6,
            inline:false,
            htmlAttr:"data-v-direction",
            inputtype: SelectInput,
            data: {
                options: [{
                    value: "asc",
                    text: "Artan"
                }, {
                    value: "desc",
                    text: "Azalan"
                }]
            }
        },
        {
            name: languageData.menu_categories,
            group:"automatic",
            key: "category_id",
            col:12,
            inline:false,
            htmlAttr: "data-v-category",
            inputtype: SelectInput,
            data: {
                options: bgcolorSelectOptions
            }
        },
    ]
});

Vvveb.Components.add("components/tabs", {
    name: 'tabs',
    attributes: ["data-component-tabs"],
    html: `
   <section class="serviced-sector" data-component-tabs>
        <div class="shape-circle"></div>
        <figure class="shape-rhombus"><img src="<?= SITE_THEME_URL ?>/assets/images/shape-rhombus.png" alt="shape"></figure>
        <div class="container">
            <div class="serviced-sector-hold">
    
                                <div class="serviced-tabs tabs">
                        <div class="menu-col">
                            <h2 class="large-title">Başlıca Sektörler</h2>
                                                        <ul class="tabs-menu">
                                                                <li class="active" data-tab="#tab-0">
                                        <img src="<?= SITE_THEME_URL ?>/assets/images/hotels-icon.svg" alt="Oteller ikonu" class="main-icon-img"><span>Oteller</span>								</li>

                                
                                                                <li data-tab="#tab-1">
                                        <img src="<?= SITE_THEME_URL ?>/assets/images/retails-icon.svg" alt="Mağazalar ikonu" class="main-icon-img"><span>Mağazalar</span>								</li>

                                
                                                                <li data-tab="#tab-2">
                                        <img src="<?= SITE_THEME_URL ?>/assets/images/restaurants-icon.svg" alt="Restoranlar ikonu" class="main-icon-img"><span>Restoranlar</span>								</li>

                                
                                                                <li data-tab="#tab-3">
                                        <img src="<?= SITE_THEME_URL ?>/assets/images/casinos-icon.svg" alt="Casinolar ikonu" class="main-icon-img"><span>Casinolar</span>								</li>

                                
                                                                <li data-tab="#tab-4">
                                        <img src="<?= SITE_THEME_URL ?>/assets/images/other-showrooms-icon.svg" alt="Showroomlar ikonu" class="main-icon-img"><span>Showroomlar</span>								</li>
    
                                    
                                                        </ul>
                        </div>
    
                        <div class="tabs-col">
                                                            <div class="tab" id="tab-0">
                                        <h2>Kurumsal Kokulandırma :  Oteller</h2>
                                        <span class="title-additional">Her ziyarette efsanevi bir karşılama...</span>
                                        <p>Lüks bir mekan, belirli bir duygu oluşturmakla alakalıdır. Peki duygu oluşturmak denilen şey tam olarak nedir ve lüks onu konaklama sektöründe nasıl sunar? Hizmet bağlamında otel işletmecileriyle yapılan görüşmelerde sürekli olarak “duygusal bağ” ifadesi ortaya çıkıyor.</p>
                                        <div class="service-btns">
                                            <a href="oteller/index.htm"><b>Tamamını oku</b></a>
                                            <a class="btn border-btn simplebox" href="iletisim/index.htm">Bize ulaşın</a>
                                        </div>
                                    </div>
                                                                    <div class="tab" id="tab-1">
                                        <h2>Kurumsal Kokulandırma :  Mağazalar</h2>
                                        <span class="title-additional">Müşterilerin Hislerine Konuşan Mağazalar</span>
                                        <p>Perakende mağazacılık sektöründe, müşterileri ile duygu bağı kurabilen markalar, müşterilerinin sadakatını kazanır ve dolayısıyla bu da satış cirolarına yansır. Son yıllarda tüketici davranışları ve duygular arasındaki ilişkiye ilgi bilim dünyasında da hızla artmaktadır. Bu alanda gerçekleştirilen bilimsel araştırmalar, koku duyusu ile duygusal algımıza etkisi arasında direkt bir ilişki olduğunu kanıtlamıştır.</p>
                                        <div class="service-btns">
                                            <a href="magazalar/index.htm"><b>Tamamını oku</b></a>
                                            <a class="btn border-btn simplebox" href="iletisim/index.htm">Bize ulaşın</a>
                                        </div>
                                    </div>
                                                                    <div class="tab" id="tab-2">
                                        <h2>Kurumsal Kokulandırma :  Restoranlar</h2>
                                        <span class="title-additional">Etkili Markalaşma Stratejisinde Kokuların Yeri</span>
                                        <p>Son yıllarda yapılan araştırmalar, etkili bir marka stratejisinin müşterilerin belirli markalara olan duygusal bağlılığını geliştirebileceğini göstermektedir. Duygusal marka bağlılığı, müşterilerin markalara karşı olan sadakatini artırmaya yardımcı olmaktadır ve dolayısıyla restoranların da marka başarısının önemli bir parçasıdır.</p>
                                        <div class="service-btns">
                                            <a href="restoranlar/index.htm"><b>Tamamını oku</b></a>
                                            <a class="btn border-btn simplebox" href="iletisim/index.htm">Bize ulaşın</a>
                                        </div>
                                    </div>
                                                                    <div class="tab" id="tab-3">
                                        <h2>Kurumsal Kokulandırma :  Casinolar</h2>
                                        <span class="title-additional">Misafirlerinizi kazanacağınıza “bahse” gireriz...</span>
                                        <p>Casino müşterileri, bulundukları casino ortamının prestijli bir görünüme sahip olmasını tercih ediyor. Bu nedenle casinolar iç mimari ve tasarımlarına prestij katmak, marka imajlarını yükseltmek için bu konuya oldukça yüksek bütçeler ayırıyor...</p>
                                        <div class="service-btns">
                                            <a href="casinolar/index.htm"><b>Tamamını oku</b></a>
                                            <a class="btn border-btn simplebox" href="iletisim/index.htm">Bize ulaşın</a>
                                        </div>
                                    </div>
                                                                    <div class="tab" id="tab-4">
                                        <h2>Kurumsal Kokulandırma :  Showroomlar</h2>
                                        <span class="title-additional">Dijital dünyanın yapamayacaklarını yapalım</span>
                                        <p>E-ticaretin hızlı “işgali” altında kalan galeri ve showroomlar, fiziksel dünyada rekabet etmek ve farklılık yaratabilmek için daha etkili araçlara ihtiyaç duyuyor...</p>
                                        <div class="service-btns">
                                            <a href="showroomlar/index.htm"><b>Tamamını oku</b></a>
                                            <a class="btn border-btn simplebox" href="iletisim/index.htm">Bize ulaşın</a>
                                        </div>
                                    </div>
                                                        </div>
                    </div>
                
                
    
            </div>
        </div>
        <div class="background-container"><img src="<?= SITE_THEME_URL ?>/assets/images/serviced-sector-bg.jpg"></div>

    </section>
    `,
    // Ortak script ekleme fonksiyonu
    _addTabScript: function(action) {
        function addTabScript() {
            try {
                // Iframe hazır mı kontrol et
                if (typeof window.FrameDocument === 'undefined' || !window.FrameDocument) {
                    console.log('Iframe henüz hazır değil, 200ms sonra tekrar dene...');
                    setTimeout(addTabScript, 200);
                    return;
                }
                
                var frameDoc = window.FrameDocument;
                var frameBody = frameDoc.body;
                
                if (!frameDoc || !frameBody) {
                    console.log('Frame document veya body bulunamadı');
                    return;
                }
                
                // Basit tab sistemi - jQuery UI olmadan çalışır
                var tabsScript = '(function($) { "use strict"; function initTabs() { $(".tabs-menu li[data-tab]").off("click").on("click", function(e) { e.preventDefault(); var $this = $(this); var targetTab = $this.data("tab"); var $tabsContainer = $this.closest(".tabs"); $tabsContainer.find(".tabs-menu li").removeClass("active"); $this.addClass("active"); $tabsContainer.find(".tab").removeClass("visible").addClass("hidden"); $(targetTab).removeClass("hidden").addClass("visible"); console.log("Tab değiştirildi: " + targetTab); }); } function setupResponsiveTabs() { if (window.innerWidth <= 768) { $(".tabs-menu").addClass("mobile-tabs"); } else { $(".tabs-menu").removeClass("mobile-tabs"); } } $(document).ready(function() { initTabs(); setupResponsiveTabs(); console.log("Tab sistemi başlatıldı"); }); $(window).on("resize", setupResponsiveTabs); })(jQuery);';

                // Iframe içinde script var mı kontrol et
                var existingScript = frameDoc.getElementById('custom-tabs-script');
                if (existingScript) {
                    existingScript.remove();
                }
                
                // Yeni script ekle
                var scriptElement = frameDoc.createElement('script');
                scriptElement.id = 'custom-tabs-script';
                scriptElement.innerHTML = tabsScript;
                frameBody.appendChild(scriptElement);
                
                console.log('Tab sistemi ' + action);
            } catch (error) {
                console.error('Tab script eklenirken hata:', error);
            }
        }
        
        // Iframe yüklendiğinde script ekle
        if (typeof window.FrameDocument !== 'undefined' && window.FrameDocument) {
            addTabScript();
        } else {
            // Iframe yükleme event'ini dinle
            $(window).one('vvveb.iframe.loaded', function() {
                setTimeout(addTabScript, 100);
            });
            
            // Fallback olarak da dene
            setTimeout(addTabScript, 500);
        }
    },
    
    afterDrop: function (node) {
        this._addTabScript('eklendi');
    },
    
    beforeInit: function (node) {
        this._addTabScript('başlatıldı');
    },

    onChange: function (node, property, value) {
        this._addTabScript('güncellendi');
    },
    
    init: function (node) { 
        this._addTabScript('başlatıldı');
    },  
   
   
});



