text: function sjeClass(){return new ValueTransformer}var ValueTransformer=function(){this.displayName="Number Calculations",this.shortDescription="Perform basic calculations.",this.isEditingDisabled=!0,this.infoUrl="https://github.com/SmartJSONEditor/PublicDocuments/wiki/Token-Value-Transformer",this.parameters=function(e){if(null==e)return[];var a=[{displayName:"Add +",value:"add"},{displayName:"Subtract -",value:"subtract"},{displayName:"Multiply *",value:"multiply"},{displayName:"Divide /",value:"divide"},{displayName:"Remainder",value:"remainder"}],t={name:"type",type:"Popup",displayName:"Modification Type",description:"Select function type",defaultValue:a},r={type:"Number",name:"number",displayName:"By Number",description:"Calculations by number.",defaultValue:1,tokenScripts:!0},i=[{displayName:"Prepend",enabled:0},{displayName:"Replace",enabled:1},{displayName:"Append",enabled:0}],u={type:"Segments",name:"output",displayName:"Output",description:"Select how to output the value.",defaultValue:i};return[t,r,u]},this.transform=function(e,a,t){e=Number(e);var r=DocumentModel.getTokensValue(a.number,t.projectNode,pluginIdentifier);0/0===e&&(e=1),0/0===r&&(r=1);var i=1==Array.isArray(a.type)?"add":a.type,u=Number(r),n=0;return"add"==i&&(n=e+u),"subtract"==i&&(n=e-u),"multiply"==i&&(n=e*u),"divide"==i&&(0==u&&(u=1),n=e/u),"remainder"==i&&(n=e%u),1==a.output[0].enabled?n+e:1==a.output[1].enabled?n:1==a.output[2].enabled?e+n:0}};