text: !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.cyclic=e()}}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){"use strict";/**
   * Cyclic is an api for creating single or bidirectional bindings between any kind of objects.
   *
   * @copyright Oleg Slobodskoi 2014
   * @website https://github.com/kof/cyclic
   * @license MIT
   */
  module.exports=require("./lib")},{"./lib":4}],2:[function(require,module,exports){"use strict";var Model=require("./model");var objects=[];var bindingsMap={};var modelsMap={};function Binding(cycle,model,prop){this.cycle=cycle;this.model=model;this.prop=prop}module.exports=Binding;Binding.create=function(cycle,object,prop){var objectIndex=objects.indexOf(object);var binding;if(objectIndex>=0){binding=bindingsMap[objectIndex][prop]}if(binding)return binding;var model;if(objectIndex>=0){model=modelsMap[objectIndex]}if(objectIndex==-1){objects.push(object);objectIndex=objects.length-1}if(!model){model=new Model;modelsMap[objectIndex]=model;cycle.add(model)}binding=new Binding(cycle,model,prop);if(!bindingsMap[objectIndex])bindingsMap[objectIndex]={};bindingsMap[objectIndex][prop]=binding;Binding.defineProperty(object,prop,model);return binding};Binding.defineProperty=function(object,prop,model){if(object[prop]!=null)model.set(prop,object[prop]);Object.defineProperty(object,prop,{enumerable:true,get:function(){return model.get(prop)},set:function(value){model.set(prop,value)}})};Binding.prototype.to=function(object,prop,options){options||(options={});var binding=Binding.create(this.cycle,object,prop);this.model.on("change:"+this.prop,function(value){if(options.transform)value=options.transform(value);binding.model.set(prop,value);if(options.changed)options.changed(value)}.bind(this));return binding}},{"./model":5}],3:[function(require,module,exports){"use strict";function Cycle(){this.models={}}module.exports=Cycle;Cycle.prototype.add=function(model){this.models[model.id]=model;return this};Cycle.prototype.run=function(){for(var id in this.models){var model=this.models[id];if(model.isDirty)model.apply()}return this}},{}],4:[function(require,module,exports){"use strict";exports.Model=require("./model");exports.Binding=require("./Binding");exports.Cycle=require("./cycle");var cycle=new exports.Cycle;exports.run=cycle.run.bind(cycle);exports.bind=function(object,prop){return exports.Binding.create(cycle,object,prop)}},{"./Binding":2,"./cycle":3,"./model":5}],5:[function(require,module,exports){"use strict";var Emitter=require("component-emitter");var uid=0;function Model(object){this.id=++uid;this.object=object||{};this.changed={};this.isDirty=false}Emitter(Model.prototype);module.exports=Model;Model.prototype.get=function(name){return this.object[name]};Model.prototype.set=function(name,value,silent){if(silent||this.object[name]===value){this.object[name]=value;return this}this.changed[name]=value;this.isDirty=true;return this};Model.prototype.toJSON=function(){return this.object};Model.prototype.apply=function(){var changed=this.changed;this.changed={};this.isDirty=false;for(var name in changed){var value=changed[name];this.object[name]=value;this.emit("change:"+name,value,this)}return this}},{"component-emitter":6}],6:[function(require,module,exports){module.exports=Emitter;function Emitter(obj){if(obj)return mixin(obj)}function mixin(obj){for(var key in Emitter.prototype){obj[key]=Emitter.prototype[key]}return obj}Emitter.prototype.on=Emitter.prototype.addEventListener=function(event,fn){this._callbacks=this._callbacks||{};(this._callbacks[event]=this._callbacks[event]||[]).push(fn);return this};Emitter.prototype.once=function(event,fn){var self=this;this._callbacks=this._callbacks||{};function on(){self.off(event,on);fn.apply(this,arguments)}on.fn=fn;this.on(event,on);return this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(event,fn){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var callbacks=this._callbacks[event];if(!callbacks)return this;if(1==arguments.length){delete this._callbacks[event];return this}var cb;for(var i=0;i<callbacks.length;i++){cb=callbacks[i];if(cb===fn||cb.fn===fn){callbacks.splice(i,1);break}}return this};Emitter.prototype.emit=function(event){this._callbacks=this._callbacks||{};var args=[].slice.call(arguments,1),callbacks=this._callbacks[event];if(callbacks){callbacks=callbacks.slice(0);for(var i=0,len=callbacks.length;i<len;++i){callbacks[i].apply(this,args)}}return this};Emitter.prototype.listeners=function(event){this._callbacks=this._callbacks||{};return this._callbacks[event]||[]};Emitter.prototype.hasListeners=function(event){return!!this.listeners(event).length}},{}]},{},[1])(1)});