@knapsack/app
Version:
Build Design Systems on top of knapsack, by Basalt
2 lines • 16.8 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["vendors~main~9073cddd"],{"../packages/core/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js":function(t,s,e){function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}s.__esModule=!0;var i=e("../packages/core/node_modules/handlebars/dist/cjs/handlebars/base.js"),a=_interopRequireDefault(e("../packages/core/node_modules/handlebars/dist/cjs/handlebars/exception.js")),r=e("../packages/core/node_modules/handlebars/dist/cjs/handlebars/utils.js"),o=_interopRequireDefault(e("../packages/core/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js"));function Literal(t){this.value=t}function JavaScriptCompiler(){}JavaScriptCompiler.prototype={nameLookup:function nameLookup(t,s){return this.internalNameLookup(t,s)},depthedLookup:function depthedLookup(t){return[this.aliasable("container.lookup"),'(depths, "',t,'")']},compilerInfo:function compilerInfo(){var t=i.COMPILER_REVISION;return[t,i.REVISION_CHANGES[t]]},appendToBuffer:function appendToBuffer(t,s,e){return r.isArray(t)||(t=[t]),t=this.source.wrap(t,s),this.environment.isSimple?["return ",t,";"]:e?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},initializeBuffer:function initializeBuffer(){return this.quotedString("")},internalNameLookup:function internalNameLookup(t,s){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",t,",",JSON.stringify(s),")"]},lookupPropertyFunctionIsUsed:!1,compile:function compile(t,s,e,i){this.environment=t,this.options=s,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!i,this.name=this.environment.name,this.isChild=!!e,this.context=e||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,s),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var r=t.opcodes,o=void 0,n=void 0,h=void 0,p=void 0;for(h=0,p=r.length;h<p;h++)o=r[h],this.source.currentLocation=o.loc,n=n||o.loc,this[o.opcode].apply(this,o.args);if(this.source.currentLocation=n,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new a.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),";\n"]),this.decorators.push("return fn;"),i?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var c=this.createFunctionContext(i);if(this.isChild)return c;var u={compiler:this.compilerInfo(),main:c};this.decorators&&(u.main_d=this.decorators,u.useDecorators=!0);var l=this.context,d=l.programs,m=l.decorators;for(h=0,p=d.length;h<p;h++)d[h]&&(u[h]=d[h],m[h]&&(u[h+"_d"]=m[h],u.useDecorators=!0));return this.environment.usePartial&&(u.usePartial=!0),this.options.data&&(u.useData=!0),this.useDepths&&(u.useDepths=!0),this.useBlockParams&&(u.useBlockParams=!0),this.options.compat&&(u.compat=!0),i?u.compilerOptions=this.options:(u.compiler=JSON.stringify(u.compiler),this.source.currentLocation={start:{line:1,column:0}},u=this.objectLiteral(u),s.srcName?(u=u.toStringWithSourceMap({file:s.destName})).map=u.map&&u.map.toString():u=u.toString()),u},preamble:function preamble(){this.lastContext=0,this.source=new o.default(this.options.srcName),this.decorators=new o.default(this.options.srcName)},createFunctionContext:function createFunctionContext(t){var s=this,e="",i=this.stackVars.concat(this.registers.list);i.length>0&&(e+=", "+i.join(", "));var a=0;Object.keys(this.aliases).forEach((function(t){var i=s.aliases[t];i.children&&i.referenceCount>1&&(e+=", alias"+ ++a+"="+t,i.children[0]="alias"+a)})),this.lookupPropertyFunctionIsUsed&&(e+=", "+this.lookupPropertyFunctionVarDeclaration());var r=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&r.push("blockParams"),this.useDepths&&r.push("depths");var o=this.mergeSource(e);return t?(r.push(o),Function.apply(this,r)):this.source.wrap(["function(",r.join(","),") {\n ",o,"}"])},mergeSource:function mergeSource(t){var s=this.environment.isSimple,e=!this.forceBuffer,i=void 0,a=void 0,r=void 0,o=void 0;return this.source.each((function(t){t.appendToBuffer?(r?t.prepend(" + "):r=t,o=t):(r&&(a?r.prepend("buffer += "):i=!0,o.add(";"),r=o=void 0),a=!0,s||(e=!1))})),e?r?(r.prepend("return "),o.add(";")):a||this.source.push('return "";'):(t+=", buffer = "+(i?"":this.initializeBuffer()),r?(r.prepend("return buffer + "),o.add(";")):this.source.push("return buffer;")),t&&this.source.prepend("var "+t.substring(2)+(i?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function lookupPropertyFunctionVarDeclaration(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function blockValue(t){var s=this.aliasable("container.hooks.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs(t,0,e);var i=this.popStack();e.splice(1,0,i),this.push(this.source.functionCall(s,"call",e))},ambiguousBlockValue:function ambiguousBlockValue(){var t=this.aliasable("container.hooks.blockHelperMissing"),s=[this.contextName(0)];this.setupHelperArgs("",0,s,!0),this.flushInline();var e=this.topStack();s.splice(1,0,e),this.pushSource(["if (!",this.lastHelper,") { ",e," = ",this.source.functionCall(t,"call",s),"}"])},appendContent:function appendContent(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function append(){if(this.isInline())this.replaceStack((function(t){return[" != null ? ",t,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function appendEscaped(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function getContext(t){this.lastContext=t},pushContext:function pushContext(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function lookupOnContext(t,s,e,i){var a=0;i||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(t[a++])),this.resolvePath("context",t,a,s,e)},lookupBlockParam:function lookupBlockParam(t,s){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",s,1)},lookupData:function lookupData(t,s,e){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",s,0,!0,e)},resolvePath:function resolvePath(t,s,e,i,a){var r=this;if(this.options.strict||this.options.assumeObjects)this.push(function strictLookup(t,s,e,i){var a=s.popStack(),r=0,o=e.length;t&&o--;for(;r<o;r++)a=s.nameLookup(a,e[r],i);return t?[s.aliasable("container.strict"),"(",a,", ",s.quotedString(e[r]),", ",JSON.stringify(s.source.currentLocation)," )"]:a}(this.options.strict&&a,this,s,t));else for(var o=s.length;e<o;e++)this.replaceStack((function(a){var o=r.nameLookup(a,s[e],t);return i?[" && ",o]:[" != null ? ",o," : ",a]}))},resolvePossibleLambda:function resolvePossibleLambda(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function pushStringParam(t,s){this.pushContext(),this.pushString(s),"SubExpression"!==s&&("string"==typeof t?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function emptyHash(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function pushHash(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function popHash(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function pushString(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function pushLiteral(t){this.pushStackLiteral(t)},pushProgram:function pushProgram(t){null!=t?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function registerDecorator(t,s){var e=this.nameLookup("decorators",s,"decorator"),i=this.setupHelperArgs(s,t);this.decorators.push(["fn = ",this.decorators.functionCall(e,"",["fn","props","container",i])," || fn;"])},invokeHelper:function invokeHelper(t,s,e){var i=this.popStack(),a=this.setupHelper(t,s),r=[];e&&r.push(a.name),r.push(i),this.options.strict||r.push(this.aliasable("container.hooks.helperMissing"));var o=["(",this.itemsSeparatedBy(r,"||"),")"],n=this.source.functionCall(o,"call",a.callParams);this.push(n)},itemsSeparatedBy:function itemsSeparatedBy(t,s){var e=[];e.push(t[0]);for(var i=1;i<t.length;i++)e.push(s,t[i]);return e},invokeKnownHelper:function invokeKnownHelper(t,s){var e=this.setupHelper(t,s);this.push(this.source.functionCall(e.name,"call",e.callParams))},invokeAmbiguous:function invokeAmbiguous(t,s){this.useRegister("helper");var e=this.popStack();this.emptyHash();var i=this.setupHelper(0,t,s),a=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",t,"helper")," || ",e,")"];this.options.strict||(a[0]="(helper = ",a.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",a,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},invokePartial:function invokePartial(t,s,e){var i=[],a=this.setupParams(s,1,i);t&&(s=this.popStack(),delete a.name),e&&(a.indent=JSON.stringify(e)),a.helpers="helpers",a.partials="partials",a.decorators="container.decorators",t?i.unshift(s):i.unshift(this.nameLookup("partials",s,"partial")),this.options.compat&&(a.depths="depths"),a=this.objectLiteral(a),i.push(a),this.push(this.source.functionCall("container.invokePartial","",i))},assignToHash:function assignToHash(t){var s=this.popStack(),e=void 0,i=void 0,a=void 0;this.trackIds&&(a=this.popStack()),this.stringParams&&(i=this.popStack(),e=this.popStack());var r=this.hash;e&&(r.contexts[t]=e),i&&(r.types[t]=i),a&&(r.ids[t]=a),r.values[t]=s},pushId:function pushId(t,s,e){"BlockParam"===t?this.pushStackLiteral("blockParams["+s[0]+"].path["+s[1]+"]"+(e?" + "+JSON.stringify("."+e):"")):"PathExpression"===t?this.pushString(s):"SubExpression"===t?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:JavaScriptCompiler,compileChildren:function compileChildren(t,s){for(var e=t.children,i=void 0,a=void 0,r=0,o=e.length;r<o;r++){i=e[r],a=new this.compiler;var n=this.matchExistingProgram(i);if(null==n){this.context.programs.push("");var h=this.context.programs.length;i.index=h,i.name="program"+h,this.context.programs[h]=a.compile(i,s,this.context,!this.precompile),this.context.decorators[h]=a.decorators,this.context.environments[h]=i,this.useDepths=this.useDepths||a.useDepths,this.useBlockParams=this.useBlockParams||a.useBlockParams,i.useDepths=this.useDepths,i.useBlockParams=this.useBlockParams}else i.index=n.index,i.name="program"+n.index,this.useDepths=this.useDepths||n.useDepths,this.useBlockParams=this.useBlockParams||n.useBlockParams}},matchExistingProgram:function matchExistingProgram(t){for(var s=0,e=this.context.environments.length;s<e;s++){var i=this.context.environments[s];if(i&&i.equals(t))return i}},programExpression:function programExpression(t){var s=this.environment.children[t],e=[s.index,"data",s.blockParams];return(this.useBlockParams||this.useDepths)&&e.push("blockParams"),this.useDepths&&e.push("depths"),"container.program("+e.join(", ")+")"},useRegister:function useRegister(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function push(t){return t instanceof Literal||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function pushStackLiteral(t){this.push(new Literal(t))},pushSource:function pushSource(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function replaceStack(t){var s=["("],e=void 0,i=void 0,r=void 0;if(!this.isInline())throw new a.default("replaceStack on non-inline");var o=this.popStack(!0);if(o instanceof Literal)s=["(",e=[o.value]],r=!0;else{i=!0;var n=this.incrStack();s=["((",this.push(n)," = ",o,")"],e=this.topStack()}var h=t.call(this,e);r||this.popStack(),i&&this.stackSlot--,this.push(s.concat(h,")"))},incrStack:function incrStack(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function topStackName(){return"stack"+this.stackSlot},flushInline:function flushInline(){var t=this.inlineStack;this.inlineStack=[];for(var s=0,e=t.length;s<e;s++){var i=t[s];if(i instanceof Literal)this.compileStack.push(i);else{var a=this.incrStack();this.pushSource([a," = ",i,";"]),this.compileStack.push(a)}}},isInline:function isInline(){return this.inlineStack.length},popStack:function popStack(t){var s=this.isInline(),e=(s?this.inlineStack:this.compileStack).pop();if(!t&&e instanceof Literal)return e.value;if(!s){if(!this.stackSlot)throw new a.default("Invalid stack pop");this.stackSlot--}return e},topStack:function topStack(){var t=this.isInline()?this.inlineStack:this.compileStack,s=t[t.length-1];return s instanceof Literal?s.value:s},contextName:function contextName(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function quotedString(t){return this.source.quotedString(t)},objectLiteral:function objectLiteral(t){return this.source.objectLiteral(t)},aliasable:function aliasable(t){var s=this.aliases[t];return s?(s.referenceCount++,s):((s=this.aliases[t]=this.source.wrap(t)).aliasable=!0,s.referenceCount=1,s)},setupHelper:function setupHelper(t,s,e){var i=[];return{params:i,paramsInit:this.setupHelperArgs(s,t,i,e),name:this.nameLookup("helpers",s,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(i)}},setupParams:function setupParams(t,s,e){var i={},a=[],r=[],o=[],n=!e,h=void 0;n&&(e=[]),i.name=this.quotedString(t),i.hash=this.popStack(),this.trackIds&&(i.hashIds=this.popStack()),this.stringParams&&(i.hashTypes=this.popStack(),i.hashContexts=this.popStack());var p=this.popStack(),c=this.popStack();(c||p)&&(i.fn=c||"container.noop",i.inverse=p||"container.noop");for(var u=s;u--;)h=this.popStack(),e[u]=h,this.trackIds&&(o[u]=this.popStack()),this.stringParams&&(r[u]=this.popStack(),a[u]=this.popStack());return n&&(i.args=this.source.generateArray(e)),this.trackIds&&(i.ids=this.source.generateArray(o)),this.stringParams&&(i.types=this.source.generateArray(r),i.contexts=this.source.generateArray(a)),this.options.data&&(i.data="data"),this.useBlockParams&&(i.blockParams="blockParams"),i},setupHelperArgs:function setupHelperArgs(t,s,e,i){var a=this.setupParams(t,s,e);return a.loc=JSON.stringify(this.source.currentLocation),a=this.objectLiteral(a),i?(this.useRegister("options"),e.push("options"),["options=",a]):e?(e.push(a),""):a}},function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),s=JavaScriptCompiler.RESERVED_WORDS={},e=0,i=t.length;e<i;e++)s[t[e]]=!0}(),JavaScriptCompiler.isValidJavaScriptVariableName=function(t){return!JavaScriptCompiler.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)},s.default=JavaScriptCompiler,t.exports=s.default}}]);
//# sourceMappingURL=vendors~main~9073cddd.chunk.eaa5497fb7f7db0479e3.js.map