text:
System.register(["aurelia-framework", "aurelia-logging", "@material/ripple", "./create-components", "../drawer/common", "../util"], function (exports_1, context_1) {
    "use strict";
    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var __metadata = (this && this.__metadata) || function (k, v) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
    };
    var __moduleName = context_1 && context_1.id;
    var aurelia_framework_1, aurelia_logging_1, ripple_1, create_components_1, drawerCommon, util, MdcListItem;
    return {
        setters: [
            function (aurelia_framework_1_1) {
                aurelia_framework_1 = aurelia_framework_1_1;
            },
            function (aurelia_logging_1_1) {
                aurelia_logging_1 = aurelia_logging_1_1;
            },
            function (ripple_1_1) {
                ripple_1 = ripple_1_1;
            },
            function (create_components_1_1) {
                create_components_1 = create_components_1_1;
            },
            function (drawerCommon_1) {
                drawerCommon = drawerCommon_1;
            },
            function (util_1) {
                util = util_1;
            }
        ],
        execute: function () {
            MdcListItem = (function () {
                function MdcListItem(element) {
                    this.element = element;
                    this.ripple = false;
                    this.selected = false;
                    this.disabled = false;
                    this.target = '_self';
                    this.isMenuItem = false;
                    this.isSelectMenuItem = false;
                    this.selectedClass = '';
                    this.log = aurelia_logging_1.getLogger('mdc-list-item');
                }
                MdcListItem.prototype.elementClick = function (e) {
                    var event = util.fireEvent(this.element, 'on-click', this);
                    var stopPropagation = event['propagationStopped'] ? true : false;
                    return !stopPropagation;
                };
                MdcListItem.prototype.bind = function () { };
                MdcListItem.prototype.unbind = function () { };
                MdcListItem.prototype.attached = function () {
                    this.parentElement = util.findAncestor(this.elementListItem, 'mdc-list');
                    if (drawerCommon.isDrawer(this.element)) {
                        this.selectedClass = 'mdc-list-item--activated';
                    }
                    this.selectMenuItem();
                    this.menuItem();
                    this.rippleEffect();
                    this.disabledChanged(this.disabled);
                    this.selectedChanged(this.selected);
                };
                MdcListItem.prototype.detached = function () {
                    if (this.mdcRipple) {
                        this.mdcRipple.destroy();
                    }
                };
                MdcListItem.prototype.menuItem = function () {
                    this.isMenuItem = this.parentElement.classList.contains('mdc-menu__items');
                    if (this.isMenuItem) {
                        this.elementListItem.setAttribute('role', this.isSelectMenuItem ? 'option' : 'menuitem');
                    }
                };
                MdcListItem.prototype.selectMenuItem = function () {
                    this.isSelectMenuItem = util.findAncestor(this.parentElement, 'mdc-select__menu') ? true : false;
                };
                MdcListItem.prototype.rippleEffect = function () {
                    if (util.getBoolean(this.ripple)) {
                        this.mdcRipple = new ripple_1.MDCRipple(this.elementListItem);
                    }
                };
                MdcListItem.prototype.disabledChanged = function (newValue) {
                    var value = util.getBoolean(newValue);
                    if (this.isMenuItem || this.isSelectMenuItem) {
                        this.elementListItem.setAttribute('tabindex', value ? '-1' : '0');
                        this.elementListItem.setAttribute('aria-disabled', value ? 'true' : 'false');
                    }
                };
                MdcListItem.prototype.selectedChanged = function (newValue) {
                    var value = util.getBoolean(newValue);
                    if (this.selectedClass !== '') {
                        this.elementListItem.classList[value ? 'add' : 'remove'](this.selectedClass);
                    }
                };
                __decorate([
                    aurelia_framework_1.bindable(),
                    __metadata("design:type", Object)
                ], MdcListItem.prototype, "class", void 0);
                __decorate([
                    aurelia_framework_1.bindable(),
                    __metadata("design:type", Object)
                ], MdcListItem.prototype, "ripple", void 0);
                __decorate([
                    aurelia_framework_1.bindable(),
                    __metadata("design:type", Object)
                ], MdcListItem.prototype, "model", void 0);
                __decorate([
                    aurelia_framework_1.bindable(),
                    __metadata("design:type", Object)
                ], MdcListItem.prototype, "selected", void 0);
                __decorate([
                    aurelia_framework_1.bindable({ defaultBindingMode: aurelia_framework_1.bindingMode.oneTime }),
                    __metadata("design:type", Object)
                ], MdcListItem.prototype, "disabled", void 0);
                __decorate([
                    aurelia_framework_1.bindable({ defaultBindingMode: aurelia_framework_1.bindingMode.oneTime }),
                    __metadata("design:type", String)
                ], MdcListItem.prototype, "href", void 0);
                __decorate([
                    aurelia_framework_1.bindable({ defaultBindingMode: aurelia_framework_1.bindingMode.oneTime }),
                    __metadata("design:type", String)
                ], MdcListItem.prototype, "target", void 0);
                MdcListItem = __decorate([
                    aurelia_framework_1.noView(),
                    aurelia_framework_1.customElement('mdc-list-item'),
                    aurelia_framework_1.processContent(create_components_1.CreateListItemComponent),
                    aurelia_framework_1.inject(Element),
                    __metadata("design:paramtypes", [Element])
                ], MdcListItem);
                return MdcListItem;
            }());
            exports_1("MdcListItem", MdcListItem);
        }
    };
});


text:
export default ({ localDispatch, getLocalState, globalDispatch, getGlobalState }) => (next) => (action) => {

    if (typeof action === 'function') {
        return action(localDispatch, getLocalState, globalDispatch, getGlobalState)
    }

    return next(action)
}

redpajama_set_name: RedPajamaGithub


text:
#include "BLZWDecompressor.hpp"
#include "InputStream.hpp"
#include "OutputStream.hpp"

bool BLZWDecompressor::detectHeaderXPK(uint32_t hdr)
{
	return hdr==FourCC("BLZW");
}

std::unique_ptr<XPKDecompressor> BLZWDecompressor::create(uint32_t hdr,uint32_t recursionLevel,const Buffer &packedData,std::unique_ptr<XPKDecompressor::State> &state,bool verify)
{
	return std::make_unique<BLZWDecompressor>(hdr,recursionLevel,packedData,state,verify);
}

BLZWDecompressor::BLZWDecompressor(uint32_t hdr,uint32_t recursionLevel,const Buffer &packedData,std::unique_ptr<XPKDecompressor::State> &state,bool verify) :
	XPKDecompressor(recursionLevel),
	_packedData(packedData)
{
	if (!detectHeaderXPK(hdr)) throw Decompressor::InvalidFormatError();
	_maxBits=_packedData.readBE16(0);
	if (_maxBits<9 || _maxBits>20) throw Decompressor::InvalidFormatError();;
	_stackLength=uint32_t(_packedData.readBE16(2))+5;
}

BLZWDecompressor::~BLZWDecompressor()
{
	// nothing needed
}

const std::string &BLZWDecompressor::getSubName() const noexcept
{
	static std::string name="XPK-BLZW: LZW-compressor";
	return name;
}

void BLZWDecompressor::decompressImpl(Buffer &rawData,const Buffer &previousData,bool verify)
{
	ForwardInputStream inputStream(_packedData,4,_packedData.size());
	MSBBitReader<ForwardInputStream> bitReader(inputStream);
	auto readBits=[&](uint32_t count)->uint32_t
	{
		return bitReader.readBits8(count);
	};

	ForwardOutputStream outputStream(rawData,0,rawData.size());

	uint32_t maxCode=1<<_maxBits;
	auto prefix=std::make_unique<uint32_t[]>(maxCode-259);
	auto suffix=std::make_unique<uint8_t[]>(maxCode-259);
	auto stack=std::make_unique<uint8_t[]>(_stackLength);

	uint32_t freeIndex,codeBits,prevCode,newCode;

	auto suffixLookup=[&](uint32_t code)->uint32_t
	{
		if (code>=freeIndex) throw Decompressor::DecompressionError();
		return (code<259)?code:suffix[code-259];
	};

	auto insert=[&](uint32_t code)
	{
		uint32_t stackPos=0;
		newCode=suffixLookup(code);
		while (code>=259)
		{
			if (stackPos+1>=_stackLength) throw Decompressor::DecompressionError();
			stack[stackPos++]=newCode;
			code=prefix[code-259];
			newCode=suffixLookup(code);
		}
		stack[stackPos++]=newCode;
		while (stackPos) outputStream.writeByte(stack[--stackPos]);
	};

	auto init=[&]()
	{
		codeBits=9;
		freeIndex=259;
		prevCode=readBits(codeBits);
		insert(prevCode);
	};

	init();
	while (!outputStream.eof())
	{
		uint32_t code=readBits(codeBits);
		switch (code)
		{
			case 256:
			throw Decompressor::DecompressionError();
			break;

			case 257:
			init();
			break;

			case 258:
			codeBits++;
			break;

			default:
			if (code>=freeIndex)
			{
				uint32_t tmp=newCode;
				insert(prevCode);
				outputStream.writeByte(tmp);
			} else insert(code);
			if (freeIndex<maxCode)
			{
				suffix[freeIndex-259]=newCode;
				prefix[freeIndex-259]=prevCode;
				freeIndex++;
			}
			prevCode=code;
			break;
		}
	}
}

XPKDecompressor::Registry<BLZWDecompressor> BLZWDecompressor::_XPKregistration;