public function getSettingsHtml(): string
    {
        $allSections = Craft::$app->sections->getAllSections();
        $allFields = Craft::$app->fields->getAllFields() ?? [];

        // Group the Sections into an array
        $elements = [];
        foreach ($allSections as $element) {
            $elements[$element->id] = $element->name;
        }

        // Group Field Types into an array
        $fields = [];
        foreach ($allFields as $field) {
            $fields[$field->id] = $field->name;
        }

        // Get the Section Source
        if (empty($this->source)) {
            $this->source = ['type' => '', 'value' => ''];
        }

        return Craft::$app->view->renderTemplate(
            'manytomany/_settings', [
                'source' => $this->source,
                'singleField' => $this->singleField,
                'elements' => $elements,
                'fields' => $fields,
            ]
        );
    }