<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Carbon\Carbon;
use App\Models\Role;
use App\Models\Allergene;
// use Spatie\Permission\Models\Role;
use Hash;

class AllergeneSeed extends Seeder
{
  /**
  * Run the database seeds.
  *
  * @return void
  */
  public function run()
  {

  $allergeni = [
    [
      'nome' => 'Cereali contenenti glutine',
      'descrizione' => 'Grano, segale, orzo, avena, farro, kamut e i loro prodotti derivati.',
      'colore' => 'warning',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3v18"/><path d="M12 7c-4 0-7 4-7 8 0 2 1 4 2 5"/><path d="M12 7c4 0 7 4 7 8 0 2-1 4-2 5"/><circle cx="7.6" cy="12" r="0.9"/><circle cx="9" cy="14.2" r="0.9"/><circle cx="14.8" cy="12" r="0.9"/><circle cx="13.4" cy="14.2" r="0.9"/></svg>',
    ],
    [
      'nome' => 'Crostacei',
      'descrizione' => 'Gamberi, scampi, aragoste, granchi e i loro prodotti derivati.',
      'colore' => 'danger',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 14c0-4 3-8 6-8s6 4 6 8-3 8-6 8-6-4-6-8Z"/><path d="M8 10l-3-2 1 3-1 3 3-2"/><path d="M16 6l2-2"/><path d="M17 10l3-1-2 2 2 2-3-1"/></svg>',
    ],
    [
      'nome' => 'Uova',
      'descrizione' => 'Uova e prodotti a base di uova.',
      'colore' => 'warning',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4c3 0 6 4 6 8s-2.7 10-6 10-6-6-6-10 3-8 6-8Z"/><path d="M10.2 10.3c.7-.9 1.7-1.4 2.8-1.4"/></svg>',
    ],
    [
      'nome' => 'Pesce',
      'descrizione' => 'Pesce e prodotti derivati.',
      'colore' => 'info',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M10 12c0-4 6-7 10-5-2 3-2 7 0 10-4 2-10-1-10-5Z"/><path d="M10 12l-6-2 3 2-3 2 6-2"/><path d="M17 11h.01"/></svg>',
    ],
    [
      'nome' => 'Arachidi',
      'descrizione' => 'Arachidi e prodotti a base di arachidi.',
      'colore' => 'secondary',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 8c-2 1-3 3-3 5s1 4 3 5c2 1 5 1 7 0 2-1 3-3 3-5s-1-4-3-5c-2-1-5-1-7 0Z"/><path d="M12 8c-1.6 2.2-1.6 5.8 0 8"/></svg>',
    ],
    [
      'nome' => 'Soia',
      'descrizione' => 'Soia e prodotti a base di soia.',
      'colore' => 'success',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M8 12c0-3 2.2-5 4.6-5S17 9 17 12s-2 8-4.4 8S8 15 8 12Z"/><path d="M7.5 10.2c-1.2.6-2 1.7-2 2.8 0 1.6 1.1 2.9 2.5 3.2"/><path d="M16.5 10.2c1.2.6 2 1.7 2 2.8 0 1.6-1.1 2.9-2.5 3.2"/></svg>',
    ],
    [
      'nome' => 'Latte',
      'descrizione' => 'Latte (incluso lattosio) e prodotti a base di latte.',
      'colore' => 'primary',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 4h6"/><path d="M8 6h8l-1 15H9L8 6Z"/><path d="M15 11c2 0 3 1 3 2s-1 2-3 2"/></svg>',
    ],
    [
      'nome' => 'Frutta a guscio',
      'descrizione' => 'Mandorle, nocciole, noci, pistacchi, anacardi, e i loro prodotti derivati.',
      'colore' => 'secondary',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 13c-2-1.2-2.2-4 0-5.3 2.2-1.3 5 .2 5 2.8 0 2.6-3.2 3.8-5 2.5Z"/><path d="M16 15c-2-1.1-2-3.7 0-4.8 2-1.1 4.6.2 4.6 2.4 0 2.1-2.6 3.7-4.6 2.4Z"/><path d="M6.5 17.2c1.5-1.7 3.4-2.2 5.4-1.5"/><path d="M6.8 9.6c-.7-2 .2-3.6 2-4.1"/></svg>',
    ],
    [
      'nome' => 'Sedano',
      'descrizione' => 'Sedano e prodotti a base di sedano.',
      'colore' => 'success',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5c0 2 0 2 0 4"/><path d="M10 4c-1.5 2-1.5 2-2 3"/><path d="M14 4c1.5 2 1.5 2 2 3"/><path d="M10 8c-2 2-2 10 2 12 4-2 4-10 2-12"/></svg>',
    ],
    [
      'nome' => 'Senape',
      'descrizione' => 'Senape e prodotti a base di senape.',
      'colore' => 'warning',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 3h6"/><path d="M8 6h8l-1 15H9L8 6Z"/><path d="M9.5 12c2-3 3-3 5 0"/><path d="M10 16h4"/></svg>',
    ],
    [
      'nome' => 'Semi di sesamo',
      'descrizione' => 'Semi di sesamo e prodotti a base di sesamo.',
      'colore' => 'secondary',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 7c2-2 4-2 6 0"/><circle cx="8.5" cy="11" r="1"/><circle cx="12" cy="12.5" r="1"/><circle cx="15.5" cy="11" r="1"/><circle cx="10.2" cy="15.2" r="1"/><circle cx="13.8" cy="15.2" r="1"/></svg>',
    ],
    [
      'nome' => 'Anidride solforosa e solfiti',
      'descrizione' => 'In concentrazioni superiori a 10 mg/kg o 10 mg/l.',
      'colore' => 'danger',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4l9 16H3l9-16Z"/><path d="M12 9v4"/><circle cx="12" cy="16.5" r="0.9" fill="currentColor" stroke="none"/><text x="12" y="13.2" text-anchor="middle" font-size="6" font-family="Arial, sans-serif" fill="currentColor">SO2</text></svg>',
    ],
    [
      'nome' => 'Lupini',
      'descrizione' => 'Lupini e prodotti a base di lupini.',
      'colore' => 'primary',
      'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 6c4 0 7 3 7 6s-3 10-7 10-7-7-7-10 3-6 7-6Z"/><path d="M12 6c-1.3 1.4-1.5 3.2-.8 4.8"/><path d="M10.2 10.8l-4-1"/><path d="M13.8 10.8l4-1"/></svg>',
    ],
    [
      'nome' => 'Molluschi',
      'descrizione' => 'Ostriche, cozze, vongole, calamari e prodotti derivati.',
      'colore' => 'info',
      // 'icona' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4c5 0 9 4 9 9s-4 7-9 7-9-2-9-7 4-9 9-9Z"/><path d="M7.5 12c1.4 1.2 3 1.8 4.5 1.8S15 13.2 16.5 12"/><path d="M8.2 9.4c1.2.9 2.6 1.4 3.8 1.4 1.2 0 2.6-.5 3.8-1.4"/></svg>',
    ],
  ];

  foreach($allergeni as $allergene) {
    Allergene::updateOrCreate(
      ['nome' => $allergene['nome']],
      [
        'descrizione' => $allergene['descrizione'],
        // 'icona' => $allergene['icona'] ?? null,
        'colore' => $allergene['colore'] ?? null,
      ]
    );
  }
  }
}