package d2talalayout

import (
	
	

	

	
	
)

// seedInput is an isolated TALA layout input with the D2 bindings needed to
// apply the selected result.
type seedInput struct {
	graph    *layoutgraph.Graph
	bindings translation
}

// newSeedInput translates a D2 graph into an isolated TALA input. It reads but
// never mutates graph.
func newSeedInput( context.Context,  *d2graph.Graph) (seedInput, error) {
	if  := .Err();  != nil {
		return seedInput{}, 
	}
	 := layoutgraph.NewGraph()
	,  := translateGraph(, , , false)
	if  != nil {
		return seedInput{}, 
	}
	return seedInput{graph: , bindings: }, nil
}

// runSeed runs one TALA variation in a new workspace. Input remains unchanged
// and may be reused concurrently by other attempts.
func runSeed( context.Context,  seedInput,  int64) (*layoutgraph.Graph, error) {
	if .graph == nil {
		return nil, fmt.Errorf("TALA seed graph is empty")
	}
	if  := .Err();  != nil {
		return nil, 
	}
	return engine.Layout(, .graph, engine.LayoutOptions{
		Seed: ,
	})
}