/*! elementor - v3.18.0 - 20-12-2023 */ .elementor-widget-text-editor.elementor-drop-cap-view-stacked .elementor-drop-cap{background-color:#69727d;color:#fff}.elementor-widget-text-editor.elementor-drop-cap-view-framed .elementor-drop-cap{color:#69727d;border:3px solid;background-color:transparent}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap{margin-top:8px}.elementor-widget-text-editor:not(.elementor-drop-cap-view-default) .elementor-drop-cap-letter{width:1em;height:1em}.elementor-widget-text-editor .elementor-drop-cap{float:left;text-align:center;line-height:1;font-size:50px}.elementor-widget-text-editor .elementor-drop-cap-letter{display:inline-block}/** * Internal dependencies */ import { buildTermsTree } from '../utils'; const list = [ { id: 1, name: 'Apricots', parent: 0 }, { id: 2, name: 'Clementine', parent: 0 }, { id: 3, name: 'Elderberry', parent: 2 }, { id: 4, name: 'Guava', parent: 2 }, { id: 5, name: 'Lychee', parent: 3 }, { id: 6, name: 'Mulberry', parent: 0 }, { id: 7, name: 'Tamarind', parent: 5 }, ]; describe( 'buildTermsTree', () => { test( 'should return an empty array on empty input', () => { const tree = buildTermsTree( [] ); expect( tree ).toEqual( [] ); } ); test( 'should return a flat array when there are no parent relationships', () => { const tree = buildTermsTree( [ { id: 1, name: 'Apricots', parent: 0 }, { id: 2, name: 'Clementine', parent: 0 }, ] ); expect( tree ).toEqual( [ { id: 1, name: 'Apricots', parent: 0, breadcrumbs: [], children: [], }, { id: 2, name: 'Clementine', parent: 0, breadcrumbs: [], children: [], }, ] ); } ); test( 'should return a tree of items', () => { const tree = buildTermsTree( list ); expect( tree ).toEqual( [ { id: 1, name: 'Apricots', parent: 0, breadcrumbs: [], children: [], }, { id: 2, name: 'Clementine', parent: 0, breadcrumbs: [], children: [ { id: 3, name: 'Elderberry', parent: 2, breadcrumbs: [ 'Clementine' ], children: [ { id: 5, name: 'Lychee', parent: 3, breadcrumbs: [ 'Clementine', 'Elderberry' ], children: [ { id: 7, name: 'Tamarind', parent: 5, breadcrumbs: [ 'Clementine', 'Elderberry', 'Lychee', ], children: [], }, ], }, ], }, { id: 4, name: 'Guava', parent: 2, breadcrumbs: [ 'Clementine' ], children: [], }, ], }, { id: 6, name: 'Mulberry', parent: 0, breadcrumbs: [], children: [], }, ] ); } ); test( 'should return a tree of items, with orphan categories appended to the end', () => { const filteredList = [ { id: 1, name: 'Apricots', parent: 0 }, { id: 2, name: 'Clementine', parent: 0 }, { id: 4, name: 'Guava', parent: 2 }, { id: 5, name: 'Lychee', parent: 3 }, { id: 6, name: 'Mulberry', parent: 0 }, ]; const tree = buildTermsTree( filteredList, list ); expect( tree ).toEqual( [ { id: 1, name: 'Apricots', parent: 0, breadcrumbs: [], children: [], }, { id: 2, name: 'Clementine', parent: 0, breadcrumbs: [], children: [ { id: 4, name: 'Guava', parent: 2, breadcrumbs: [ 'Clementine' ], children: [], }, ], }, { id: 6, name: 'Mulberry', parent: 0, breadcrumbs: [], children: [], }, { id: 5, name: 'Lychee', parent: 3, breadcrumbs: [ 'Clementine', 'Elderberry' ], children: [], }, ] ); } ); test( 'should return a tree of items, with orphan categories appended to the end, with children of thier own', () => { const filteredList = [ { id: 1, name: 'Apricots', parent: 0 }, { id: 3, name: 'Elderberry', parent: 2 }, { id: 4, name: 'Guava', parent: 2 }, { id: 5, name: 'Lychee', parent: 3 }, { id: 6, name: 'Mulberry', parent: 0 }, ]; const tree = buildTermsTree( filteredList, list ); expect( tree ).toEqual( [ { id: 1, name: 'Apricots', parent: 0, breadcrumbs: [], children: [], }, { id: 6, name: 'Mulberry', parent: 0, breadcrumbs: [], children: [], }, { id: 3, name: 'Elderberry', parent: 2, breadcrumbs: [ 'Clementine' ], children: [ { id: 5, name: 'Lychee', parent: 3, breadcrumbs: [ 'Clementine', 'Elderberry' ], children: [], }, ], }, { id: 4, name: 'Guava', parent: 2, breadcrumbs: [ 'Clementine' ], children: [], }, ] ); } ); } ); jQuery( function( $ ) { 'use strict'; /** * Object to handle PayPal admin functions. */ var wc_paypal_admin = { isTestMode: function() { return $( '#woocommerce_paypal_testmode' ).is( ':checked' ); }, /** * Initialize. */ init: function() { $( document.body ).on( 'change', '#woocommerce_paypal_testmode', function() { var test_api_username = $( '#woocommerce_paypal_sandbox_api_username' ).parents( 'tr' ).eq( 0 ), test_api_password = $( '#woocommerce_paypal_sandbox_api_password' ).parents( 'tr' ).eq( 0 ), test_api_signature = $( '#woocommerce_paypal_sandbox_api_signature' ).parents( 'tr' ).eq( 0 ), live_api_username = $( '#woocommerce_paypal_api_username' ).parents( 'tr' ).eq( 0 ), live_api_password = $( '#woocommerce_paypal_api_password' ).parents( 'tr' ).eq( 0 ), live_api_signature = $( '#woocommerce_paypal_api_signature' ).parents( 'tr' ).eq( 0 ); if ( $( this ).is( ':checked' ) ) { test_api_username.show(); test_api_password.show(); test_api_signature.show(); live_api_username.hide(); live_api_password.hide(); live_api_signature.hide(); } else { test_api_username.hide(); test_api_password.hide(); test_api_signature.hide(); live_api_username.show(); live_api_password.show(); live_api_signature.show(); } } ); $( '#woocommerce_paypal_testmode' ).trigger( 'change' ); } }; wc_paypal_admin.init(); }); {"id":3805,"date":"2023-08-18T17:29:29","date_gmt":"2023-08-18T22:29:29","guid":{"rendered":"https:\/\/zonau.co\/?post_type=product&p=3805"},"modified":"2023-08-18T17:54:24","modified_gmt":"2023-08-18T22:54:24","slug":"lomito-de-cerdo-en-salsa-bbq","status":"publish","type":"product","link":"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/","title":{"rendered":"Lomito de Cerdo en Salsa BBQ"},"content":{"rendered":"

200 Gr – 300 Gr<\/p>\n","protected":false},"excerpt":{"rendered":"

Lomito de cerdo asado al carb\u00f3n, ba\u00f1ado con deliciosa salsa BBQ, acompa\u00f1ado de ensalada de lechuga, arveja, zanahoria y ma\u00edz dulce<\/span><\/p>\n","protected":false},"featured_media":3289,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_themeisle_gutenberg_block_has_review":false},"product_cat":[18,51],"product_tag":[],"class_list":["post-3805","product","type-product","status-publish","has-post-thumbnail","hentry","product_cat-parrillas","product_cat-comidas","pa_tamano-carne-200-gr","pa_tamano-carne-300-gr"],"yoast_head":"\nLomito de Cerdo en Salsa BBQ - Zona U Restaurante<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Lomito de Cerdo en Salsa BBQ - Zona U Restaurante\" \/>\n<meta property=\"og:description\" content=\"Lomito de cerdo asado al carb\u00f3n, ba\u00f1ado con deliciosa salsa BBQ, acompa\u00f1ado de ensalada de lechuga, arveja, zanahoria y ma\u00edz dulce\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/\" \/>\n<meta property=\"og:site_name\" content=\"Zona U Restaurante\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-18T22:54:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/zonau.co\/wp-content\/uploads\/2020\/11\/lomito-de-cerdo-en-salsa_bbq.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"874\" \/>\n\t<meta property=\"og:image:height\" content=\"874\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/zonau.co\/#website\",\"url\":\"https:\/\/zonau.co\/\",\"name\":\"Zona U Restaurante\",\"description\":\"Un lugar delicioso para comer\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/zonau.co\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"es\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/#primaryimage\",\"inLanguage\":\"es\",\"url\":\"https:\/\/zonau.co\/wp-content\/uploads\/2020\/11\/lomito-de-cerdo-en-salsa_bbq.jpg\",\"contentUrl\":\"https:\/\/zonau.co\/wp-content\/uploads\/2020\/11\/lomito-de-cerdo-en-salsa_bbq.jpg\",\"width\":874,\"height\":874},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/#webpage\",\"url\":\"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/\",\"name\":\"Lomito de Cerdo en Salsa BBQ - Zona U Restaurante\",\"isPartOf\":{\"@id\":\"https:\/\/zonau.co\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/#primaryimage\"},\"datePublished\":\"2023-08-18T22:29:29+00:00\",\"dateModified\":\"2023-08-18T22:54:24+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/zonau.co\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Pedir en L\\u00ednea\",\"item\":\"https:\/\/zonau.co\/pedir-enlinea\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Lomito de Cerdo en Salsa BBQ\"}]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Lomito de Cerdo en Salsa BBQ - Zona U Restaurante","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/","og_locale":"es_ES","og_type":"article","og_title":"Lomito de Cerdo en Salsa BBQ - Zona U Restaurante","og_description":"Lomito de cerdo asado al carb\u00f3n, ba\u00f1ado con deliciosa salsa BBQ, acompa\u00f1ado de ensalada de lechuga, arveja, zanahoria y ma\u00edz dulce","og_url":"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/","og_site_name":"Zona U Restaurante","article_modified_time":"2023-08-18T22:54:24+00:00","og_image":[{"width":874,"height":874,"url":"https:\/\/zonau.co\/wp-content\/uploads\/2020\/11\/lomito-de-cerdo-en-salsa_bbq.jpg","path":"\/home\/u753562441\/domains\/zonau.co\/public_html\/wp-content\/uploads\/2020\/11\/lomito-de-cerdo-en-salsa_bbq.jpg","size":"full","id":3289,"alt":"","pixels":763876,"type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/zonau.co\/#website","url":"https:\/\/zonau.co\/","name":"Zona U Restaurante","description":"Un lugar delicioso para comer","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zonau.co\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"es"},{"@type":"ImageObject","@id":"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/#primaryimage","inLanguage":"es","url":"https:\/\/zonau.co\/wp-content\/uploads\/2020\/11\/lomito-de-cerdo-en-salsa_bbq.jpg","contentUrl":"https:\/\/zonau.co\/wp-content\/uploads\/2020\/11\/lomito-de-cerdo-en-salsa_bbq.jpg","width":874,"height":874},{"@type":"WebPage","@id":"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/#webpage","url":"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/","name":"Lomito de Cerdo en Salsa BBQ - Zona U Restaurante","isPartOf":{"@id":"https:\/\/zonau.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/#primaryimage"},"datePublished":"2023-08-18T22:29:29+00:00","dateModified":"2023-08-18T22:54:24+00:00","breadcrumb":{"@id":"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zonau.co\/producto\/lomito-de-cerdo-en-salsa-bbq\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/zonau.co\/"},{"@type":"ListItem","position":2,"name":"Pedir en L\u00ednea","item":"https:\/\/zonau.co\/pedir-enlinea\/"},{"@type":"ListItem","position":3,"name":"Lomito de Cerdo en Salsa BBQ"}]}]}},"_links":{"self":[{"href":"https:\/\/zonau.co\/wp-json\/wp\/v2\/product\/3805"}],"collection":[{"href":"https:\/\/zonau.co\/wp-json\/wp\/v2\/product"}],"about":[{"href":"https:\/\/zonau.co\/wp-json\/wp\/v2\/types\/product"}],"replies":[{"embeddable":true,"href":"https:\/\/zonau.co\/wp-json\/wp\/v2\/comments?post=3805"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/zonau.co\/wp-json\/wp\/v2\/media\/3289"}],"wp:attachment":[{"href":"https:\/\/zonau.co\/wp-json\/wp\/v2\/media?parent=3805"}],"wp:term":[{"taxonomy":"product_cat","embeddable":true,"href":"https:\/\/zonau.co\/wp-json\/wp\/v2\/product_cat?post=3805"},{"taxonomy":"product_tag","embeddable":true,"href":"https:\/\/zonau.co\/wp-json\/wp\/v2\/product_tag?post=3805"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}