// React wraps the root React() method and stacks the return Reactor or passes it to the last stacked Reactor and stacks that returned reactor for next use
184506
func (sr *Stackers) React(s SignalMuxHandler, cl bool) Reactor {
	var lr Connector
	var err error

	if lr, err = sr.Last(); err != nil {
		co := sr.Reactor.React(s, cl)
		sr.ro.Lock()
		{
			sr.stacks = append(sr.stacks, co)
		}
		sr.ro.Unlock()
		return co
	}

	co := lr.React(s, cl)
	sr.ro.Lock()
	{
		sr.stacks = append(sr.stacks, co)
	}
	sr.ro.Unlock()
	return co
}
411610
func rootHandler(w http.ResponseWriter, r *http.Request) {
	if err := renderUI(w); err != nil {
		log.Println(err)
	}
}
449915
func (sr *Stackers) Bind(r Reactor, cl bool) {
	var lr Connector
	var err error

	if lr, err = sr.Last(); err != nil {
		sr.Reactor.Bind(r, cl)
		sr.ro.Lock()
		{
			sr.stacks = append(sr.stacks, r)
		}
		sr.ro.Unlock()
		return
	}

	lr.Bind(r, cl)
	sr.ro.Lock()
	{
		sr.stacks = append(sr.stacks, r)
	}
	sr.ro.Unlock()
}
1108799
func (s ShareItemsBtnDef) Props() ShareItemsBtnProps {
	uprops := s.ComponentDef.Props()
	return uprops.(ShareItemsBtnProps)
}
617859
func Import(c ...Compo) {
	for _, compo := range c {
		if _, err := components.register(compo); err != nil {
			Panicf("import component failed: %s", err)
		}
	}
}
1064049
func MergeReactors(rs ...Reactor) Reactor {
	if len(rs) == 0 {
		return nil
	}

	if len(rs) == 1 {
		return rs[0]
	}

	ms := ReactIdentity()
	var endwrap func()

	for _, si := range rs {
		func(so Reactor) {
			so.Bind(ms, false)
			if endwrap != nil {
				oc := endwrap
				endwrap = func() {
					<-so.CloseNotify()
					oc()
				}
			} else {
				endwrap = func() {
					<-so.CloseNotify()
				}
			}
		}(si)
	}

	GoSilent("MergeClose", func() {
		defer ms.Close()
		endwrap()
	})

	return ms
}
971528
func (a AboutMenuItemDef) Props() AboutMenuItemProps {
	uprops := a.ComponentDef.Props()
	return uprops.(AboutMenuItemProps)
}
204084
func (b *batchRenderer) render(startTime float64) {
	// If the batch is empty, mark as unscheduled, and stop render cycle.
	if len(b.batch) == 0 {
		b.scheduled = false
		return
	}

	// Drain the current batch.
	pending := b.batch
	b.batch = nil
	b.idx = make(map[Component]int)

	// Process batch.
	for i, c := range pending {
		// Skip unmounted components.
		if c.Context().unmounted {
			continue
		}

		// Check for remaining time budget, targeting 60fps (~16ms per frame).
		if i > 0 {
			elapsed := global.Get("performance").Call("now").Float() - startTime
			budgetRemaining := (1000 / 60) - elapsed
			avgRenderTime := elapsed / float64(i)
			// If the budget remaining is less than 2 times the average
			// Component render time, push the remainder of the batch to the
			// next frame.
			if budgetRemaining < avgRenderTime*2 {
				b.batch = pending[i:]
				for i, c := range b.batch {
					b.idx[c] = i
				}
				break
			}
		}

		// Perform render.
		prevHTML := extractHTML(c.Context().prevRender)
		nextHTML, skip, pendingMounts := renderComponent(c, c)
		if skip {
			continue
		}
		replaceNode(nextHTML.node, prevHTML.node)
		mount(pendingMounts...)
	}

	// Schedule next frame.
	requestAnimationFrame(b.render)
}
168786
func (e *Event) Stack() *Event {
	if e != nil {
		e.stack = true
	}
	return e
}
261609
func Render(browser, wrapperPath, binPath string, global bool) ([]byte, []byte, error) {
	mf, err := getManifestContent(browser, wrapperPath)
	if err != nil {
		return nil, nil, err
	}

	if binPath == "" {
		binPath = gopassPath(global)
	}
	wrap, err := getWrapperContent(binPath)
	if err != nil {
		return nil, nil, err
	}

	return wrap, mf, nil
}
950404
func init() {
	AddInitEventHandler(func(typeOf Event, value interface{}) (responseOf EventResponse) {
		if typeOf == REVEL_BEFORE_MODULES_LOADED {
			RegisterServerEngine(GO_NATIVE_SERVER_ENGINE, func() ServerEngine { return &GoHttpServer{} })
		}
		return
	})
}
105553
func (t *TemplateManager) Render(w io.Writer, name string, data interface{}) error {
	stack := []*Template{}
	tplSrc, err := t.getSrc(name)
	if err != nil {
		return err
	}
	err = t.push(&stack, tplSrc, name)
	if err != nil {
		return err
	}
	tpl, err := t.assemble(stack)
	if err != nil {
		return err
	}
	if err != nil {
		return err
	}

	if tpl == nil {
		return Errorf("Nil template named %s", name)
	}

	err = tpl.Execute(w, data)
	if err != nil {
		return err
	}

	return nil
}
391192
func (rootRouter *Router) ServeHTTP(rw http.ResponseWriter, r *http.Request) {

	// Manually create a closure. These variables are needed in middlewareStack.
	// The reason we put these here instead of in the middleware stack, is Go (as of 1.2)
	// creates a heap variable for each varaiable in the closure. To minimize that, we'll
	// just have one (closure *middlewareClosure).
	var closure middlewareClosure
	closure.Request.Request = r
	closure.appResponseWriter.ResponseWriter = rw
	closure.Routers = make([]*Router, 1, rootRouter.maxChildrenDepth)
	closure.Routers[0] = rootRouter
	closure.Contexts = make([]reflect.Value, 1, rootRouter.maxChildrenDepth)
	closure.Contexts[0] = reflect.New(rootRouter.contextType)
	closure.currentMiddlewareLen = len(rootRouter.middleware)
	closure.RootRouter = rootRouter
	closure.Request.rootContext = closure.Contexts[0]

	// Handle errors
	defer func() {
		if recovered := recover(); recovered != nil {
			rootRouter.handlePanic(&closure.appResponseWriter, &closure.Request, recovered)
		}
	}()

	next := middlewareStack(&closure)
	next(&closure.appResponseWriter, &closure.Request)
}
32511
func Stack() (c *StackController) {
	return &StackController{
		List:     stackList,
		New:      stackNew,
		Create:   stackCreate,
		Detail:   stackDetail,
		Edit:     stackEdit,
		Update:   stackUpdate,
		Deploy:   stackDeploy,
		Shutdown: stackShutdown,
		Delete:   stackDelete,
	}
}
78878
func (d Data) Render(w io.Writer, v interface{}) error {
	if hw, ok := w.(http.ResponseWriter); ok {
		c := hw.Header().Get(ContentType)
		if c != "" {
			d.Head.ContentType = c
		}
		d.Head.Write(hw)
	}

	w.Write(v.([]byte))
	return nil
}
305326
func (c Context) Stack() Context {
	c.l = c.l.Hook(sh)
	return c
}
555932
func (r *Render) Render(w io.Writer, e Engine, data interface{}) error {
	err := e.Render(w, data)
	if hw, ok := w.(http.ResponseWriter); err != nil && !r.opt.DisableHTTPErrorRendering && ok {
		http.Error(hw, err.Error(), http.StatusInternalServerError)
	}
	return err
}