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.Cut=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){
module.exports = require("../lib/main");

module.exports.Mouse = require("../lib/mouse");

require("../lib/loader.web");
},{"../lib/loader.web":4,"../lib/main":5,"../lib/mouse":6}],2:[function(require,module,exports){
if (typeof DEBUG === "undefined") DEBUG = true;

function Cut() {
    if (!(this instanceof Cut)) {
        if (typeof arguments[0] === "function") {
            return Cut.Root.add.apply(Cut.Root, arguments);
        } else if (typeof arguments[0] === "object") {
            return Cut.Texture.add.apply(Cut.Texture, arguments);
        }
    }
    Cut._stats.create++;
    this._id = "";
    this._visible = true;
    this._parent = null;
    this._next = null;
    this._prev = null;
    this._first = null;
    this._last = null;
    this._pin = new Cut.Pin(this);
    this._cutouts = [];
    this._tickBefore = [];
    this._tickAfter = [];
    this._alpha = 1;
    this._attrs = null;
    this._listeners = null;
    this._flags = null;
}

Cut._create = function() {
    if (typeof Object.create == "function") {
        return function(proto, props) {
            return Object.create.call(Object, proto, props);
        };
    } else {
        return function(proto, props) {
            if (props) {
                throw Error("Second argument is not supported!");
            }
            if (!proto || typeof proto !== "object") {
                throw Error("Invalid prototype!");
            }
            noop.prototype = proto;
            return new noop();
        };
        function noop() {}
    }
}();

Cut._extend = function(base) {
    for (var i = 1; i < arguments.length; i++) {
        var obj = arguments[i];
        for (var name in obj) {
            if (obj.hasOwnProperty(name)) {
                base[name] = obj[name];
            }
        }
    }
    return base;
};

Cut._ensure = function(obj) {
    if (obj && obj instanceof Cut) {
        return obj;
    }
    throw "Invalid node: " + obj;
};

if (typeof performance !== "undefined" && performance.now) {
    Cut._now = function() {
        return performance.now();
    };
} else if (Date.now) {
    Cut._now = function() {
        return Date.now();
    };
} else {
    Cut._now = function() {
        return +new Date();
    };
}

Cut._isArray = Array.isArray || function(value) {
    return Object.prototype.toString.call(value) === "[object Array]";
};

Cut._TS = 0;

Cut._stats = {
    create: 0,
    tick: 0,
    paint: 0,
    paste: 0
};

Cut.create = function() {
    return new Cut();
};

Cut.prototype.MAX_ELAPSE = Infinity;

Cut.prototype._tick = function(elapsed, now, last) {
    if (!this._visible) {
        return;
    }
    if (elapsed > this.MAX_ELAPSE) {
        elapsed = this.MAX_ELAPSE;
    }
    this._pin.tick();
    var length = this._tickBefore.length;
    for (var i = 0; i < length; i++) {
        Cut._stats.tick++;
        this._tickBefore[i].call(this, elapsed, now, last);
    }
    var child, next = this._first;
    while (child = next) {
        next = child._next;
        child._tick(elapsed, now, last);
    }
    var length = this._tickAfter.length;
    for (var i = 0; i < length; i++) {
        Cut._stats.tick++;
        this._tickAfter[i].call(this, elapsed, now, last);
    }
};

Cut.prototype.tick = function(ticker, before) {
    if (before) {
        this._tickBefore.push(ticker);
    } else {
        this._tickAfter.push(ticker);
    }
};

Cut.prototype.untick = function(ticker) {
    var i;
    if (!ticker) {} else if ((i = this._tickBefore.indexOf(ticker)) >= 0) {
        this._tickBefore.splice(i, 1);
    } else if ((i = this._tickAfter.indexOf(ticker)) >= 0) {
        this._tickAfter.splice(i, 1);
    }
};

Cut.prototype._paint = function(context) {
    if (!this._visible) {
        return;
    }
    Cut._stats.paint++;
    var m = this._pin.absoluteMatrix();
    context.setTransform(m.a, m.b, m.c, m.d, m.e, m.f);
    this._alpha = this._pin._alpha * (this._parent ? this._parent._alpha : 1);
    var alpha = this._pin._textureAlpha * this._alpha;
    if (context.globalAlpha != alpha) {
        context.globalAlpha = alpha;
    }
    var length = this._cutouts.length;
    for (var i = 0; i < length; i++) {
        this._cutouts[i].paste(context);
    }
    if (context.globalAlpha != this._alpha) {
        context.globalAlpha = this._alpha;
    }
    var child, next = this._first;
    while (child = next) {
        next = child._next;
        child._paint(context);
    }
};

Cut.prototype.toString = function() {
    return "[" + this._id + "]";
};

Cut.prototype.id = function(id) {
    if (typeof id === "undefined") {
        return this._id;
    }
    this._id = id;
    return this;
};

Cut.prototype.attr = function(name, value) {
    if (typeof value === "undefined") {
        return this._attrs !== null ? this._attrs[name] : undefined;
    }
    (this._attrs !== null ? this._attrs : this._attrs = {})[name] = value;
    return this;
};

Cut.prototype.on = Cut.prototype.listen = function(types, listener) {
    if (types = this._onoff(types, listener, true)) {
        for (var i = 0; i < types.length; i++) {
            var type = types[i];
            this._listeners[type] = this._listeners[type] || [];
            this._listeners[type].push(listener);
            this._flag(type, true);
        }
    }
    return this;
};

Cut.prototype.off = function(types, listener) {
    if (types = this._onoff(types, listener, false)) {
        for (var i = 0; i < types.length; i++) {
            var type = types[i], all = this._listeners[type], index;
            if (all && (index = all.indexOf(listener)) >= 0) {
                all.splice(index, 1);
                if (!all.length) {
                    delete this._listeners[type];
                }
                this._flag(type, false);
            }
        }
    }
    return this;
};

Cut.prototype._onoff = function(types, listener, create) {
    if (!types || !types.length || typeof listener !== "function") {
        return false;
    }
    if (!(types = (Cut._isArray(types) ? types.join(" ") : types).match(/\S+/g))) {
        return false;
    }
    if (this._listeners === null) {
        if (create) {
            this._listeners = {};
        } else {
            return false;
        }
    }
    return types;
};

Cut.prototype.listeners = function(type) {
    return this._listeners && this._listeners[type];
};

Cut.prototype.publish = function(name, args) {
    var listeners = this.listeners(name);
    if (!listeners || !listeners.length) {
        return 0;
    }
    for (var l = 0; l < listeners.length; l++) {
        listeners[l].apply(this, args);
    }
    return listeners.length;
};

Cut.prototype.trigger = function(name, args) {
    this.publish(name, args);
    return this;
};

Cut.prototype.visit = function(visitor, data) {
    var reverse = visitor.reverse;
    var visible = visitor.visible;
    if (visitor.start && visitor.start(this, data)) {
        return;
    }
    var child, next = reverse ? this.last(visible) : this.first(visible);
    while (child = next) {
        next = reverse ? child.prev(visible) : child.next(visible);
        if (child.visit(visitor, data)) {
            return true;
        }
    }
    return visitor.end && visitor.end(this, data);
};

Cut.prototype.visible = function(visible) {
    if (typeof visible === "undefined") {
        return this._visible;
    }
    this._visible = visible;
    this._parent && (this._parent._ts_children = Cut._TS++);
    this._ts_pin = Cut._TS++;
    this.touch();
    return this;
};

Cut.prototype.hide = function() {
    return this.visible(false);
};

Cut.prototype.show = function() {
    return this.visible(true);
};

Cut.prototype.parent = function() {
    return this._parent;
};

Cut.prototype.next = function(visible) {
    var next = this._next;
    while (next && visible && !next._visible) {
        next = next._next;
    }
    return next;
};

Cut.prototype.prev = function(visible) {
    var prev = this._prev;
    while (prev && visible && !prev._visible) {
        prev = prev._prev;
    }
    return prev;
};

Cut.prototype.first = function(visible) {
    var next = this._first;
    while (next && visible && !next._visible) {
        next = next._next;
    }
    return next;
};

Cut.prototype.last = function(visible) {
    var prev = this._last;
    while (prev && visible && !prev._visible) {
        prev = prev._prev;
    }
    return prev;
};

Cut.prototype.append = function() {
    for (var i = 0; i < arguments.length; i++) {
        Cut._ensure(arguments[i]);
        arguments[i].appendTo(this);
    }
    return this;
};

Cut.prototype.prepend = function() {
    for (var i = 0; i < arguments.length; i++) {
        Cut._ensure(arguments[i]);
        arguments[i].prependTo(this);
    }
    return this;
};

Cut.prototype.appendTo = function(parent) {
    Cut._ensure(parent);
    this.remove();
    if (parent._last) {
        parent._last._next = this;
        this._prev = parent._last;
    }
    this._parent = parent;
    parent._last = this;
    if (!parent._first) {
        parent._first = this;
    }
    this._parent._flag(this, true);
    this._ts_parent = Cut._TS++;
    parent._ts_children = Cut._TS++;
    parent.touch();
    return this;
};

Cut.prototype.prependTo = function(parent) {
    Cut._ensure(parent);
    this.remove();
    if (parent._first) {
        parent._first._prev = this;
        this._next = parent._first;
    }
    this._parent = parent;
    parent._first = this;
    if (!parent._last) {
        parent._last = this;
    }
    this._parent._flag(this, true);
    this._ts_parent = Cut._TS++;
    parent._ts_children = Cut._TS++;
    parent.touch();
    return this;
};

Cut.prototype.insertNext = function() {
    if (arguments.length) {
        for (var i = 0; i < arguments.length; i++) {
            Cut._ensure(arguments[i]);
            arguments[i] && arguments[i].insertAfter(this);
        }
    }
    return this;
};

Cut.prototype.insertPrev = function() {
    if (arguments.length) {
        for (var i = 0; i < arguments.length; i++) {
            Cut._ensure(arguments[i]);
            arguments[i] && arguments[i].insertBefore(this);
        }
    }
    return this;
};

Cut.prototype.insertBefore = function(next) {
    Cut._ensure(next);
    this.remove();
    var parent = next._parent;
    var prev = next._prev;
    next._prev = this;
    prev && (prev._next = this) || parent && (parent._first = this);
    this._parent = parent;
    this._prev = prev;
    this._next = next;
    this._parent._flag(this, true);
    this._ts_parent = Cut._TS++;
    this.touch();
    return this;
};

Cut.prototype.insertAfter = function(prev) {
    Cut._ensure(prev);
    this.remove();
    var parent = prev._parent;
    var next = prev._next;
    prev._next = this;
    next && (next._prev = this) || parent && (parent._last = this);
    this._parent = parent;
    this._prev = prev;
    this._next = next;
    this._parent._flag(this, true);
    this._ts_parent = Cut._TS++;
    this.touch();
    return this;
};

Cut.prototype.remove = function() {
    if (arguments.length) {
        for (var i = 0; i < arguments.length; i++) {
            Cut._ensure(arguments[i]);
            arguments[i] && arguments[i].remove();
        }
        return this;
    }
    if (this._prev) {
        this._prev._next = this._next;
    }
    if (this._next) {
        this._next._prev = this._prev;
    }
    if (this._parent) {
        if (this._parent._first === this) {
            this._parent._first = this._next;
        }
        if (this._parent._last === this) {
            this._parent._last = this._prev;
        }
        this._parent._flag(this, false);
        this._parent._ts_children = Cut._TS++;
        this._parent.touch();
    }
    this._prev = this._next = this._parent = null;
    this._ts_parent = Cut._TS++;
    // this._parent.touch();
    return this;
};

Cut.prototype.empty = function() {
    var child, next = this._first;
    while (child = next) {
        next = child._next;
        child._prev = child._next = child._parent = null;
        this._flag(child, false);
    }
    this._first = this._last = null;
    this._ts_children = Cut._TS++;
    this.touch();
    return this;
};

// Deep flags used for optimizing event distribution.
Cut.prototype._flag = function(obj, on) {
    if (typeof on === "undefined") {
        return this._flags !== null && this._flags[obj] || 0;
    }
    if (typeof obj === "string") {
        if (on) {
            this._flags = this._flags || {};
            if (!this._flags[obj] && this._parent) {
                this._parent._flag(obj, true);
            }
            this._flags[obj] = (this._flags[obj] || 0) + 1;
        } else if (this._flags && this._flags[obj] > 0) {
            if (this._flags[obj] == 1 && this._parent) {
                this._parent._flag(obj, false);
            }
            this._flags[obj] = this._flags[obj] - 1;
        }
    }
    if (typeof obj === "object") {
        if (obj._flags) {
            for (var type in obj._flags) {
                if (obj._flags[type] > 0) {
                    this._flag(type, on);
                }
            }
        }
    }
    return this;
};

Cut.prototype.touch = function() {
    this._ts_touch = Cut._TS++;
    this._parent && this._parent.touch();
    return this;
};

Cut.prototype.pin = function(a, b) {
    if (typeof a === "object") {
        this._pin.set(a);
        return this;
    } else if (typeof a === "string") {
        if (typeof b === "undefined") {
            return this._pin.get(a);
        } else {
            this._pin.set(a, b);
            return this;
        }
    } else if (typeof a === "undefined") {
        return this._pin;
    }
};

Cut.prototype.matrix = function() {
    return this._pin.absoluteMatrix(this, this._parent ? this._parent._pin : null);
};

Cut.image = function(cutout) {
    var image = new Cut.Image();
    cutout && image.image(cutout);
    return image;
};

Cut.Image = function() {
    Cut.Image._super.call(this);
};

Cut.Image._super = Cut;

Cut.Image.prototype = Cut._create(Cut.Image._super.prototype);

Cut.Image.prototype.constructor = Cut.Image;

/**
 * @deprecated Use image
 */
Cut.Image.prototype.setImage = function(a, b, c) {
    return this.image(a, b, c);
};

Cut.Image.prototype.image = function(cutout) {
    this._cutouts[0] = Cut.cutout(cutout);
    this._cutouts.length = 1;
    this.pin({
        width: this._cutouts[0] ? this._cutouts[0].dWidth() : 0,
        height: this._cutouts[0] ? this._cutouts[0].dHeight() : 0
    });
    this._cutout = this._cutouts[0].clone();
    return this;
};

Cut.Image.prototype.cropX = function(w, x) {
    return this.image(this._cutouts[0].cropX(w, x));
};

Cut.Image.prototype.cropY = function(h, y) {
    return this.image(this._cutouts[0].cropY(h, y));
};

Cut.Image.prototype._slice = function(i) {
    return this._cutouts[i] || (this._cutouts[i] = this._cutout.clone());
};

Cut.Image.prototype.tile = function(inner) {
    this.untick(this._repeatTicker);
    this._repeatTicker = function() {
        if (this._mo_tile == this._ts_touch) {
            return;
        }
        this._mo_tile = this._ts_touch;
        var bleft = this._cutout._left, bright = this._cutout._right;
        var btop = this._cutout._top, bbottom = this._cutout._bottom;
        var bwidth = this._cutout.dWidth() - bleft - bright;
        var bheight = this._cutout.dHeight() - btop - bbottom;
        var width = this.pin("width");
        width = inner ? width : width - bleft - bright;
        var height = this.pin("height");
        height = inner ? height : height - btop - bbottom;
        var left = inner ? -bleft : 0;
        var top = inner ? -btop : 0;
        var c = 0;
        // top, left
        if (btop && bleft) {
            this._slice(c++).cropX(bleft, 0).cropY(btop, 0).offset(left, top);
        }
        // bottom, left
        if (bbottom && bleft) {
            this._slice(c++).cropX(bleft, 0).cropY(bbottom, bheight + btop).offset(left, top + height + btop);
        }
        // top, right
        if (btop && bright) {
            this._slice(c++).cropX(bright, bwidth + bleft).cropY(btop, 0).offset(left + width + bleft, top);
        }
        // bottom, right
        if (bbottom && bright) {
            this._slice(c++).cropX(bright, bwidth + bleft).cropY(bbottom, bheight + btop).offset(left + width + bleft, top + height + btop);
        }
        var x = left + bleft;
        var r = width;
        while (r > 0) {
            var w = Math.min(bwidth, r);
            r -= bwidth;
            var y = top + btop;
            var b = height;
            while (b > 0) {
                var h = Math.min(bheight, b);
                b -= bheight;
                this._slice(c++).cropX(w, bleft).cropY(h, btop).offset(x, y);
                if (r <= 0) {
                    // left
                    if (bleft) {
                        this._slice(c++).cropX(bleft, 0).cropY(h, btop).offset(left, y);
                    }
                    // right
                    if (bright) {
                        this._slice(c++).cropX(bright, bwidth + bleft).cropY(h, btop).offset(x + w, y);
                    }
                }
                y += h;
            }
            // top
            if (btop) {
                this._slice(c++).cropX(w, bleft).cropY(btop, 0).offset(x, top);
            }
            // bottom
            if (bbottom) {
                this._slice(c++).cropX(w, bleft).cropY(bbottom, bheight + btop).offset(x, y);
            }
            x += w;
        }
        this._cutouts.length = c;
    };
    this.tick(this._repeatTicker);
    return this;
};

Cut.Image.prototype.stretch = function(inner) {
    this.untick(this._repeatTicker);
    this._repeatTicker = function() {
        if (this._mo_stretch == this._pin._ts_transform) {
            return;
        }
        this._mo_stretch = this._pin._ts_transform;
        var oleft = this._cutout._left, oright = this._cutout._right;
        var otop = this._cutout._top, obottom = this._cutout._bottom;
        var owidth = this._cutout.dWidth(), oheight = this._cutout.dHeight();
        var width = this.pin("width"), height = this.pin("height");
        width = inner ? width + oleft + oright : Math.max(width, oleft + oright);
        height = inner ? height + otop + obottom : Math.max(height, otop + obottom);
        var c = 0;
        // top, left
        if (otop && oleft) {
            this._slice(c++).cropX(oleft, 0).cropY(otop, 0).offset(0, 0);
        }
        // bottom, left
        if (obottom && oleft) {
            this._slice(c++).cropX(oleft, 0).cropY(obottom, oheight - obottom).offset(0, height - obottom);
        }
        // top, right
        if (otop && oright) {
            this._slice(c++).cropX(oright, owidth - oright).cropY(otop, 0).offset(width - oright, 0);
        }
        // bottom, right
        if (obottom && oright) {
            this._slice(c++).cropX(oright, owidth - oright).cropY(obottom, oheight - obottom).offset(width - oright, height - obottom);
        }
        // top
        if (otop) {
            this._slice(c++).cropX(owidth - oleft - oright, oleft).cropY(otop, 0).offset(oleft, 0).dWidth(width - oleft - oright);
        }
        // bottom
        if (obottom) {
            this._slice(c++).cropX(owidth - oleft - oright, oleft).cropY(obottom, oheight - obottom).offset(oleft, height - obottom).dWidth(width - oleft - oright);
        }
        // left
        if (oleft) {
            this._slice(c++).cropX(oleft, 0).cropY(oheight - otop - obottom, otop).offset(0, otop).dHeight(height - otop - obottom);
        }
        // right
        if (oright) {
            this._slice(c++).cropX(oright, owidth - oright).cropY(oheight - otop - obottom, otop).offset(width - oright, otop).dHeight(height - otop - obottom);
        }
        // center
        this._slice(c++).cropX(owidth - oleft - oright, oleft).cropY(oheight - otop - obottom, otop).offset(oleft, otop).dWidth(width - oleft - oright).dHeight(height - otop - obottom);
        this._cutouts.length = c;
    };
    this.tick(this._repeatTicker);
    return this;
};

Cut.anim = function(frames, fps) {
    var anim = new Cut.Anim().frames(frames).gotoFrame(0);
    fps && anim.fps(fps);
    return anim;
};

Cut.Anim = function() {
    Cut.Anim._super.call(this);
    this._fps = Cut.Anim.FPS;
    this._ft = 1e3 / this._fps;
    this._time = -1;
    this._repeat = 0;
    this._frame = 0;
    this._frames = [];
    this._labels = {};
    var lastTime = 0;
    this.tick(function(t, now, last) {
        if (this._time < 0 || this._frames.length <= 1) {
            return;
        }
        // ignore old elapsed
        var ignore = lastTime != last;
        lastTime = now;
        this.touch();
        if (ignore) {
            return;
        }
        this._time += t;
        if (this._time < this._ft) {
            return;
        }
        var n = this._time / this._ft | 0;
        this._time -= n * this._ft;
        this.moveFrame(n);
        if (this._repeat > 0 && (this._repeat -= n) <= 0) {
            this.stop();
            this._callback && this._callback();
        }
    }, false);
};

Cut.Anim._super = Cut;

Cut.Anim.prototype = Cut._create(Cut.Anim._super.prototype);

Cut.Anim.prototype.constructor = Cut.Anim;

Cut.Anim.FPS = 22;

Cut.Anim.prototype.fps = function(fps) {
    if (typeof fps === "undefined") {
        return this._fps;
    }
    this._fps = fps || Cut.Anim.FPS;
    this._ft = 1e3 / this._fps;
    return this;
};

/**
 * @deprecated Use frames
 */
Cut.Anim.prototype.setFrames = function(a, b, c) {
    return this.frames(a, b, c);
};

Cut.Anim.prototype.frames = function(frames) {
    this._frame = 0;
    this._frames = [];
    this._labels = {};
    frames = Cut.cutout(frames, true);
    if (frames && frames.length) {
        for (var i = 0; i < frames.length; i++) {
            var cutout = frames[i];
            this._frames.push(cutout);
            this._labels[cutout._name] = i;
        }
    }
    return this;
};

Cut.Anim.prototype.length = function() {
    return this._frames ? this._frames.length : 0;
};

Cut.Anim.prototype.gotoFrame = function(frame, resize) {
    frame = Cut.Math.rotate(frame, this._frames.length) | 0;
    this._frame = frame;
    resize = resize || !this._cutouts[0];
    this._cutouts[0] = this._frames[this._frame];
    if (resize) {
        // TODO: don't create object
        this.pin({
            width: this._cutouts[0].dWidth(),
            height: this._cutouts[0].dHeight()
        });
    }
    this._ts_frame = Cut._TS++;
    this.touch();
    return this;
};

Cut.Anim.prototype.moveFrame = function(move) {
    return this.gotoFrame(this._frame + move);
};

Cut.Anim.prototype.gotoLabel = function(label, resize) {
    return this.gotoFrame(this._labels[label] || 0, resize);
};

Cut.Anim.prototype.repeat = function(repeat, callback) {
    this._repeat = repeat * this._frames.length - 1;
    this._callback = callback;
    this.play();
    return this;
};

Cut.Anim.prototype.play = function(frame) {
    if (typeof frame !== "undefined") {
        this.gotoFrame(frame);
        this._time = 0;
    } else if (this._time < 0) {
        this._time = 0;
    }
    this.touch();
    return this;
};

Cut.Anim.prototype.stop = function(frame) {
    this._time = -1;
    if (typeof frame !== "undefined") {
        this.gotoFrame(frame);
    }
    return this;
};

Cut.string = function(frames) {
    return new Cut.String().frames(frames);
};

Cut.String = function() {
    Cut.String._super.call(this);
    this.row();
};

Cut.String._super = Cut;

Cut.String.prototype = Cut._create(Cut.String._super.prototype);

Cut.String.prototype.constructor = Cut.String;

/**
 * @deprecated Use frames
 */
Cut.String.prototype.setFont = function(a, b, c) {
    return this.frames(a, b, c);
};

Cut.String.prototype.frames = function(frames) {
    if (typeof frames == "string") {
        this._frames = function(value) {
            return frames + value;
        };
    } else if (typeof frames === "function") {
        this._frames = frames;
    }
    return this;
};

/**
 * @deprecated Use value
 */
Cut.String.prototype.setValue = function(a, b, c) {
    return this.value(a, b, c);
};

Cut.String.prototype.value = function(value) {
    if (typeof value === "undefined") {
        return this._value;
    }
    if (this._value === value) {
        return this;
    }
    this._value = value;
    if (typeof value !== "string" && !Cut._isArray(value)) {
        value = value + "";
    }
    var child = this._first;
    for (var i = 0; i < value.length; i++) {
        var selector = this._frames(value[i]);
        if (child) {
            child.image(selector).show();
        } else {
            child = Cut.image(selector).appendTo(this);
        }
        child = child._next;
    }
    while (child) {
        child.hide();
        child = child._next;
    }
    return this;
};

Cut.row = function(align) {
    return Cut.create().row(align);
};

Cut.prototype.row = function(align) {
    this.sequence("row", align);
    return this;
};

Cut.column = function(align) {
    return Cut.create().column(align);
};

Cut.prototype.column = function(align) {
    this.sequence("column", align);
    return this;
};

Cut.sequence = function(type, align) {
    return new Cut.create().sequence(type, align);
};

Cut.prototype.sequence = function(type, align) {
    this._padding = this._padding || 0;
    this._spacing = this._spacing || 0;
    this.untick(this._layoutTicker);
    this._layoutTicker = function() {
        if (this._mo_seq == this._ts_touch) {
            return;
        }
        this._mo_seq = this._ts_touch;
        var alignChildren = this._mo_seqAlign != this._ts_children;
        this._mo_seqAlign = this._ts_children;
        var width = 0, height = 0;
        var child, next = this.first(true);
        var first = true;
        while (child = next) {
            next = child.next(true);
            child._pin.relativeMatrix();
            var w = child._pin._boxWidth;
            var h = child._pin._boxHeight;
            if (type == "column") {
                !first && (height += this._spacing);
                child.pin("offsetY") != height && child.pin("offsetY", height);
                width = Math.max(width, w);
                height = height + h;
                alignChildren && child.pin("alignX", align);
            } else if (type == "row") {
                !first && (width += this._spacing);
                child.pin("offsetX") != width && child.pin("offsetX", width);
                width = width + w;
                height = Math.max(height, h);
                alignChildren && child.pin("alignY", align);
            }
            first = false;
        }
        width += 2 * this._padding;
        height += 2 * this._padding;
        this.pin("width") != width && this.pin("width", width);
        this.pin("height") != height && this.pin("height", height);
    };
    this.tick(this._layoutTicker);
    return this;
};

Cut.box = function() {
    return new Cut.create().box();
};

Cut.prototype.box = function() {
    if (this._boxTicker) return this;
    this._padding = this._padding || 0;
    this._boxTicker = function() {
        if (this._mo_box == this._ts_touch) {
            return;
        }
        this._mo_box = this._ts_touch;
        var width = 0, height = 0;
        var child, next = this.first(true);
        while (child = next) {
            next = child.next(true);
            child._pin.relativeMatrix();
            var w = child._pin._boxWidth;
            var h = child._pin._boxHeight;
            width = Math.max(width, w);
            height = Math.max(height, h);
        }
        width += 2 * this._padding;
        height += 2 * this._padding;
        this.pin("width") != width && this.pin("width", width);
        this.pin("height") != height && this.pin("height", height);
    };
    this.tick(this._boxTicker);
    return this;
};

Cut.prototype.padding = function(pad) {
    this._padding = pad;
    return this;
};

Cut.prototype.spacing = function(space) {
    this._spacing = space;
    return this;
};

Cut._config = {};

Cut.config = function() {
    if (arguments.length === 1 && typeof arguments[0] === "string") {
        return Cut._config[arguments[0]];
    }
    if (arguments.length === 1 && typeof arguments[0] === "object") {
        Cut._extend(Cut._config, arguments[0]);
    }
    if (arguments.length === 2 && typeof arguments[0] === "string") {
        Cut._config[(arguments[0], arguments[1])];
    }
};

Cut.start = function(config) {
    DEBUG && console.log("Starting...");
    config = Cut._extend({}, Cut._config, config);
    Cut.Texture.start(config["image-loader"], function() {
        Cut.Root.start(config["app-loader"]);
    });
};

Cut.pause = function() {
    Cut.Root.pause();
};

Cut.resume = function() {
    Cut.Root.resume();
};

Cut.cutout = function(selector, prefix) {
    return Cut.Texture.select(selector, prefix);
};

Cut.Root = function(request, render) {
    Cut.Root._super.call(this);
    this._paused = true;
    this._render = render;
    var self = this;
    var requestCallback = function() {
        if (self._paused === true) {
            return;
        }
        self._mo_touch = self._ts_touch;
        self._render();
        self.request();
        self._mo_touch == self._ts_touch && self.pause();
    };
    this.request = function() {
        request(requestCallback);
    };
};

Cut.Root._super = Cut;

Cut.Root.prototype = Cut._create(Cut.Root._super.prototype);

Cut.Root.prototype.constructor = Cut.Root;

Cut.Root.prototype.start = function() {
    return this.resume();
};

Cut.Root.prototype.resume = function(force) {
    if (this._paused || force) {
        this._paused = false;
        this.request();
    }
    return this;
};

Cut.Root.prototype.pause = function() {
    this._paused = true;
    return this;
};

Cut.Root.prototype.touch = function() {
    this.resume();
    return Cut.Root._super.prototype.touch.call(this);
};

Cut.Root.prototype.render = function(context) {
    Cut._stats.tick = Cut._stats.paint = Cut._stats.paste = 0;
    var now = Cut._now();
    var last = this._lastTime || now;
    var elapsed = now - last;
    this._lastTime = now;
    this._tick(elapsed, now, last);
    this._paint(context);
    Cut._stats.fps = 1e3 / (Cut._now() - now);
};

Cut.Root.prototype.viewport = function(width, height, ratio) {
    if (typeof width === "undefined") {
        return Cut._extend({}, this._viewport);
    }
    this._viewport = {
        width: width,
        height: height,
        ratio: ratio || 1
    };
    this._updateViewbox();
    var data = Cut._extend({}, this._viewport);
    this.visit({
        start: function(cut) {
            if (!cut._flag("viewport")) {
                return true;
            }
            cut.publish("viewport", [ data ]);
        }
    });
    return this;
};

Cut.Root.prototype.viewbox = function(width, height, mode) {
    this._viewbox = {
        width: width,
        height: height,
        mode: /^(in|out|in-pad|out-crop)$/.test(mode) ? mode : "in-pad"
    };
    this._updateViewbox();
    return this;
};

Cut.Root.prototype._updateViewbox = function() {
    var box = this._viewbox;
    var size = this._viewport;
    if (size && box) {
        this.pin({
            width: box.width,
            height: box.height
        });
        this._pin._scaleTo(size.width, size.height, box.mode);
    } else if (size) {
        this.pin({
            width: size.width,
            height: size.height
        });
    }
};

Cut.Root._queue = [];

Cut.Root._roots = [];

Cut.Root._loader = null;

Cut.Root.add = function(app, opts) {
    if (!Cut.Root._loader) {
        Cut.Root._queue.push(arguments);
        return;
    }
    DEBUG && console.log("Loading app...");
    this._loader(function(root, canvas) {
        DEBUG && console.log("Initing app...");
        app(root, canvas);
        Cut.Root._roots.push(root);
        DEBUG && console.log("Starting app...");
        root.start();
    }, opts);
};

Cut.Root.start = function(loader) {
    DEBUG && console.log("Loading apps...");
    Cut.Root._loader = loader;
    var args;
    while (args = Cut.Root._queue.shift()) {
        Cut.Root.add.apply(Cut.Root, args);
    }
};

Cut.Root.pause = function() {
    if (!Cut.Root._pause) {
        Cut.Root._pause = true;
        for (var i = Cut.Root._roots.length - 1; i >= 0; i--) {
            Cut.Root._roots[i].pause();
        }
    }
};

Cut.Root.resume = function() {
    if (Cut.Root._pause) {
        Cut.Root._pause = false;
        for (var i = Cut.Root._roots.length - 1; i >= 0; i--) {
            Cut.Root._roots[i].resume();
        }
    }
};

Cut.Texture = function(data) {
    this.isTexture = true;
    this._name = data.name || ++Cut._TS + "";
    this._imagePath = data.imagePath;
    this._imageRatio = data.imageRatio || 1;
    this._cutouts = data.cutouts || [];
    this._factory = data.factory;
    this._map = data.filter || data.map;
    this._ratio = data.ratio || 1;
    this._trim = data.trim || 0;
};

Cut.Texture.prototype._wrap = function(cutout) {
    if (!cutout || cutout.isCutout) {
        return cutout;
    }
    cutout = Cut._extend({}, cutout);
    if (typeof this._map === "function") {
        cutout = this._map(cutout);
    }
    var ratio = this._ratio;
    if (ratio != 1) {
        cutout.x *= ratio, cutout.y *= ratio;
        cutout.width *= ratio, cutout.height *= ratio;
        cutout.top *= ratio, cutout.bottom *= ratio;
        cutout.left *= ratio, cutout.right *= ratio;
    }
    var trim = this._trim;
    if (trim) {
        cutout.x += trim, cutout.y += trim;
        cutout.width -= 2 * trim, cutout.height -= 2 * trim;
        cutout.top -= trim, cutout.bottom -= trim;
        cutout.left -= trim, cutout.right -= trim;
    }
    var self = this;
    cutout = new Cut.Out(cutout, function() {
        // do not query image until playing
        return Cut.Texture._images[self._imagePath];
    }, this._imageRatio);
    return cutout;
};

Cut.Texture.prototype.select = function(selector, prefix) {
    if (!prefix) {
        // one
        for (var i = 0; i < this._cutouts.length; i++) {
            var cutout = this._cutouts[i];
            var name = cutout._name || cutout.name;
            if (name == selector) {
                return this._wrap(cutout);
            }
        }
        if (this._factory) {
            return this._wrap(this._factory(selector));
        }
    } else {
        // many
        var results = [];
        var length = selector.length;
        for (var i = 0; i < this._cutouts.length; i++) {
            var cutout = this._cutouts[i];
            var name = cutout._name || cutout.name;
            if (name && name.substring(0, length) == selector) {
                results.push(this._wrap(cutout));
            }
        }
        if (results.length) {
            return results;
        }
    }
};

// TODO: invalidate cache on new texture, etc.
Cut.Texture._cache = {
    one: {},
    many: {}
};

Cut.Texture.select = function(selector, prefix) {
    if (typeof selector === "function") {
        return Cut.Texture.select(selector(), prefix);
    }
    if (typeof selector !== "string") {
        return selector;
    }
    var i = selector.indexOf(":");
    var tname = i < 1 ? null : selector.slice(0, i);
    var cname = i < 0 ? selector : selector.slice(i + 1);
    var cache = prefix ? Cut.Texture._cache.many : Cut.Texture._cache.one;
    var result = cache[selector];
    if (result) {
        return Cut.Texture._clone(result, prefix);
    } else if (result === null) {
        throw "Cutout not found: '" + selector + "'";
    }
    if (tname) {
        var texture = Cut.Texture._list[tname];
        if (texture) {
            result = texture.select(cname, prefix);
        } else {
            throw "Texture not found: '" + selector + "'";
        }
    } else {
        var list = Cut.Texture._list;
        for (tname in list) {
            if (list.hasOwnProperty(tname)) {
                result = list[tname].select(cname, prefix);
            }
            if (result) {
                break;
            }
        }
    }
    if (result) {
        cache[selector] = result;
        return Cut.Texture._clone(result, prefix);
    } else {
        cache[selector] = null;
        throw "Cutout not found: '" + selector + "'";
    }
};

Cut.Texture._clone = function(result, prefix) {
    if (prefix) {
        var clone = [];
        for (var i = 0; i < result.length; i++) {
            clone[i] = result[i].clone();
        }
        return clone;
    } else {
        return result.clone();
    }
};

/**
 * @deprecated Use `Cut(texture)` instead.
 */
Cut.addTexture = function() {
    return Cut.Texture.add.apply(Cut.Texture, arguments);
};

Cut.Texture._list = {};

Cut.Texture.add = function() {
    for (var i = 0; i < arguments.length; i++) {
        var texture = arguments[i];
        texture = texture.isTexture ? texture : new Cut.Texture(texture);
        Cut.Texture._list[texture._name] = texture;
    }
    return this;
};

Cut.Texture._images = {};

Cut.Texture.start = function(loader, callback) {
    DEBUG && console.log("Loading images...");
    var loading = 0;
    var noimage = true;
    var textures = Cut.Texture._list;
    for (var texture in textures) {
        var path = textures[texture]._imagePath;
        if (path) {
            loading++;
            Cut.Texture._images[path] = loader(path, complete, error);
            noimage = false;
        }
    }
    if (noimage) {
        DEBUG && console.log("No image to load.");
        callback && callback();
    }
    function complete() {
        DEBUG && console.log("Image loaded.");
        done();
    }
    function error(msg) {
        DEBUG && console.log("Error loading image: " + msg);
        done();
    }
    function done() {
        if (--loading <= 0) {
            DEBUG && console.log("Images loaded.");
            callback && callback();
        }
    }
};

Cut.Out = function(def, image, ratio) {
    this.isCutout = true;
    if (typeof image === "function") {
        this._imagefn = image;
    } else {
        this._image = image;
    }
    this._ratio = ratio || 1;
    this._name = def.name;
    this._x = def.x;
    this._y = def.y;
    this._width = def.width;
    this._height = def.height;
    this._top = def.top || 0;
    this._bottom = def.bottom || 0;
    this._left = def.left || 0;
    this._right = def.right || 0;
    this._reset();
};

Cut.Out.prototype._reset = function() {
    this._sx = this._x * this._ratio;
    this._sy = this._y * this._ratio;
    this._sw = this._width * this._ratio;
    this._sh = this._height * this._ratio;
    this._dx = 0;
    this._dy = 0;
    this._dw = this._width;
    this._dh = this._height;
};

Cut.Out.prototype.clone = function() {
    var clone = Cut._create(Cut.Out.prototype);
    for (var attr in this) if (this.hasOwnProperty(attr)) clone[attr] = this[attr];
    clone._reset();
    return clone;
};

Cut.Out.prototype.dWidth = function(width) {
    if (typeof width !== "undefined") {
        this._dw = width;
        return this;
    }
    return this._dw;
};

Cut.Out.prototype.dHeight = function(height) {
    if (typeof height !== "undefined") {
        this._dh = height;
        return this;
    }
    return this._dh;
};

Cut.Out.prototype.cropX = function(w, x) {
    x = x || 0;
    w = Math.min(w, this._width - x);
    this._dw = w;
    this._sw = w * this._ratio;
    this._sx = (this._x + x) * this._ratio;
    return this;
};

Cut.Out.prototype.cropY = function(h, y) {
    y = y || 0;
    h = Math.min(h, this._height - y);
    this._dh = h;
    this._sh = h * this._ratio;
    this._sy = (this._y + y) * this._ratio;
    return this;
};

Cut.Out.prototype.offset = function(x, y) {
    this._dx = x;
    this._dy = y;
    return this;
};

Cut.Out.prototype.paste = function(context) {
    Cut._stats.paste++;
    if (!this._image && this._imagefn) {
        this._image = this._imagefn();
    }
    try {
        if (this._image) {
            context.drawImage(this._image, // source
            this._sx, this._sy, this._sw, this._sh, // cut
            this._dx, this._dy, this._dw, this._dh);
        }
    } catch (e) {
        if (!this._failed) {
            console.log("Unable to paste: " + this + " " + this._image);
            this._failed = true;
        }
    }
};

Cut.Out.prototype.toString = function() {
    return "[" + this._name + ": " + this._sx + "x" + this._sy + "-" + this._sw + "x" + this._sh + "" + this._dx + "x" + this._dy + "-" + this._dw + "x" + this._dh + "]";
};

Cut.drawing = function() {
    return Cut.image(Cut.Out.drawing.apply(Cut.Out, arguments));
};

// [name], width, height, [ratio], [draw]
// def, [draw]
Cut.Out.drawing = function() {
    var canvas = document.createElement("canvas");
    var context = canvas.getContext("2d");
    var def = {};
    var ai = 0;
    if (typeof arguments[ai] === "object") {
        def = arguments[ai++];
    } else {
        if (typeof arguments[ai] === "string") {
            def.name = arguments[ai++];
        }
        def.width = arguments[ai++];
        def.height = arguments[ai++];
        if (typeof arguments[ai] === "number") {
            def.ratio = arguments[ai++];
        }
        def.x = 0;
        def.y = 0;
    }
    def.ratio = def.ratio || 1;
    def.name = def.name || Math.random() * 1e3 | 0;
    canvas.width = Math.ceil(def.width * def.ratio);
    canvas.height = Math.ceil(def.height * def.ratio);
    var cut = new Cut.Out(def, canvas, def.ratio);
    if (typeof arguments[arguments.length - 1] === "function") {
        arguments[arguments.length - 1].call(cut, context, def.ratio);
    }
    return cut;
};

Cut.Pin = function(owner) {
    this._owner = owner;
    this._parent = null;
    // relative to parent
    this._relativeMatrix = new Cut.Matrix();
    // relative to root
    this._absoluteMatrix = new Cut.Matrix();
    this.reset();
};

Cut.Pin.prototype.reset = function() {
    this._textureAlpha = 1;
    this._alpha = 1;
    this._width = 0;
    this._height = 0;
    this._scaleX = 1;
    this._scaleY = 1;
    this._skewX = 0;
    this._skewY = 0;
    this._rotation = 0;
    // scale/skew/rotate center
    this._pivoted = false;
    this._pivotX = null;
    this._pivotY = null;
    // self pin point
    this._handled = false;
    this._handleX = 0;
    this._handleY = 0;
    // parent pin point
    this._aligned = false;
    this._alignX = 0;
    this._alignY = 0;
    // as seen by parent px
    this._offsetX = 0;
    this._offsetY = 0;
    this._boxX = 0;
    this._boxY = 0;
    this._boxWidth = this._width;
    this._boxHeight = this._height;
    this._ts_translate = Cut._TS++;
    this._ts_transform = Cut._TS++;
    this._ts_matrix = Cut._TS++;
};

Cut.Pin.prototype.tick = function() {
    this._parent = this._owner._parent && this._owner._parent._pin;
    if (this._handled && this._mo_handle != this._ts_transform) {
        this._mo_handle = this._ts_transform;
        this._ts_translate = Cut._TS++;
    }
    if (this._aligned && this._parent && this._mo_align != this._parent._ts_transform) {
        this._mo_align = this._parent._ts_transform;
        this._ts_translate = Cut._TS++;
    }
    return this;
};

Cut.Pin.prototype.toString = function() {
    return this._owner.id() + " (" + (this._parent ? this._parent._owner.id() : null) + ")";
};

Cut.Pin.prototype.absoluteMatrix = function() {
    var ts = Math.max(this._ts_transform, this._ts_translate, this._parent ? this._parent._ts_matrix : 0);
    if (this._mo_abs == ts) {
        return this._absoluteMatrix;
    }
    this._mo_abs = ts;
    var abs = this._absoluteMatrix;
    abs.copyFrom(this.relativeMatrix());
    this._parent && abs.concat(this._parent._absoluteMatrix);
    this._ts_matrix = Cut._TS++;
    return abs;
};

Cut.Pin.prototype.relativeMatrix = function() {
    var ts = Math.max(this._ts_transform, this._ts_translate, this._parent ? this._parent._ts_transform : 0);
    if (this._mo_rel == ts) {
        return this._relativeMatrix;
    }
    this._mo_rel = ts;
    var rel = this._relativeMatrix;
    rel.identity();
    if (this._pivoted) {
        rel.translate(-this._pivotX * this._width, -this._pivotY * this._height);
    }
    rel.scale(this._scaleX, this._scaleY);
    rel.skew(this._skewX, this._skewY);
    rel.rotate(this._rotation);
    if (this._pivoted) {
        rel.translate(this._pivotX * this._width, this._pivotY * this._height);
    }
    if (this._pivoted) {
        // set handle on origin
        this._boxX = 0;
        this._boxY = 0;
        this._boxWidth = this._width;
        this._boxHeight = this._height;
    } else {
        // set handle on aabb
        var p, q, m = rel;
        if (m.a > 0 && m.c > 0 || m.a < 0 && m.c < 0) {
            p = 0, q = m.a * this._width + m.c * this._height;
        } else {
            p = m.a * this._width, q = m.c * this._height;
        }
        if (p > q) {
            this._boxX = q;
            this._boxWidth = p - q;
        } else {
            this._boxX = p;
            this._boxWidth = q - p;
        }
        if (m.b > 0 && m.d > 0 || m.b < 0 && m.d < 0) {
            p = 0, q = m.b * this._width + m.d * this._height;
        } else {
            p = m.b * this._width, q = m.d * this._height;
        }
        if (p > q) {
            this._boxY = q;
            this._boxHeight = p - q;
        } else {
            this._boxY = p;
            this._boxHeight = q - p;
        }
    }
    this._x = this._offsetX;
    this._y = this._offsetY;
    this._x -= this._boxX + this._handleX * this._boxWidth;
    this._y -= this._boxY + this._handleY * this._boxHeight;
    if (this._aligned && this._parent) {
        this._parent.relativeMatrix();
        this._x += this._alignX * this._parent._width;
        this._y += this._alignY * this._parent._height;
    }
    rel.translate(this._x, this._y);
    return this._relativeMatrix;
};

Cut.Pin.prototype.get = function(a) {
    return Cut.Pin._get(this, a);
};

// TODO: Use get/set or defineProperty instead?
Cut.Pin.prototype.set = function(a, b) {
    if (typeof a === "string") {
        Cut.Pin._set(this, a, b);
    } else if (typeof a === "object") {
        for (b in a) Cut.Pin._set(this, b, a[b], a);
    }
    if (this._owner) {
        this._owner._ts_pin = Cut._TS++;
        this._owner.touch();
    }
    return this;
};

Cut.Pin._get = function(pin, key) {
    if (typeof (key = Cut.Pin._getters[key]) !== "undefined") {
        return key.call(Cut.Pin._getters, pin);
    }
};

Cut.Pin._set = function(pin, key, value, all) {
    if (typeof (key = Cut.Pin._setters[key]) !== "undefined" && typeof value !== "undefined") {
        key.call(Cut.Pin._setters, pin, value, all);
    }
};

Cut.Pin._getters = {
    alpha: function(pin) {
        return pin._alpha;
    },
    textureAlpha: function(pin) {
        return pin._textureAlpha;
    },
    width: function(pin) {
        return pin._width;
    },
    height: function(pin) {
        return pin._height;
    },
    // scale : function(pin) {
    // },
    scaleX: function(pin) {
        return pin._scaleX;
    },
    scaleY: function(pin) {
        return pin._scaleY;
    },
    // skew : function(pin) {
    // },
    skewX: function(pin) {
        return pin._skewX;
    },
    skewY: function(pin) {
        return pin._skewY;
    },
    rotation: function(pin) {
        return pin._rotation;
    },
    // pivot : function(pin) {
    // },
    pivotX: function(pin) {
        return pin._pivotX;
    },
    pivotY: function(pin) {
        return pin._pivotY;
    },
    // offset : function(pin) {
    // },
    offsetX: function(pin) {
        return pin._offsetX;
    },
    offsetY: function(pin) {
        return pin._offsetY;
    },
    // align : function(pin) {
    // },
    alignX: function(pin) {
        return pin._alignX;
    },
    alignY: function(pin) {
        return pin._alignY;
    },
    // handle : function(pin) {
    // },
    handleX: function(pin) {
        return pin._handleX;
    },
    handleY: function(pin) {
        return pin._handleY;
    }
};

Cut.Pin._setters = {
    alpha: function(pin, value) {
        pin._alpha = value;
    },
    textureAlpha: function(pin, value) {
        pin._textureAlpha = value;
    },
    width: function(pin, value) {
        pin._width_ = value;
        pin._width = value;
        pin._ts_transform = Cut._TS++;
    },
    height: function(pin, value) {
        pin._height_ = value;
        pin._height = value;
        pin._ts_transform = Cut._TS++;
    },
    scale: function(pin, value) {
        pin._scaleX = value;
        pin._scaleY = value;
        pin._ts_transform = Cut._TS++;
    },
    scaleX: function(pin, value) {
        pin._scaleX = value;
        pin._ts_transform = Cut._TS++;
    },
    scaleY: function(pin, value) {
        pin._scaleY = value;
        pin._ts_transform = Cut._TS++;
    },
    skew: function(pin, value) {
        pin._skewX = value;
        pin._skewY = value;
        pin._ts_transform = Cut._TS++;
    },
    skewX: function(pin, value) {
        pin._skewX = value;
        pin._ts_transform = Cut._TS++;
    },
    skewY: function(pin, value) {
        pin._skewY = value;
        pin._ts_transform = Cut._TS++;
    },
    rotation: function(pin, value) {
        pin._rotation = value;
        pin._ts_transform = Cut._TS++;
    },
    pivot: function(pin, value) {
        pin._pivotX = value;
        pin._pivotY = value;
        pin._pivoted = true;
        pin._ts_transform = Cut._TS++;
    },
    pivotX: function(pin, value) {
        pin._pivotX = value;
        pin._pivoted = true;
        pin._ts_transform = Cut._TS++;
    },
    pivotY: function(pin, value) {
        pin._pivotY = value;
        pin._pivoted = true;
        pin._ts_transform = Cut._TS++;
    },
    offset: function(pin, value) {
        pin._offsetX = value;
        pin._offsetY = value;
        pin._ts_translate = Cut._TS++;
    },
    offsetX: function(pin, value) {
        pin._offsetX = value;
        pin._ts_translate = Cut._TS++;
    },
    offsetY: function(pin, value) {
        pin._offsetY = value;
        pin._ts_translate = Cut._TS++;
    },
    align: function(pin, value) {
        this.alignX(pin, value);
        this.alignY(pin, value);
    },
    alignX: function(pin, value) {
        pin._alignX = value;
        pin._aligned = true;
        pin._ts_translate = Cut._TS++;
        this.handleX(pin, value);
    },
    alignY: function(pin, value) {
        pin._alignY = value;
        pin._aligned = true;
        pin._ts_translate = Cut._TS++;
        this.handleY(pin, value);
    },
    handle: function(pin, value) {
        this.handleX(pin, value);
        this.handleY(pin, value);
    },
    handleX: function(pin, value) {
        pin._handleX = value;
        pin._handled = true;
        pin._ts_translate = Cut._TS++;
    },
    handleY: function(pin, value) {
        pin._handleY = value;
        pin._handled = true;
        pin._ts_translate = Cut._TS++;
    },
    resizeMode: function(pin, value, all) {
        if (all) {
            if (value == "in") {
                value = "in-pad";
            } else if (value == "out") {
                value = "out-crop";
            }
            pin._scaleTo(all.resizeWidth, all.resizeHeight, value);
        }
    },
    resizeWidth: function(pin, value, all) {
        if (!all || !all.resizeMode) {
            pin._scaleTo(value, null);
        }
    },
    resizeHeight: function(pin, value, all) {
        if (!all || !all.resizeMode) {
            pin._scaleTo(null, value);
        }
    },
    scaleMode: function(pin, value, all) {
        if (all) {
            pin._scaleTo(all.scaleWidth, all.scaleHeight, value);
        }
    },
    scaleWidth: function(pin, value, all) {
        if (!all || !all.scaleMode) {
            pin._scaleTo(value, null);
        }
    },
    scaleHeight: function(pin, value, all) {
        if (!all || !all.scaleMode) {
            pin._scaleTo(null, value);
        }
    },
    matrix: function(pin, value) {
        this.scaleX(pin, value.a);
        this.skewX(pin, value.c / value.d);
        this.skewY(pin, value.b / value.a);
        this.scaleY(pin, value.d);
        this.offsetX(pin, value.e);
        this.offsetY(pin, value.f);
        this.rotation(pin, 0);
    }
};

Cut.Pin.prototype._scaleTo = function(width, height, mode) {
    var w = typeof width === "number";
    var h = typeof height === "number";
    var m = typeof mode === "string";
    var pin = this;
    pin._ts_transform = Cut._TS++;
    if (w) {
        pin._scaleX = width / pin._width_;
        pin._width = pin._width_;
    }
    if (h) {
        pin._scaleY = height / pin._height_;
        pin._height = pin._height_;
    }
    if (w && h && m) {
        if (mode == "out" || mode == "out-crop") {
            pin._scaleX = pin._scaleY = Math.max(pin._scaleX, pin._scaleY);
        } else if (mode == "in" || mode == "in-pad") {
            pin._scaleX = pin._scaleY = Math.min(pin._scaleX, pin._scaleY);
        }
        if (mode == "out-crop" || mode == "in-pad") {
            pin._width = width / pin._scaleX;
            pin._height = height / pin._scaleY;
        }
    }
};

Cut.Matrix = function(a, b, c, d, e, f) {
    this.changed = true;
    this.a = a || 1;
    this.b = b || 0;
    this.c = c || 0;
    this.d = d || 1;
    this.e = e || 0;
    this.f = f || 0;
};

Cut.Matrix.prototype.toString = function() {
    return "[" + this.a + ", " + this.b + ", " + this.c + ", " + this.d + ", " + this.e + ", " + this.f + "]";
};

Cut.Matrix.prototype.clone = function() {
    return new Cut.Matrix(this.a, this.b, this.c, this.d, this.e, this.f);
};

Cut.Matrix.prototype.copyTo = function(m) {
    m.copyFrom(this);
    return this;
};

Cut.Matrix.prototype.copyFrom = function(m) {
    this.changed = true;
    this.a = m.a;
    this.b = m.b;
    this.c = m.c;
    this.d = m.d;
    this.e = m.e;
    this.f = m.f;
    return this;
};

Cut.Matrix.prototype.identity = function() {
    this.changed = true;
    this.a = 1;
    this.b = 0;
    this.c = 0;
    this.d = 1;
    this.e = 0;
    this.f = 0;
    return this;
};

Cut.Matrix.prototype.rotate = function(angle) {
    if (!angle) {
        return this;
    }
    this.changed = true;
    var u = angle ? Math.cos(angle) : 1;
    // android bug may give bad 0 values
    var v = angle ? Math.sin(angle) : 0;
    var a = u * this.a - v * this.b;
    var b = u * this.b + v * this.a;
    var c = u * this.c - v * this.d;
    var d = u * this.d + v * this.c;
    var e = u * this.e - v * this.f;
    var f = u * this.f + v * this.e;
    this.a = a;
    this.b = b;
    this.c = c;
    this.d = d;
    this.e = e;
    this.f = f;
    return this;
};

Cut.Matrix.prototype.translate = function(x, y) {
    if (!x && !y) {
        return this;
    }
    this.changed = true;
    this.e += x;
    this.f += y;
    return this;
};

Cut.Matrix.prototype.scale = function(x, y) {
    if (!(x - 1) && !(y - 1)) {
        return this;
    }
    this.changed = true;
    this.a *= x;
    this.b *= y;
    this.c *= x;
    this.d *= y;
    this.e *= x;
    this.f *= y;
    return this;
};

Cut.Matrix.prototype.skew = function(x, y) {
    if (!x && !y) {
        return this;
    }
    this.changed = true;
    var a = this.a + this.b * x;
    var b = this.b + this.a * y;
    var c = this.c + this.d * x;
    var d = this.d + this.c * y;
    var e = this.e + this.f * x;
    var f = this.f + this.e * y;
    this.a = a;
    this.b = b;
    this.c = c;
    this.d = d;
    this.e = e;
    this.f = f;
    return this;
};

Cut.Matrix.prototype.concat = function(m) {
    this.changed = true;
    var n = this;
    var a = n.a * m.a + n.b * m.c;
    var b = n.b * m.d + n.a * m.b;
    var c = n.c * m.a + n.d * m.c;
    var d = n.d * m.d + n.c * m.b;
    var e = n.e * m.a + m.e + n.f * m.c;
    var f = n.f * m.d + m.f + n.e * m.b;
    this.a = a;
    this.b = b;
    this.c = c;
    this.d = d;
    this.e = e;
    this.f = f;
    return this;
};

Cut.Matrix.prototype.reverse = function() {
    if (this.changed) {
        this.changed = false;
        this.reversed = this.reversed || new Cut.Matrix();
        var z = this.a * this.d - this.b * this.c;
        this.reversed.a = this.d / z;
        this.reversed.b = -this.b / z;
        this.reversed.c = -this.c / z;
        this.reversed.d = this.a / z;
        this.reversed.e = (this.c * this.f - this.e * this.d) / z;
        this.reversed.f = (this.e * this.b - this.a * this.f) / z;
    }
    return this.reversed;
};

Cut.Matrix.prototype.map = function(p, q) {
    q = q || {};
    q.x = this.a * p.x + this.c * p.y + this.e;
    q.y = this.b * p.x + this.d * p.y + this.f;
    return q;
};

Cut.Matrix.prototype.mapX = function(x, y) {
    return this.a * x + this.c * y + this.e;
};

Cut.Matrix.prototype.mapY = function(x, y) {
    return this.b * x + this.d * y + this.f;
};

Cut.Math = {};

Cut.Math.random = function(min, max) {
    if (typeof min === "undefined") {
        max = 1, min = 0;
    } else if (typeof max === "undefined") {
        max = min, min = 0;
    }
    return min == max ? min : Math.random() * (max - min) + min;
};

Cut.Math.rotate = function(num, min, max) {
    if (typeof min === "undefined") {
        max = 1, min = 0;
    } else if (typeof max === "undefined") {
        max = min, min = 0;
    }
    if (max > min) {
        num = (num - min) % (max - min);
        return num + (num < 0 ? max : min);
    } else {
        num = (num - max) % (min - max);
        return num + (num <= 0 ? min : max);
    }
};

Cut.Math.length = function(x, y) {
    return Math.sqrt(x * x + y * y);
};

module.exports = Cut;

},{}],3:[function(require,module,exports){
if (typeof DEBUG === "undefined") DEBUG = true;

function Easing(token) {
    if (typeof token === "function") {
        return token;
    }
    if (typeof token !== "string") {
        return Easing._identity;
    }
    var fn = Easing._cache[token];
    if (fn) {
        return fn;
    }
    var match = /^(\w+)(-(in|out|in-out|out-in))?(\((.*)\))?$/i.exec(token);
    if (!match || !match.length) {
        return Easing._identity;
    }
    easing = Easing._easings[match[1]];
    mode = Easing._modes[match[3]];
    params = match[5];
    if (easing && easing.fn) {
        fn = easing.fn;
    } else if (easing && easing.fc) {
        fn = easing.fc.apply(easing.fc, params && params.replace(/\s+/, "").split(","));
    } else {
        fn = Easing._identity;
    }
    if (mode) {
        fn = mode.fn(fn);
    }
    // TODO: It can be a memory leak with different `params`.
    Easing._cache[token] = fn;
    return fn;
}

Easing._identity = function(x) {
    return x;
};

Easing._cache = {};

Easing._modes = {};

Easing._easings = {};

Easing.add = function(data) {
    var names = (data.name || data.mode).split(/\s+/);
    for (var i = 0; i < names.length; i++) {
        var name = names[i];
        if (name) {
            (data.name ? Easing._easings : Easing._modes)[name] = data;
        }
    }
};

Easing.add({
    mode: "in",
    fn: function(f) {
        return f;
    }
});

Easing.add({
    mode: "out",
    fn: function(f) {
        return function(t) {
            return 1 - f(1 - t);
        };
    }
});

Easing.add({
    mode: "in-out",
    fn: function(f) {
        return function(t) {
            return t < .5 ? f(2 * t) / 2 : 1 - f(2 * (1 - t)) / 2;
        };
    }
});

Easing.add({
    mode: "out-in",
    fn: function(f) {
        return function(t) {
            return t < .5 ? 1 - f(2 * (1 - t)) / 2 : f(2 * t) / 2;
        };
    }
});

Easing.add({
    name: "linear",
    fn: function(t) {
        return t;
    }
});

Easing.add({
    name: "quad",
    fn: function(t) {
        return t * t;
    }
});

Easing.add({
    name: "cubic",
    fn: function(t) {
        return t * t * t;
    }
});

Easing.add({
    name: "quart",
    fn: function(t) {
        return t * t * t * t;
    }
});

Easing.add({
    name: "quint",
    fn: function(t) {
        return t * t * t * t * t;
    }
});

Easing.add({
    name: "sin sine",
    fn: function(t) {
        return 1 - Math.cos(t * Math.PI / 2);
    }
});

Easing.add({
    name: "exp",
    fn: function(t) {
        return t == 0 ? 0 : Math.pow(2, 10 * (t - 1));
    }
});

Easing.add({
    name: "circle circ",
    fn: function(t) {
        return 1 - Math.sqrt(1 - t * t);
    }
});

Easing.add({
    name: "bounce",
    fn: function(t) {
        return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;
    }
});

Easing.add({
    name: "poly",
    fc: function(e) {
        return function(t) {
            return Math.pow(t, e);
        };
    }
});

Easing.add({
    name: "elastic",
    fc: function(a, p) {
        p = p || .45;
        a = a || 1;
        var s = p / (2 * Math.PI) * Math.asin(1 / a);
        return function(t) {
            return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * (2 * Math.PI) / p);
        };
    }
});

Easing.add({
    name: "back",
    fc: function(s) {
        s = typeof s !== "undefined" ? s : 1.70158;
        return function(t) {
            return t * t * ((s + 1) * t - s);
        };
    }
});

module.exports = Easing;

},{}],4:[function(require,module,exports){
var Cut = require("./core");

if (typeof DEBUG === "undefined") DEBUG = true;

/**
 * Default loader for web.
 */
window.addEventListener("load", function() {
    DEBUG && console.log("On load.");
    Cut.start({
        "app-loader": AppLoader,
        "image-loader": ImageLoader
    });
}, false);

function AppLoader(app, configs) {
    configs = configs || {};
    var canvas = configs.canvas, context = null, full = false;
    var width = 0, height = 0, ratio = 1;
    if (typeof canvas === "string") {
        canvas = document.getElementById(canvas);
    }
    if (!canvas) {
        canvas = document.getElementById("cutjs");
    }
    if (!canvas) {
        full = true;
        DEBUG && console.log("Creating element...");
        canvas = document.createElement("canvas");
        canvas.style.position = "absolute";
        var body = document.body;
        body.insertBefore(canvas, body.firstChild);
    }
    context = canvas.getContext("2d");
    var devicePixelRatio = window.devicePixelRatio || 1;
    var backingStoreRatio = context.webkitBackingStorePixelRatio || context.mozBackingStorePixelRatio || context.msBackingStorePixelRatio || context.oBackingStorePixelRatio || context.backingStorePixelRatio || 1;
    ratio = devicePixelRatio / backingStoreRatio;
    var requestAnimationFrame = window.requestAnimationFrame || window.msRequestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.oRequestAnimationFrame || function(callback) {
        return window.setTimeout(callback, 1e3 / 60);
    };
    DEBUG && console.log("Creating root...");
    var root = new Cut.Root(requestAnimationFrame, render);
    function render() {
        context.setTransform(1, 0, 0, 1, 0, 0);
        context.clearRect(0, 0, width, height);
        root.render(context);
    }
    app(root, canvas);
    resize();
    window.addEventListener("resize", resize, false);
    window.addEventListener("orientationchange", resize, false);
    function resize() {
        if (full) {
            width = window.innerWidth > 0 ? window.innerWidth : screen.width;
            height = window.innerHeight > 0 ? window.innerHeight : screen.height;
            canvas.style.width = width + "px";
            canvas.style.height = height + "px";
        } else {
            width = canvas.clientWidth;
            height = canvas.clientHeight;
        }
        width *= ratio;
        height *= ratio;
        if (canvas.width === width && canvas.height === height) {
            return;
        }
        canvas.width = width;
        canvas.height = height;
        DEBUG && console.log("Resize: " + width + " x " + height + " / " + ratio);
        root.viewport(width, height, ratio);
        render();
    }
}

function ImageLoader(src, handleComplete, handleError) {
    var image = new Image();
    DEBUG && console.log("Loading image: " + src);
    image.onload = handleComplete;
    image.onerror = handleError;
    image.src = src;
    return image;
}

},{"./core":2}],5:[function(require,module,exports){
var Cut = require("./core");

var Tween = require("./tween");

var Easing = require("./easing");

Cut.prototype.tween = function(duration, delay) {
    if (!this._tween) {
        this._tween = new Tween(this);
    }
    return this._tween.tween(duration, delay);
};

Tween.prototype.ease = function(easing) {
    this._next.easing = Easing(easing);
    return this;
};

module.exports = Cut;

module.exports.Tween = Tween;

module.exports.Easing = Easing;

},{"./core":2,"./easing":3,"./tween":7}],6:[function(require,module,exports){
if (typeof DEBUG === "undefined") DEBUG = true;

function Mouse() {
    Mouse.subscribe.apply(Mouse, arguments);
}

Mouse.CLICK = "click";

Mouse.START = "touchstart mousedown";

Mouse.MOVE = "touchmove mousemove";

Mouse.END = "touchend mouseup";

Mouse.CANCEL = "touchcancel";

Mouse.subscribe = function(root, elem) {
    var visitor = null, data = {}, abs = null, rel = null, clicked = [];
    elem = elem || document;
    // click events are synthesized from start/end events on same nodes
    // elem.addEventListener('click', handleClick);
    // with 'if' mouse doesn't work on touch screen
    // without 'if' two events on Android?
    // if ('ontouchstart' in window) {
    elem.addEventListener("touchstart", handleStart);
    elem.addEventListener("touchend", handleEnd);
    elem.addEventListener("touchmove", handleMove);
    elem.addEventListener("touchcancel", handleCancel);
    // } else {
    elem.addEventListener("mousedown", handleStart);
    elem.addEventListener("mouseup", handleEnd);
    elem.addEventListener("mousemove", handleMove);
    // }
    function handleStart(event) {
        Mouse._xy(root, elem, event, abs);
        DEBUG && console.log("Mouse Start: " + event.type + " " + abs);
        event.preventDefault();
        publish(event.type, event);
        findClicks();
    }
    function handleEnd(event) {
        // New xy is not valid/available, last xy is used instead.
        DEBUG && console.log("Mouse End: " + event.type + " " + abs);
        event.preventDefault();
        publish(event.type, event);
        if (clicked.length) {
            DEBUG && console.log("Mouse Click: " + clicked.length);
            fireClicks(event);
        }
    }
    function handleCancel(event) {
        DEBUG && console.log("Mouse Cancel: " + event.type);
        event.preventDefault();
        publish(event.type, event);
    }
    function handleMove(event) {
        Mouse._xy(root, elem, event, abs);
        // DEBUG && console.log('Mouse Move: ' + event.type + ' ' +
        // abs);
        if (!root._flag(event.type)) {
            return;
        }
        event.preventDefault();
        publish(event.type, event);
    }
    function findClicks() {
        while (clicked.length) {
            clicked.pop();
        }
        publish("click", null, clicked);
    }
    function fireClicks(event) {
        data.event = event;
        data.type = "click";
        data.root = root;
        data.collect = false;
        var cancel = false;
        while (clicked.length) {
            var cut = clicked.shift();
            if (cancel) {
                continue;
            }
            cancel = visitor.end(cut, data) ? true : cancel;
        }
    }
    function publish(type, event, collect) {
        rel.x = abs.x;
        rel.y = abs.y;
        data.event = event;
        data.type = type;
        data.root = /* root._capture || */ root;
        data.collect = collect;
        data.root.visit(visitor, data);
    }
    visitor = {
        reverse: true,
        visible: true,
        start: function(cut, data) {
            return !cut._flag(data.type);
        },
        end: function(cut, data) {
            // data: event, type, root, collect
            rel.raw = data.event;
            rel.type = data.type;
            var listeners = cut.listeners(data.type);
            if (!listeners) {
                return;
            }
            cut.matrix().reverse().map(abs, rel);
            if (!(cut === data.root || cut.attr("spy") || Mouse._isInside(cut, rel))) {
                return;
            }
            if (data.collect) {
                data.collect.push(cut);
                return;
            }
            var cancel = false;
            for (var l = 0; l < listeners.length; l++) {
                cancel = listeners[l].call(cut, rel) ? true : cancel;
            }
            return cancel;
        }
    };
    abs = {
        x: 0,
        y: 0,
        toString: function() {
            return (this.x | 0) + "x" + (this.y | 0);
        }
    };
    rel = {
        x: 0,
        y: 0,
        toString: function() {
            return abs + " / " + (this.x | 0) + "x" + (this.y | 0);
        }
    };
};

Mouse._isInside = function(cut, point) {
    return point.x >= 0 && point.x <= cut._pin._width && point.y >= 0 && point.y <= cut._pin._height;
};

Mouse._xy = function(root, elem, event, point) {
    var isTouch = false;
    // touch screen events
    if (event.touches) {
        if (event.touches.length) {
            isTouch = true;
            point.x = event.touches[0].pageX;
            point.y = event.touches[0].pageY;
        } else {
            return;
        }
    } else {
        // mouse events
        point.x = event.clientX;
        point.y = event.clientY;
        // See http://goo.gl/JuVnF2
        if (document.body.scrollLeft || document.body.scrollTop) {} else if (document.documentElement) {
            point.x += document.documentElement.scrollLeft;
            point.y += document.documentElement.scrollTop;
        }
    }
    // accounts for border
    point.x -= elem.clientLeft || 0;
    point.y -= elem.clientTop || 0;
    var par = elem;
    while (par) {
        point.x -= par.offsetLeft || 0;
        point.y -= par.offsetTop || 0;
        if (!isTouch) {
            // touch events offset scrolling with pageX/Y
            // so scroll offset not needed for them
            point.x += par.scrollLeft || 0;
            point.y += par.scrollTop || 0;
        }
        par = par.offsetParent;
    }
    point.x *= root.viewport().ratio || 1;
    point.y *= root.viewport().ratio || 1;
};

module.exports = Mouse;

},{}],7:[function(require,module,exports){
if (typeof DEBUG === "undefined") DEBUG = true;

// TODO: reuse head.start/keys/end
function Tween(cut) {
    var tween = this;
    this._owner = cut;
    this._queue = [];
    this._next = null;
    var lastTime = 0;
    cut.tick(function(elapsed, now, last) {
        if (!tween._queue.length) {
            return;
        }
        // ignore old elapsed
        var ignore = lastTime != last;
        lastTime = now;
        this.touch();
        if (ignore) {
            return;
        }
        var head = tween._queue[0];
        if (!head.time) {
            head.time = 1;
        } else {
            head.time += elapsed;
        }
        if (head.time < head.delay) {
            return;
        }
        if (!head.start) {
            head.start = {};
            head.keys = {};
            for (var key in head.end) {
                if (typeof (start = cut.pin(key)) === "number") {
                    head.start[key] = start;
                    head.keys[key] = key;
                } else if (typeof (startX = cut.pin(key + "X")) === "number" && typeof (startY = cut.pin(key + "Y")) === "number") {
                    head.start[key + "X"] = startX;
                    head.keys[key + "X"] = key;
                    head.start[key + "Y"] = startY;
                    head.keys[key + "Y"] = key;
                }
            }
        }
        var p = (head.time - head.delay) / head.duration;
        var over = p >= 1;
        p = p > 1 ? 1 : p;
        p = typeof head.easing == "function" ? head.easing(p) : p;
        var q = 1 - p;
        for (var key in head.keys) {
            cut.pin(key, head.start[key] * q + head.end[head.keys[key]] * p);
        }
        if (over) {
            tween._queue.shift();
            head.then && head.then.call(cut);
        }
    }, true);
}

Tween.prototype.tween = function(duration, delay) {
    this._next = {
        id: Cut._TS++,
        end: {},
        duration: duration || 400,
        delay: delay || 0
    };
    return this;
};

Tween.prototype.pin = function(a, b) {
    if (this._next !== this._queue[this._queue.length - 1]) {
        this._owner.touch();
        this._queue.push(this._next);
    }
    var end = this._next.end;
    if (typeof a === "object") {
        for (var attr in a) {
            end[attr] = a[attr];
        }
    } else if (typeof b !== "undefined") {
        end[a] = b;
    }
    return this;
};

Tween.prototype.clear = function(forward) {
    var tween;
    while (tween = this._queue.shift()) {
        forward && this._owner.pin(tween.end);
    }
    return this;
};

Tween.prototype.then = function(then) {
    this._next.then = then;
    return this;
};

Tween.prototype.ease = function(easing) {
    this._next.easing = easing;
    return this;
};

module.exports = Tween;

},{}]},{},[1])(1)
});


text:
Crown Prince Haakon's 18th Birthday, 1991
July 20, 2018 July 17, 2018 ~ Saad719
Crown Prince Haakon of Norway's 18th Birthday Banquet and Ball at the Royal Palace of Oslo on this day in 1991. Royal attendees included King Harald (wearing the Order of St Olav) and Queen Sonja (in the Emerald Parure Tiara and the Order of St Olav) of Norway, Princess Martha Louise (wearing King Olav's Gift Tiara and the Order of St Olav), Princess Astrid (in Queen Alexandra's Turquoise Circlet and the Order of St Olav), Princess Ragnhild (wearing the Boucheron Pearl Tiara the Order of St Olav), Queen Margrethe (in the Floral Aigrette Tiara and the Order of St Olav), Prince Henrik (wearing the Order of St Olav), Crown Prince Frederik (in the Order of St Olav), and Prince Joachim (wearing the Order of the Elephant) of Denmark, King Constantine (wearing the Order of St Olav), Queen Anne Marie (in the Ruby Parure Tiara and the Order of the Redeemer), and Crown Prince Pavlos (wearing the Order of the Redeemer) of Greece, King Carl Gustaf (wearing the Order of St Olav) and Queen Silvia (in the Napoleonic Amethyst Tiara and the Order of St Olav) of Sweden, Grand Duke Jean (wearing the Order of St Olav), Grand Duchess Josephine Charlotte (in the Emerald Art Deco Tiara and the Order of St Olav), and Prince Guillaume (wearing the Order of the Gold Lion of the House of Nassau) of Luxembourg, and the Earl of Wessex (in the Royal Victorian Order).
Posted in Flashback
< Previous Wedding of Lady Rose Gilman, 2008
Next > Prince and Patron at Buckingham Palace

redpajama_set_name: RedPajamaCommonCrawl


CeCe started her career in the oil and gas industry in 1975 with Texaco in New Orleans; progressing through the administrative ranks to end her 20 year career at Texaco in 1995 as Assistant to the Vice President.
Meg Chase joined the LOGA team in 2018 and brings more than 25 years of experience in areas of public relations, marketing and event coordinating to her role as Director of Marketing and Membership Development.
A native of New Roads, LA and a proud LSU Alum, Jordan began his political career as Press Assistant in Governor Jindal's Administration, later going on to serve as the Governor's Deputy Director of Legislative Affairs, operating as the House liaison for the executive office.
Tiffany was born and raised in Gretna, Louisiana and is a graduate of The University of New Orleans.
Don was the founder of LIOGA (Louisiana Independent Oil & Gas Association) which later became LOGA. Don served as the President of LIOGA and later LOGA for over 26 years. Upon his retirement in 2018, the LOGA Board of Directors granted him the title of President-Emeritus.
A Floridian by birth and a Louisianan by luck, Kati Hyer is a proud team member of LOGA, spearheading the organization's social and digital media strategy and engaging with our members and the public on the backbone issue of our state: our oil and gas industry.
Priscilla started her career in banking in 1993 before taking time off to raise a family. After returning to the workforce in the banking industry, she then branched out into the title business where she advanced to Notarial Secretary.


text:
Malaysia's Economic Affairs Minister Azmin Ali slams allegations of his involvement in sex video scandal; politicians and netizens reject "gutter politics"
by Danisha Hakeem
in Malaysia, Politics
Source: Abdul Razak Latif/Kosmo!
Malaysia's Economic Affairs Minister Azmin Ali has vehemently denied the allegations surrounding his purported involvement in a sex video scandal, dismissing it as "a nefarious plot" to "assassinate" his "reputation and character" in a bid to damage his "political career".
In an official statement on Wed (12 Jun), he added that "this is clearly the latest in a series of concerted attempts over the past few months to vilify me, which includes intimidation against the safety of my family and me in the final week of Ramadan, and vile and baseless accusations of corruption" based on "recent political developments".
"I utterly condemn this brand of gutter politics. It has no place in this era of New Malaysia, where we are working to rebuild the nation through institutional reforms," said Azmin.
The Economic Affairs Minister also said that he has instructed his lawyers "to take the appropriate legal action against the individual who made these abominable allegations as well as against other perpetrators".
"I will avail myself of all legal means at my disposal to expose these culprits," he stressed, adding that he "will not submit to these cowardly acts and heinous attempts to distract the public from the pressing concerns of the nation and the successes of the Economic Affairs Ministry in the planning and implementation of national development policies that are sustainable and inclusive".
"I trust the police and the Malaysian Anti-Corruption Commission will take all necessary action with regards to this matter," concluded Azmin.
Azmin's statement came shortly after 27-year-old Muhammad Haziq Abdul Aziz released a video alleging that he was involved in a sex video with the Economic Affairs Minister.
"I, Haziq Aziz, (am) making a sworn confession that I am the individual with (the minister) in the video which went viral yesterday.
"The video was taken without my permission on May 11 during the Sandakan by-election in (his) room at Hotel Four Points," Haziq is seen as saying in the confessional video, which was posted on his Facebook page on Wed morning (12 Jun).
He also alleged that Azmin is "not an individual who is qualified to be a leader", adding that the Malaysian Anti-Corruption Commission (MACC) should "investigate (him) for corruption".
A close friend of Haziq had revealed screenshots of his WhatsApp conversation with Haziq, in which the latter reportedly said that he is "just a victim of the situation."
Haziq, who is currently the private secretary to the Deputy Primary Industries and Commodities Minister Shamsul Iskandar Mohd Akin, had initially denied his involvement in the videos, as reported by The Star Online.
Politics "about finding ways to forward the interest of our nation collectively, not about sex, sex, sex, and more sex": Malaysia's Youth and Sports Minister Syed Saddiq Abdul Rahman
Malay Mail reported Youth and Sports Minister Syed Saddiq Abdul Rahman as saying on the same day that such scandals involving sex videos are the reason why "some youth are saying that politics is despicable and choose to stay far, far away from it".
The Pakatan Harapan Youth Chief told reporters at a Parti Pribumi Bersatu Malaysia (PPBM) dinner event in Shah Alam yesterday that "especially for young people, politics should be about the battle of ideals, ideas, and principles".
"It is about finding ways to forward the interest of our nation collectively, not about sex, sex, sex, and more sex.
"I believe when I speak this also stands in the aspiration of a lot of young people as well," said the Member of Parliament for Muar.
He also confirmed that he was added into a WhatsApp group called "Jemputan Raya Azmin Ali" ("Azmin Ali's Raya Invitation") in which videos and images of sex allegedly involving Azmin were posted, and said that the parties who had disseminated the material could not have "hit any lower than that."
"I was looking through it they got phone numbers of almost all the ministers, politicians, political secretaries… I have no idea how even I don't have their numbers.
"Evidently the individual or the group behind this cannot hit any lower than that but as I mentioned, I think politics in Malaysia should aspire for something much better," he said, adding: "I really thought it was a Raya invitation".
Syed Saddiq also took to Twitter to express his disappointment regarding the "gutter politics" that are still permeating the Malaysian political landscape in the wake of the scandal allegedly involving Azmin:
No proof to suggest internal sabotage behind sex scandal: PKR president Anwar Ibrahim
Parti Keadilan Rakyat president Anwar Ibrahim, who was himself implicated in a similar scandal some 11 years ago, said that there is no evidence to support the theory that the scandal involving the party's deputy president was orchestrated by a member of the party, Malay Mail reported on Wed.
Speaking at an emergency PKR meeting yesterday, Anwar told reporters: "We have no issue with the party … The only thing we considered most is this attack which we condemn.
"Notwithstanding wherever or whatever the source is … We have no evidence to suggest the party is the enemy," he added.
"From the start, we (PKR) and Pakatan Harapan had said we will push against all these disgusting politics and it doesn't matter who the victim is.
"We spoke about how to handle this issue and what statements to make based on the rules and regulations … As for now, that's all we can say about it and we can't say anymore as we do not want to disturb the investigations which are now being conducted by the police and MACC," Anwar told reporters.
The Star Online reported him as saying on Thu (13 Jun) that "PKR reiterates its commitment in rejecting the disgusting gutter politics that we now witness".
"This country needs to focus on economic and social issues and not be dragged into this dishonourable arena.
"PKR hopes Azmin and family will be strong in facing this monumental test," said Anwar.
Malaysian netizens unsurprised by scandal allegedly involving Economic Affairs Minister
Syed Saddiq and Anwar's sentiments appear to be shared by many Malaysian netizens in general, who mostly opined that using sex scandals featuring prominent male politicians with other men as a tactic to pull down political enemies or competitors is a tired and overused one:
One netizen in particular, however, opined that such a scandal ought to be factored into judging whether a politician is credible:
Several netizens specifically questioned Haziq's motive behind releasing the confessional video, given his political history and his eagerness to publicly admit his involvement in the scandal:


text:
Q: If we have an equivalence relation on a class, is it possible to define what it means for the collection of equivalence "to be a set"? My background in set theory is that of a casual acquaintance that I would like to know become friends with (I am not sure set theory feels the same way). For my question, I would like to stay within the hospices of ZFC or something similarly strong (ETCS for instance). I can imagine a situation where we have a class (defined as a logical formula in set theory Let us call it $P$), we can define an equivalence relation on $P$ as follows as a new logical formula, $Q$ such that $$P(x)\wedge P(y)\wedge P(z)\implies \{Q(x,x)\wedge (Q(x,y)\Leftrightarrow Q(y,x))\wedge (Q(x,y)\wedge Q(y,z)\implies Q(x,z))\}.$$
Now I would like to say that "the collection of equivalence classes is a set" (not literally true since a set cannot contain proper classes) if $$\exists S \forall x P(x)\implies \exists s\in S: Q(x,s).$$ My question is "is my definition correct"? So the type of example (simplified a bit) we declare two sets to be equivalent if they are both finite or both infinite. The collection of equivalence classes is of size two, the class of finite sets and the class of infinite sets. But the collection of these two classes is not a set in the literal sense. My interest in this is to be able to phrase the statement " the localization of a category exists". Any references would be welcome.

A: Your definition says, in simple words, that there is a set which is a system of representatives.
Indeed it is true that if a system of representatives forms a set then you can regard the equivalence classes as "small".
Some [possibly] relevant links:

*

*homeomorphism of topological spaces is an equivalence relation ?

*What can I do with proper classes?

redpajama_set_name: RedPajamaStackExchange


Eco Self Storage (ESS) Mobile container's design allows for 12 units to be shipped on one truck to any disaster or emergency location for multi-function use. Able to be quickly assembled in 15 minutes by two men results in more time to do the important emergency work, and less time on construction. Our mobile containers can be deployed for Earthquake, Tsunami, Tornado and any other disaster relief efforts.
ESS Mobile Container's innovative foldable technology allows for 12 units to be loaded onto one truck, maximizing cargo space and saving valuable time in bringing significant resources to the disaster or emergency location at one time. A parachute deployable model is in the testing stages.
Quick assembly in less than 15 minutes by two men with hand tools and a forklift.
Interior is more sanitary than conventional emergency relief solutions and easy to clean.
Elevated floor is above water and mud, providing a waterproof environment.
Sturdy lockable door allows for a secure space suitable for an office, housing, or storage.
Optional windows provide a livable space for temporary housing and other uses and our Expansion Kit allows multiple quantities of our ESS Mobile Containers to be joined together to create larger spaces that are secure and waterproof.
Can be outfitted in unlimited ways to be customized for any application, including adding multiple windows, doors, electric, plumbing and any other customization.
Camouflage or special organizational colors or signage available.
Multi-mission capability in one design, can serve as portable field hospital, command center, classroom, secure storage and temporary housing are a few of the many uses in the ESS Response Mobile Containers.
Quick disassembly in less than 15 minutes allows for rapid deployment at a moment's notice and provides a solution for a multitude of different environments at emergency or disaster relief sites.
The ESS First Response Mobile Containers are extremely durable and have capabilities for multiple missions. Rapid deployment of 12 units on one truck along with quick assembly and disassembly in less than 15 minutes, make ESS First Response Mobile Containers the ultimate solution for saving valuable time in delivering significant infrastructure assets to the emergency and disaster locations.


text:
South Shields, England
First Name Jade#1
Born in South Shields, England#2
Singer Born in England#20
Capricorn Singer#14
English pop singer who became known as a member of the all-girl group Little Mix, which won the eighth season of the The X Factor. Little Mix's debut album, DNA, reached number 3 on the UK charts.
She auditioned for season five of The X Factor in 2008 with The Beatles' song "I Want to Hold Your Hand," but she didn't make it past Bootcamp. She auditioned again in 2010.
She and Little Mix were nominated for the 2012 Glamour Women of the Year Awards for Band of the Year. The won the award in 2014.
She was raised by her parents, James and Norma Thirlwall, and she has a brother named Karl. She dated Sam Craske from the dance crew Diversity from 2013 to 2014, then went on to date Jed Elliott from 2015 to 2019. Rapper Jordan Rizzle Stephens became her boyfriend in 2020.
She listed popstar and singer Cheryl Cole as one of her greatest idols.
Jade Thirlwall Clips
Jade Thirlwall Popularity
Jade Thirlwall Is A Member Of
The X Factor (UK)
Jade Thirlwall Fans Also Viewed
Cheryl Ann Tweedy
Andy Biersack
Photos by PR Photos


text:
Samples that Inspire a Rallying Cry Moment
By Melanie Ofenloch | March 18, 2018 | Blog
As a wine blogger, I get a lot of samples and I am very grateful to have the chance to try the amount of samples I do. But occasionally, there are wines that when I open the box I drop my "professionalism" and I am sure you might hear an involuntarily "whoo hoo" rallying cry. Today I am going to write about a few of those wines that have earned that reaction. Note, several of these are special occasion wines and most of them have a price tag that commands that experience. But, I highly recommend splurging for that special occasion.
NV Champagne Bruno Paillard Première Cuvée
Bruno Pallard's vineyards cover 32 hectares of champagne with more than 100 plots of different terroirs. Of that acreage, 12 hectares of the vineyards are classified as "Grand Cru." The champagnes came from the founder's desire to create a different champagne that blended diverse crus, grape varieties and vintages.
This champagne, which is blended with Pinot Noir (45%), Chardonnay (33%) and Pinot Meunier (22%), tastes of melon, citrus, brioche, peach, almond and a great minerality.
Cornerstone Cellars began in 1991 when Michael Dragutsky wanted to showcase Napa Valley's top mountain and benchland Cabernet Sauvignon vineyards. Today the wines are made by Charles Thomas and Kari Auringer who embody a "vineyard to bottle" approach.
2014 Cornerstone Cellars Napa Valley Cabernet Sauvignon, Benchlands
I tasted blackberry, black cherry, cassis, mocha, licorice, chocolate, Asian spice and blueberry. This was a powerful wine with lots of fruit.
2014 Cornerstone Cellars Napa Valley Cabernet Sauvignon, Calistoga
Same valley, yet such different wines. The same black fruits, but the soil is different and you taste much more of the dry elements. Blackberry, prune, mocha, anise, spice and leather. The difference that volcanic soil can make in a wine.
2014 Don Melchor Cabernet Sauvignon
Don Melchor was Chile's first quintessential and iconic wine. Its list of awards and the amount of times it made the Wine Spectator's Top 100 Wines of the World list (seven times) is long even though the wine has only been made since 1987 when Eduardo Guilisasti, the driving force behind Concha y Toro challenged his winemaker team to produce a wine that would establish Chile as a center for world-class winemaking. Guilisasti's son Rafael and the winery enologist flew to Bordeaux with Concha y Toro Cabernet Sauvignon samples from the Puente Alto vineyard for a meeting with the "Father of Modern Winemaking", Professor Emile Peynaud. Peyanaud was impressed and his business partner Jacques Boissenot was recruited to assist in the final blend. Today, Jacques' son, Eric, continues to work with Enrique Tirado, who is the winemaker for Don Melchor.
The Puente Alto vineyard is located near the Maipo River's oldest alluvial terrace, where the soil is known for its clay, lime, sand, gravel and stone. The vineyard is grouped into seven blocks and 142 parcels that differ individually. Each vintage, Tirado selects a "quilt" of fruit from 50 to 60 parcels, out of the 142, for the Don Melchor wine.
It was an explosion of flavors and aromas. Powerful and elegant. Notes of blackberry, tobacco, black cherry, currant, orange peel, mocha and mint. Definitely would benefit with cellar time, but it was an amazing wine.
2015 Flora Springs Trilogy
Flora Springs is celebrating its 40th anniversary this year, but has a legacy that dates back to 1800 when grapes were first planted on its Napa Valley property, by James and William Rennie. The winery is run by John Komes and his son Nat, while the vineyards are farmed by Pat Garvey (John's brother-in-law) and his son, Sean. Paul Steinauer (who's been with Flora Springs since 1990) is winemaker. The Komes family honors that history with sustainability, ghost wines and honoring the land that it farms.
The 2015 trilogy is the 31st release of its flagship wine. Trilogy was first made in 1984 when the family selected the highest quality wine lots from estate vineyards from traditional Bordeaux varietals. The 2015 is a blend of 82% Cabernet Sauvignon, 10% Malbec and 8% Petit Verdot. Most of the grapes were grown on the Komes family's ranch which surrounds the Flora Springs Estate in St. Helena (though the vineyard straddles the St. Helena/Rutherford AVAs), though a small portion came from the family's Crossroads Ranch in the Oakville AVA.
This was an unctuous wine that was packed with fruit – blackberry, cassis, black cherry, plum, chocolate, mocha, cedar and vanilla. It was nuanced and had depth. I kept discovering new flavors as we sipped. It was absolutely delicious.
2014 Robert Mondavi Oakville Cabernet Franc Napa Valley
Robert Mondavi established his winery in 1966 with a vision to create outstanding Napa Valley wines. He chose To Kalon Vineyard as the home for Robert Mondavi Winery in Oakville, California. To Kalon is known for producing some of the top first-growth Cabernet Sauvignons.
The Mondavi website categorized the Cabernet Franc as "hedonistic" and I couldn't agree more. This was a wine that made me want to self indulge and how can one not when drinking a Cabernet Franc that comes from this vineyard? The blend was 80% Cabernet Franc, 15% Cabernet Sauvignon, 3% Malbec and 2% Merlot.
This wine was bursting with blackberry, blueberry, chocolate, red currant, violet, pencil lead, cedar and a great minerality. It would benefit with some cellar time, but we decanted it and it was brilliant.
TAGS:champagnemelanie's favoritesamples
2 thoughts on "Samples that Inspire a Rallying Cry Moment"
I love a big woo-hoo when the shipping box is opened!
dallaswinechick says:
It's such a fun feeling, right? Love when the inhibitions go away 🙂


text:
Q: Why do I get Invalid identifier error even though column exist WITH distinct_appl_temp AS (
  SELECT DISTINCT
    c_number
   ,j_group
   ,pi_c_dt
   ,act_can
  FROM app_fact vd
  WHERE
      vd.c_number   = 12335
    AND vd.act_can    = 1
    AND vd.pi_c_dt    = (
        SELECT
          MIN( v2.pi_c_dt )
        FROM app_fact v2
        WHERE
            v2.c_number   = vd.c_number
          AND v2.j_group    = vd.j_group
          AND v2.act_can    = vd.act_can
          AND add_months( v2.pi_c_dt,+6 ) > vd.pi_c_dt
      )
  GROUP BY
    vd.c_number
   ,vd.j_group
   ,vd.pi_c_dt
   ,vd.act_can
  ORDER BY
    vd.j_group
   ,vd.act_can
) SELECT
  dt.c_number
 ,dt.j_group
 ,dt.pi_c_dt
 ,dt.act_can
 ,da.pi_c_dt
FROM distinct_appl_temp dt
 ,   app_fact da
WHERE
    dt.c_number   = da.c_number
  AND dt.j_group    = da.j_group
  AND dt.pi_c_dt    = da.pi_c_dt
  AND dt.act_can    = da.act_can

A: Code Review

*

*line 3-6

*

*Columns are not fully qualified

*line 2 & 21-25

*

*DISTINCT and GROUP BY doesn't make sense in this context.  drop one

*line 26-28

*

*I wouldn't trust an ORDER BY clause in a (refactored) sub-query. Move it to the main query or drop it.

*line 35-41

*

*It's 2019.  Please use ANSI JOINs

*line 34

*

*There are duplicate column names in a SELECT statement.  Give one of them an alias.

Most likely, your problem will be fixed by (5)