From 7e6c12152f4e73336a8fcab5baa4dc0434fae817 Mon Sep 17 00:00:00 2001 From: poli0981 <127664709+poli0981@users.noreply.github.com> Date: Wed, 30 Sep 2026 21:11:58 +0700 Subject: [PATCH] fix(data): hardware names, YouTube's tag count, chapters, history duplicates, validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hardware - GPU catalog rewritten with stable ids and official names: descriptions read "NVIDIA GeForce RTX 5080", "AMD Radeon RX 9070 XT", "Apple M4 Pro" instead of "NVIDIA RTX 5080" / "AMD RX 9070 XT" / "Apple Silicon M4 Pro". Cards that never shipped (RX 9080, RX 9090 XT, Arc B380) are gone; RTX 50/40/30 laptop GPUs, RX 9070 GRE, VRAM variants, Radeon/Intel integrated graphics, handheld APUs and Apple M5 (Pro/Max/Ultra) added. One searchable picker ("5080", "rog ally") replaces Brand › Series › Model, with free text for anything else. - Old `brand|series|model` values are migrated (editor v19, profiles v3, templates v2, and on load/import); unknown cards keep their full name. - RAM: 24/48/192 GB, LPDDR4/4X/5/5X, optional speed ("32 GB DDR5-6000"); no DDR6/DDR7; plain "DDR"; "48GB GB" fixed; changing the size no longer clears the type. OS: SteamOS, Bazzite, CachyOS, Nobara, openSUSE, Fedora 43/44; Linux reads "Ubuntu 24.04 LTS". CPU: suggestions, and Windows' "Intel(R) Core(TM) … CPU @ 3.60GHz" is tidied on blur. - The rig block uses translated labels in a fixed order (CPU, GPU, RAM…) in both the description and the social captions. Tags - Measured the way YouTube counts (quotes around multi-word tags, one comma between): 15 of 51 real tag sets were over 500 by YouTube's count while showing under. Counters and the limit warning use the same count. - Trimming keeps trying shorter tags after one that doesn't fit. - "Elden Ring Steam", "itch.io gameplay" (was STEAM / ITCHIO); no platform tags for a publisher site; "best open world games" (was "openworld"); RPG/simulation/card pools no longer carry other genres' tags. Timestamps - Keywords need a word boundary: "Final Fantasy VII" stays a title (was "Ending Fantasy VII"), "Introduction" stays whole. - Accepts [0:00], 0:00 - label and editor frame counts; pt-BR and Indonesian keywords; a Tidy up button; a live check of YouTube's chapter rules (0:00 first, 3+, 10 s apart, in order). Output and data - History keeps one entry per video (updated in place) instead of one per Output visit; existing duplicates are folded (history v3). The History Limit is healed on every load. - A field over its limit blocks only its own copy button (Copy All: title or description); a warning when YouTube would reject "<" or ">". - Validation: Steam /sub/, /bundle/ and s.team links, GOG/Humble/xbox.com without www, regional Nintendo sites, Microsoft Store, Luna; social links with www./m./twitter.com; phone, YouTube Music and video-in-playlist links (normalised); email domains need a TLD; the live URL is validated; no bare "#" hashtag. - The engine takes the year from the caller; "Ending N" follows the output language. Co-Authored-By: Claude Opus 5.5 --- src/components/editor/ExtraFieldsInput.tsx | 13 +- src/components/editor/GpuList.tsx | 101 +++ src/components/editor/LivePreview.tsx | 18 +- src/components/editor/RigEditor.tsx | 359 +++++----- src/components/editor/TimestampEditor.tsx | 83 ++- src/components/output/CharCounter.tsx | 6 +- src/components/output/CopyButton.tsx | 37 +- src/components/output/OutputPreview.tsx | 31 +- src/config/gpu-catalog.ts | 778 ++++++++++++++------- src/config/platforms.ts | 47 +- src/config/rig-fields.ts | 454 +++++++----- src/engine/description-builder.ts | 26 +- src/engine/endings-format.ts | 24 +- src/engine/limits.ts | 27 + src/engine/rig-block.ts | 32 + src/engine/social-post-builder.ts | 32 +- src/engine/tag-generator.ts | 134 +++- src/engine/template-renderer.ts | 22 +- src/engine/timeline-parser.ts | 136 +++- src/engine/title-builder.ts | 2 +- src/hooks/use-char-count.ts | 20 +- src/hooks/use-copy-gate.ts | 36 + src/hooks/use-output-copy.ts | 19 +- src/hooks/use-render-options.ts | 2 + src/hooks/use-social-posts.ts | 1 + src/i18n/locales/_schema.json | 47 +- src/i18n/locales/en/templates.json | 12 + src/i18n/locales/en/ui.json | 34 +- src/i18n/locales/es/templates.json | 12 + src/i18n/locales/es/ui.json | 34 +- src/i18n/locales/id/templates.json | 12 + src/i18n/locales/id/ui.json | 34 +- src/i18n/locales/ja/templates.json | 12 + src/i18n/locales/ja/ui.json | 34 +- src/i18n/locales/ko/templates.json | 12 + src/i18n/locales/ko/ui.json | 34 +- src/i18n/locales/pt-BR/templates.json | 12 + src/i18n/locales/pt-BR/ui.json | 34 +- src/i18n/locales/vi/templates.json | 12 + src/i18n/locales/vi/ui.json | 34 +- src/i18n/locales/zh/templates.json | 12 + src/i18n/locales/zh/ui.json | 34 +- src/pages/BatchPage.tsx | 30 +- src/pages/EditorPage.tsx | 4 +- src/pages/OutputPage.tsx | 41 +- src/pages/SocialPage.tsx | 1 + src/store/editor-store.ts | 11 +- src/store/history-store.ts | 74 +- src/store/profile-store.ts | 7 +- src/store/settings-heal.ts | 8 + src/store/settings-store.ts | 6 + src/store/template-store.ts | 14 +- src/utils/rig-validation.ts | 46 +- src/utils/validation.ts | 33 +- tests/config/gpu-catalog.test.ts | 96 +++ tests/config/platforms.test.ts | 71 ++ tests/engine/description-builder.test.ts | 40 +- tests/engine/limits.test.ts | 33 + tests/engine/rig-fields.test.ts | 174 +++-- tests/engine/tag-generator.test.ts | 71 ++ tests/engine/timeline-rules.test.ts | 93 +++ tests/store/editor-store.migrate.test.ts | 22 + tests/store/history-store.test.ts | 66 ++ tests/store/settings-heal.test.ts | 13 + tests/utils/rig-validation.test.ts | 16 +- tests/utils/validation.test.ts | 51 +- 66 files changed, 2817 insertions(+), 1059 deletions(-) create mode 100644 src/components/editor/GpuList.tsx create mode 100644 src/engine/rig-block.ts create mode 100644 src/hooks/use-copy-gate.ts create mode 100644 tests/config/gpu-catalog.test.ts create mode 100644 tests/config/platforms.test.ts create mode 100644 tests/engine/timeline-rules.test.ts create mode 100644 tests/store/history-store.test.ts diff --git a/src/components/editor/ExtraFieldsInput.tsx b/src/components/editor/ExtraFieldsInput.tsx index 29f9769..f60ecfd 100644 --- a/src/components/editor/ExtraFieldsInput.tsx +++ b/src/components/editor/ExtraFieldsInput.tsx @@ -3,6 +3,8 @@ import clsx from "clsx"; import { Input } from "@components/ui/Input"; import { Textarea } from "@components/ui/Textarea"; import { Field, controlClasses } from "@components/ui/Field"; +import { ValidatedInput } from "@components/ui/ValidatedInput"; +import { validateUrl } from "@utils/validation"; import { VIDEO_TYPES } from "@config/video-types"; import { GACHA_QUEST_TYPE_GROUPS, @@ -194,12 +196,19 @@ export function ExtraFieldsInput() { )} {extraFields.includes("liveUrl") && ( - store.set("liveUrl", e.target.value)} + onChange={(v) => store.set("liveUrl", v)} + validate={validateUrl} + inputMode="url" + autoComplete="off" /> )} {extraFields.includes("scheduledTime") && ( diff --git a/src/components/editor/GpuList.tsx b/src/components/editor/GpuList.tsx new file mode 100644 index 0000000..7b566e4 --- /dev/null +++ b/src/components/editor/GpuList.tsx @@ -0,0 +1,101 @@ +import { useTranslation } from "react-i18next"; +import { Command } from "cmdk"; +import { Check, PenLine, Search, X } from "lucide-react"; +import { GPU_GROUPS, type GpuModel } from "@config/gpu-catalog"; + +const itemClass = + "flex min-h-8 cursor-pointer items-center gap-2 rounded-lg px-2 py-1 text-sm text-text-primary select-none data-[selected=true]:bg-surface-2"; + +const headingClass = + "[&_[cmdk-group-heading]]:text-text-muted [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:pt-2 [&_[cmdk-group-heading]]:pb-1 [&_[cmdk-group-heading]]:text-[0.6875rem] [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:tracking-wide [&_[cmdk-group-heading]]:uppercase"; + +interface GpuListProps { + selectedId: string | undefined; + hasValue: boolean; + onSelect: (model: GpuModel) => void; + onCustom: () => void; + onClear: () => void; +} + +/** + * Every word of the query must appear in the card's name or keywords: + * "5080" finds the RTX 5080s only, where cmdk's default fuzzy score also + * offered the RX 580 and the HD 7850 ("5…8…0"). Exact model-number hits + * rank first. + */ +function gpuFilter(value: string, search: string, keywords?: string[]): number { + const haystack = [value, ...(keywords ?? [])].join(" ").toLowerCase(); + const words = search.toLowerCase().split(/\s+/).filter(Boolean); + if (words.length === 0) return 1; + if (!words.every((word) => haystack.includes(word))) return 0; + const whole = words.every((word) => + new RegExp(`(^|[^a-z0-9])${word.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}($|[^a-z0-9])`).test( + haystack, + ), + ); + return whole ? 1 : 0.5; +} + +/** + * The searchable GPU list in the rig editor ("5080", "9070 xt", "m4 pro", + * "rog ally"…). Lazily loaded with the search library it needs. + */ +export default function GpuList({ + selectedId, + hasValue, + onSelect, + onCustom, + onClear, +}: GpuListProps) { + const { t } = useTranslation("ui"); + return ( + +
+
+ + + {t("editor.gpuNoMatch")} + + {GPU_GROUPS.map((group) => ( + + {group.models.map((model) => ( + onSelect(model)} + className={itemClass} + > + + {model.name} + + ))} + + ))} + + + + {hasValue && ( + + + )} + + +
+ ); +} diff --git a/src/components/editor/LivePreview.tsx b/src/components/editor/LivePreview.tsx index b4a67f0..e4e38e8 100644 --- a/src/components/editor/LivePreview.tsx +++ b/src/components/editor/LivePreview.tsx @@ -4,6 +4,7 @@ import { Eye } from "lucide-react"; import { useGeneratedOutput } from "@hooks/use-generated-output"; import { useOutputLimits } from "@hooks/use-output-limits"; import { useStrictBlock } from "@hooks/use-strict-block"; +import { useCopyGate } from "@hooks/use-copy-gate"; import { EMPTY_GENERATOR_OUTPUT, YT_LIMITS } from "@engine/types"; import { useEditorStore } from "@store/editor-store"; import { Card } from "@components/ui/Card"; @@ -38,7 +39,7 @@ export function LivePreview({ const outputs = useMemo(() => [output], [output]); const limitStatus = useOutputLimits(outputs); const strictBlocked = useStrictBlock(); - const blocked = limitStatus.blocked || strictBlocked; + const gate = useCopyGate(limitStatus, strictBlocked); const over = (field: PreviewTab) => limitStatus.overflows.some((o) => o.field === field); const dot = (field: PreviewTab) => @@ -110,14 +111,20 @@ export function LivePreview({ {tab === "description" && ( )} - {tab === "tags" && } + {tab === "tags" && ( + + )} {tab === "title" && ( )} {tab === "description" && ( @@ -126,16 +133,15 @@ export function LivePreview({ label={t("output.copyDescription")} limit={YT_LIMITS.DESCRIPTION_MAX} fieldLabel={t("output.description")} - blocked={blocked} + {...gate("description")} /> )} {tab === "tags" && ( )} diff --git a/src/components/editor/RigEditor.tsx b/src/components/editor/RigEditor.tsx index 47bf101..ea4be70 100644 --- a/src/components/editor/RigEditor.tsx +++ b/src/components/editor/RigEditor.tsx @@ -1,37 +1,160 @@ +import { lazy, Suspense, useId, useState } from "react"; import { useTranslation } from "react-i18next"; -import { AlertTriangle } from "lucide-react"; +import { AlertTriangle, ChevronsUpDown } from "lucide-react"; +import clsx from "clsx"; import { Input } from "@components/ui/Input"; import { Select } from "@components/ui/Select"; +import { Field, controlClasses } from "@components/ui/Field"; +import { PopoverContent, PopoverRoot, PopoverTrigger } from "@components/ui/Popover"; +import { Spinner } from "@components/icons/animated"; import { RIG_FIELDS, - parseCascadingValue, + cleanCpuName, parseCompositeValue, resolveCompositeOptions, resolveCompositeLabelKey, type RigField, type CompositePart, } from "@config/rig-fields"; -import { GPU_CUSTOM_BRAND_ID, findGpuBrand } from "@config/gpu-catalog"; +import { gpuValue, migrateGpuValue, modelForGpuValue } from "@config/gpu-catalog"; import { useEditorStore } from "@store/editor-store"; import { FIELD_LIMITS } from "@config/field-limits"; -import { - validateGpuValue, - validateCompositeField, - type RigValidationIssue, -} from "@utils/rig-validation"; +import { validateCompositeField, type RigValidationIssue } from "@utils/rig-validation"; + +const GpuList = lazy(() => import("./GpuList")); const CUSTOM_PREFIX = "custom:"; -function joinCascading(brand: string, series: string, model: string): string { - if (!brand && !series && !model) return ""; - return `${brand}|${series}|${model}`; -} - function joinComposite(parts: readonly string[]): string { if (parts.every((p) => !p)) return ""; return parts.join("|"); } +/** + * GPU: one searchable picker over the catalog, printing the official name + * ("NVIDIA GeForce RTX 5080"), plus a free-text fallback for anything not + * listed. Replaces three dependent dropdowns (Brand › Series › Model). + */ +function GpuPicker({ + label, + value, + onChange, +}: { + label: string; + value: string; + onChange: (next: string) => void; +}) { + const { t } = useTranslation("ui"); + const [open, setOpen] = useState(false); + const [customMode, setCustomMode] = useState(false); + const normalized = migrateGpuValue(value); + const model = modelForGpuValue(normalized); + const isOwnText = !model && normalized !== ""; + const showCustom = customMode || isOwnText; + + return ( +
+ + {(control) => ( + + + + {model?.name ?? (showCustom ? t("editor.gpuCustomChosen") : t("editor.gpuPick"))} + + + + + +
+ } + > + { + onChange(gpuValue(next)); + setCustomMode(false); + setOpen(false); + }} + onCustom={() => { + // Start from the current card's name so "RTX 5080" can + // become "RTX 5080 (overclocked)" without retyping. + onChange(model ? model.name : normalized); + setCustomMode(true); + setOpen(false); + }} + onClear={() => { + onChange(""); + setCustomMode(false); + setOpen(false); + }} + /> + + + + )} + + {showCustom && ( + onChange(e.target.value)} + autoComplete="off" + /> + )} + + ); +} + +/** CPU (and any other suggested text field): type freely or pick a suggestion. */ +function SuggestedTextField({ + field, + value, + onChange, +}: { + field: RigField; + value: string; + onChange: (next: string) => void; +}) { + const { t } = useTranslation("ui"); + const listId = useId(); + return ( + <> + onChange(e.target.value)} + // "Intel(R) Core(TM) i7-12700K CPU @ 3.60GHz", as Windows shows it, + // becomes "Intel Core i7-12700K" once the user leaves the field. + onBlur={(e) => { + const cleaned = field.id === "cpu" ? cleanCpuName(e.target.value) : e.target.value.trim(); + if (cleaned !== e.target.value) onChange(cleaned); + }} + /> + + {field.suggestions?.map((s) => ( + + + ); +} + export function RigEditor() { const { t } = useTranslation("ui"); const rig = useEditorStore((s) => s.rig); @@ -41,186 +164,58 @@ export function RigEditor() { if (!issue) return null; return (
- +
); }; - const renderCascading = (field: RigField) => { - const raw = rig[field.id] ?? ""; - const { brand, series, model } = parseCascadingValue(raw); - const isCustom = brand === GPU_CUSTOM_BRAND_ID; - const issue = validateGpuValue(raw); - const catalog = field.catalog ?? []; - - const brandOptions = [ - { value: "", label: "—" }, - ...catalog.map((b) => ({ value: b.id, label: b.label })), - ]; - const currentBrand = findGpuBrand(brand); - const seriesOptions = currentBrand - ? [ - { value: "", label: "—" }, - ...currentBrand.series.map((s) => ({ value: s.id, label: s.label })), - ] - : [{ value: "", label: "—" }]; - const currentSeries = currentBrand?.series.find((s) => s.id === series); - const modelOptions = currentSeries - ? [{ value: "", label: "—" }, ...currentSeries.models.map((m) => ({ value: m, label: m }))] - : [{ value: "", label: "—" }]; - - const setBrand = (next: string) => { - // Switching brand resets series + model so the user can't end up - // with mismatched cascading values (NVIDIA brand + AMD series). - setNested("rig", field.id, next ? joinCascading(next, "", "") : ""); - }; - const setSeries = (next: string) => { - setNested("rig", field.id, joinCascading(brand, next, "")); - }; - const setModel = (next: string) => { - setNested("rig", field.id, joinCascading(brand, series, next)); - }; - const setCustomText = (text: string) => { - setNested("rig", field.id, text ? joinCascading(GPU_CUSTOM_BRAND_ID, "", text) : ""); - }; - - return ( -
- {t(field.labelKey)} -
- setCustomText(e.target.value)} - /> -
- ) : ( - <> - - - )} -
- {renderValidationBadge(issue)} - - ); - }; - const renderComposite = (field: RigField) => { if (!field.composite) return null; + const composite = field.composite; const raw = rig[field.id] ?? ""; const { parts: storedParts } = parseCompositeValue(raw); - // Validate per field — only RAM has size/DDR semantics. Running the - // RAM validator on the OS composite mis-fired "Pick a DDR generation." const issue = validateCompositeField(field.id, raw); - const partValues = field.composite.parts.map((_p, i) => storedParts[i] ?? ""); + const partValues = composite.parts.map((_p, i) => storedParts[i] ?? ""); - // v0.23.0: setting a part also resets all downstream parts to "" so - // a cascading parent change can't leave the form with a stale child - // value that no longer exists in the new option list (e.g. switching - // OS name from Windows to macOS clears any leftover "11" / "Pro"). + // Cascading composites (OS) clear the parts after the one that changed, + // so switching Windows → macOS can't leave "Pro" behind. Independent + // ones (RAM) keep them: picking 32 GB must not wipe the DDR5 already set. const setPart = (index: number, next: string) => { const updated = [...partValues]; updated[index] = next; - for (let j = index + 1; j < updated.length; j++) { - updated[j] = ""; + if (composite.cascade) { + for (let j = index + 1; j < updated.length; j++) updated[j] = ""; } setNested("rig", field.id, joinComposite(updated)); }; - // Walk parts in declaration order; each part's resolvers see the - // previously-rendered values so cascading option lists / dynamic - // labels / hidden-when predicates work cleanly. - const previousValues: string[] = []; - const renderedParts: React.ReactNode[] = []; - - field.composite.parts.forEach((part, index) => { - const stored = partValues[index] ?? ""; - // hiddenWhen short-circuits BEFORE we render — and we still push - // the stored value into previousValues so a later visible part - // sees the full history (though in practice, parts after a - // hidden one are rare). - if (part.hiddenWhen?.(previousValues)) { - previousValues.push(stored); - return; - } - renderedParts.push(renderPart(part, index, previousValues, setPart)); - previousValues.push(stored); - }); - - return ( -
- {t(field.labelKey)} -
{renderedParts}
- {renderValidationBadge(issue)} -
- ); - - // Inner closure — needs access to `t`, `partValues`, and the part- - // local mutators. Defined as a function so the forEach above stays - // readable; not hoisted out because it captures lexical state. - function renderPart( - part: CompositePart, - index: number, - previousValues: readonly string[], - setPart: (index: number, next: string) => void, - ) { + const renderPart = (part: CompositePart, index: number, previous: readonly string[]) => { const stored = partValues[index] ?? ""; const isCustom = part.allowCustom && stored.startsWith(CUSTOM_PREFIX); const customText = isCustom ? stored.slice(CUSTOM_PREFIX.length) : ""; const selectValue = isCustom ? "custom" : stored; - const options = resolveCompositeOptions(part.options, previousValues); - const labelKey = resolveCompositeLabelKey(part, previousValues); - - const onSelectChange = (next: string) => { - if (next === "custom" && part.allowCustom) { - setPart(index, `${CUSTOM_PREFIX}`); - } else { - setPart(index, next); - } - }; - const onCustomChange = (next: string) => { - setPart(index, `${CUSTOM_PREFIX}${next}`); - }; + const options = resolveCompositeOptions(part.options, previous); + const labelKey = resolveCompositeLabelKey(part, previous); return ( -
+
onCustomChange(e.target.value)} + inputMode="decimal" + onChange={(e) => setPart(index, `${CUSTOM_PREFIX}${e.target.value}`)} /> {part.customSuffix && ( {part.customSuffix.trim()} @@ -229,7 +224,30 @@ export function RigEditor() { )}
); - } + }; + + // Walk parts in declaration order; each part's resolvers see the values + // before it, so cascading option lists, dynamic labels and hidden-when + // predicates line up. + const previousValues: string[] = []; + const renderedParts: React.ReactNode[] = []; + composite.parts.forEach((part, index) => { + const stored = partValues[index] ?? ""; + if (!part.hiddenWhen?.(previousValues)) { + renderedParts.push(renderPart(part, index, [...previousValues])); + } + previousValues.push(stored); + }); + + return ( +
+ + {t(field.labelKey)} + +
{renderedParts}
+ {renderValidationBadge(issue)} +
+ ); }; const renderDropdownWithVersion = (field: RigField) => { @@ -243,7 +261,7 @@ export function RigEditor() { }; return ( -
+
setNested("rig", field.id, e.target.value)} + value={value} + onChange={(e) => set(e.target.value)} /> ); })} diff --git a/src/components/editor/TimestampEditor.tsx b/src/components/editor/TimestampEditor.tsx index 3752255..fe8f59d 100644 --- a/src/components/editor/TimestampEditor.tsx +++ b/src/components/editor/TimestampEditor.tsx @@ -1,21 +1,86 @@ +import { useMemo } from "react"; import { useTranslation } from "react-i18next"; +import { CircleCheck, TriangleAlert, WandSparkles } from "lucide-react"; import { Textarea } from "@components/ui/Textarea"; +import { Button } from "@components/ui/Button"; import { useEditorStore } from "@store/editor-store"; import { FIELD_LIMITS } from "@config/field-limits"; +import { + checkChapters, + normalizeTimeline, + parseTimeline, + type ChapterIssue, +} from "@engine/timeline-parser"; +/** + * Timestamps, with a live check against YouTube's chapter rules (first at + * 0:00, at least three, ten seconds apart, in order) and a button that + * rewrites pasted lists ("[00:00] – Intro", editor frame counts) into the + * plain "0:00 Intro" form. + */ export function TimestampEditor() { const { t } = useTranslation("ui"); - const timestamps = useEditorStore((s) => s.timestamps); + const timestamps = useEditorStore((s) => s.timestamps) ?? ""; const set = useEditorStore((s) => s.set); + const entries = useMemo(() => parseTimeline(timestamps), [timestamps]); + const timedCount = entries.filter((e) => e.time).length; + const issues = useMemo(() => checkChapters(entries), [entries]); + const normalized = useMemo(() => normalizeTimeline(timestamps), [timestamps]); + const canNormalize = timedCount > 0 && normalized !== timestamps.trim(); + + const describe = (issue: ChapterIssue): string => { + switch (issue.kind) { + case "firstNotZero": + return t("editor.chapters.firstNotZero"); + case "tooFew": + return t("editor.chapters.tooFew", { n: issue.count }); + case "tooShort": + return t("editor.chapters.tooShort", { time: issue.time }); + case "outOfOrder": + return t("editor.chapters.outOfOrder", { time: issue.time }); + } + }; + return ( -