<commit_before>package templates

import (
	"fmt"
	"text/template"

	"github.com/manifoldco/promptui"
)

const (
	active   = `▸ {{ .Name | blue | bold }}{{ if .Title }} ({{ .Title }}){{end}}`
	inactive = `  {{ .Name | blue }}{{ if .Title }} ({{ .Title }}){{end}}`
	Selected = `{{ "✔" | green }} %s: {{ .Name | blue}}{{ if .Title }} ({{ .Title }}){{end}}`
	success  = `{{ "✔" | green }} {{ .Label }}: {{ .Value }}`
	failure  = `{{ "✗" | red }} {{ .Label }}: {{ .Value }}`
)

type input struct {
	Label string
	Value string
}

var (
	tplSuccess *template.Template
	tplFailure *template.Template
)

func init() {
	tplSuccess = template.Must(template.New("").Funcs(funcMap()).Parse(success))
	tplFailure = template.Must(template.New("").Funcs(funcMap()).Parse(failure))
}

var TplProvider = &promptui.SelectTemplates{
	FuncMap:  funcMap(),
	Active:   active,
	Inactive: inactive,
	Selected: fmt.Sprintf(Selected, "Provider"),
}

var TplProduct = &promptui.SelectTemplates{
	FuncMap:  funcMap(),
	Active:   active,
	Inactive: inactive,
	Selected: fmt.Sprintf(Selected, "Product"),
	Details: `
Product:	{{ .Name | blue}} ({{ .Title }})
Tagline:	{{ .Tagline }}
Features:
{{- range $i, $el := .Features }}
{{- if lt $i 3 }}
  {{ $el -}}
{{- end -}}
{{- end -}}`,
}

var TplPlan = &promptui.SelectTemplates{
	FuncMap:  funcMap(),
	Active:   active,
	Inactive: inactive,
	Selected: fmt.Sprintf(Selected, "Plan"),
	Details: `
Plan:	{{ .Name | blue}} ({{ .Title }})
Price:	{{ .Cost | price }}
{{- range $i, $el := .Features }}
{{- if lt $i 3 }}
{{ $el.Name | title }}:	{{ $el.Description -}}
{{- end -}}
{{- end -}}`,
}

var TplRegion = &promptui.SelectTemplates{
	FuncMap:  funcMap(),
	Active:   `▸ {{ .Name | blue | bold }} ({{ .Platform }}::{{ .Location }})`,
	Inactive: `  {{ .Name | blue }} ({{ .Platform }}::{{ .Location }})`,
	Selected: `{{"✔" | green }} Region: {{ .Name | blue }} ({{ .Platform }}::{{ .Location }})`,
}

var TplResource = &promptui.SelectTemplates{<commit_msg>Region should not be blue<commit_after>package templates

import (
	"fmt"
	"text/template"

	"github.com/manifoldco/promptui"
)

const (
	active   = `▸ {{ .Name | blue | bold }}{{ if .Title }} ({{ .Title }}){{end}}`
	inactive = `  {{ .Name | blue }}{{ if .Title }} ({{ .Title }}){{end}}`
	Selected = `{{ "✔" | green }} %s: {{ .Name | blue}}{{ if .Title }} ({{ .Title }}){{end}}`
	success  = `{{ "✔" | green }} {{ .Label }}: {{ .Value }}`
	failure  = `{{ "✗" | red }} {{ .Label }}: {{ .Value }}`
)

type input struct {
	Label string
	Value string
}

var (
	tplSuccess *template.Template
	tplFailure *template.Template
)

func init() {
	tplSuccess = template.Must(template.New("").Funcs(funcMap()).Parse(success))
	tplFailure = template.Must(template.New("").Funcs(funcMap()).Parse(failure))
}

var TplProvider = &promptui.SelectTemplates{
	FuncMap:  funcMap(),
	Active:   active,
	Inactive: inactive,
	Selected: fmt.Sprintf(Selected, "Provider"),
}

var TplProduct = &promptui.SelectTemplates{
	FuncMap:  funcMap(),
	Active:   active,
	Inactive: inactive,
	Selected: fmt.Sprintf(Selected, "Product"),
	Details: `
Product:	{{ .Name | blue}} ({{ .Title }})
Tagline:	{{ .Tagline }}
Features:
{{- range $i, $el := .Features }}
{{- if lt $i 3 }}
  {{ $el -}}
{{- end -}}
{{- end -}}`,
}

var TplPlan = &promptui.SelectTemplates{
	FuncMap:  funcMap(),
	Active:   active,
	Inactive: inactive,
	Selected: fmt.Sprintf(Selected, "Plan"),
	Details: `
Plan:	{{ .Name | blue}} ({{ .Title }})
Price:	{{ .Cost | price }}
{{- range $i, $el := .Features }}
{{- if lt $i 3 }}
{{ $el.Name | title }}:	{{ $el.Description -}}
{{- end -}}
{{- end -}}`,
}

var TplRegion = &promptui.SelectTemplates{
	FuncMap:  funcMap(),
	Active:   `▸ {{ .Name | blue | bold }} ({{ .Platform }}::{{ .Location }})`,
	Inactive: `  {{ .Name | blue }} ({{ .Platform }}::{{ .Location }})`,
	Selected: `{{"✔" | green }} Region: {{ .Name }} ({{ .Platform }}::{{ .Location }})`,
}

var TplResource = &promptui.SelectTemplates{
{'fraction_non_alphanumeric': 0.2437357630979499, 'fraction_numerical': 0.0010124019235636548, 'mean_word_length': 3.7329341317365268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4867655', 'n_tokens_mistral': 1493, 'n_tokens_neox': 1484, 'n_words': 332}