summaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/js/workflowengine.js
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-05-29 15:20:19 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-05-29 15:20:19 +0200
commita442b78538e9b444b0735001d58170f03bbb6460 (patch)
treeb8d76bc6e9a866162c95773df629f08f00adf64a /apps/workflowengine/js/workflowengine.js
parentb53a9130a60962fd2964d37b1ffafe1f3eaff5df (diff)
downloadnextcloud-server-a442b78538e9b444b0735001d58170f03bbb6460.tar.gz
nextcloud-server-a442b78538e9b444b0735001d58170f03bbb6460.zip
Build and update
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/workflowengine/js/workflowengine.js')
-rw-r--r--apps/workflowengine/js/workflowengine.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/workflowengine/js/workflowengine.js b/apps/workflowengine/js/workflowengine.js
index f1aaa5245ad..30a5d7b28c5 100644
--- a/apps/workflowengine/js/workflowengine.js
+++ b/apps/workflowengine/js/workflowengine.js
@@ -1,2 +1,2 @@
-!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/js/",n(n.s=33)}([function(e,t,n){"use strict";t.__esModule=!0,t.extend=l,t.indexOf=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},t.escapeExpression=function(e){if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML();if(null==e)return"";if(!e)return e+"";e=""+e}if(!a.test(e))return e;return e.replace(o,i)},t.isEmpty=function(e){return!e&&0!==e||!(!c(e)||0!==e.length)},t.createFrame=function(e){var t=l({},e);return t._parent=e,t},t.blockParams=function(e,t){return e.path=t,e},t.appendContextPath=function(e,t){return(e?e+".":"")+t};var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},o=/[&<>"'`=]/g,a=/[&<>"'`=]/;function i(e){return r[e]}function l(e){for(var t=1;t<arguments.length;t++)for(var n in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],n)&&(e[n]=arguments[t][n]);return e}var s=Object.prototype.toString;t.toString=s;var u=function(e){return"function"==typeof e};u(/x/)&&(t.isFunction=u=function(e){return"function"==typeof e&&"[object Function]"===s.call(e)}),t.isFunction=u;var c=Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===s.call(e)};t.isArray=c},function(e,t,n){"use strict";t.__esModule=!0;var r=["description","fileName","lineNumber","message","name","number","stack"];function o(e,t){var n=t&&t.loc,a=void 0,i=void 0;n&&(e+=" - "+(a=n.start.line)+":"+(i=n.start.column));for(var l=Error.prototype.constructor.call(this,e),s=0;s<r.length;s++)this[r[s]]=l[r[s]];Error.captureStackTrace&&Error.captureStackTrace(this,o);try{n&&(this.lineNumber=a,Object.defineProperty?Object.defineProperty(this,"column",{value:i,enumerable:!0}):this.column=i)}catch(e){}}o.prototype=new Error,t.default=o,e.exports=t.default},function(e,t,n){e.exports=n(7).default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=u;var o=n(0),a=r(n(1)),i=n(8),l=n(16),s=r(n(18));t.VERSION="4.1.2";t.COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};function u(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},i.registerDefaultHelpers(this),l.registerDefaultDecorators(this)}u.prototype={constructor:u,logger:s.default,log:s.default.log,registerHelper:function(e,t){if("[object Object]"===o.toString.call(e)){if(t)throw new a.default("Arg not supported with multiple helpers");o.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===o.toString.call(e))o.extend(this.partials,e);else{if(void 0===t)throw new a.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if("[object Object]"===o.toString.call(e)){if(t)throw new a.default("Arg not supported with multiple decorators");o.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]}};var c=s.default.log;t.log=c,t.createFrame=o.createFrame,t.logger=s.default},function(e,t){e.exports=function(e,t){return e===t?'selected="selected"':""}},function(e,t,n){var r=n(2);function o(e){return e&&(e.__esModule?e.default:e)}e.exports=(r.default||r).template({1:function(e,t,n,r,o){return" modified"},3:function(e,t,n,r,o){return'\t\t\t<span class="button-delete icon-delete"></span>\n'},5:function(e,t,r,a,i,l,s){var u,c=e.lambda,f=e.escapeExpression,d=null!=t?t:e.nullContext||{};return'\t\t\t<div class="check" data-id="'+f(c(i&&i.index,t))+'">\n\t\t\t\t<select class="check-class">\n'+(null!=(u=r.each.call(d,null!=s[1]?s[1].classes:s[1],{name:"each",hash:{},fn:e.program(6,i,0,l,s),inverse:e.noop,data:i}))?u:"")+'\t\t\t\t</select>\n\t\t\t\t<select class="check-operator">\n'+(null!=(u=r.each.call(d,o(n(23)).call(d,null!=t?t.class:t,{name:"getOperators",hash:{},data:i}),{name:"each",hash:{},fn:e.program(8,i,0,l,s),inverse:e.noop,data:i}))?u:"")+'\t\t\t\t</select>\n\t\t\t\t<input type="text" class="check-value" value="'+f(c(null!=t?t.value:t,t))+'">\n\t\t\t\t<span class="button-delete-check icon-delete"></span>\n\t\t\t</div>\n'},6:function(e,t,r,a,i,l,s){var u,c=e.lambda,f=e.escapeExpression;return'\t\t\t\t\t\t<option value="'+f(c(null!=t?t.class:t,t))+'" '+(null!=(u=o(n(4)).call(null!=t?t:e.nullContext||{},null!=t?t.class:t,null!=s[1]?s[1].class:s[1],{name:"selectItem",hash:{},data:i}))?u:"")+">"+f(c(null!=t?t.name:t,t))+"</option>\n"},8:function(e,t,r,a,i,l,s){var u,c=e.lambda,f=e.escapeExpression;return'\t\t\t\t\t\t<option value="'+f(c(null!=t?t.operator:t,t))+'" '+(null!=(u=o(n(4)).call(null!=t?t:e.nullContext||{},null!=t?t.operator:t,null!=s[1]?s[1].operator:s[1],{name:"selectItem",hash:{},data:i}))?u:"")+">"+f(c(null!=t?t.name:t,t))+"</option>\n"},10:function(e,t,n,r,o){var a;return(null!=(a=n.if.call(null!=t?t:e.nullContext||{},null!=(a=null!=t?t.operation:t)?a.id:a,{name:"if",hash:{},fn:e.program(11,o,0),inverse:e.noop,data:o}))?a:"")+'\t\t<button class="button-save pull-right">'+e.escapeExpression(e.lambda(null!=t?t.saveTXT:t,t))+"</button>\n"},11:function(e,t,n,r,o){return'\t\t\t<button class="button-reset pull-right">'+e.escapeExpression(e.lambda(null!=t?t.resetTXT:t,t))+"</button>\n"},13:function(e,t,n,r,o){return'\t\t<span class="icon-loading-small pull-right"></span>\n\t\t<span class="pull-right">'+e.escapeExpression(e.lambda(null!=t?t.savingTXT:t,t))+"</span>\n\t"},15:function(e,t,n,r,o){var a;return null!=(a=n.if.call(null!=t?t:e.nullContext||{},null!=t?t.message:t,{name:"if",hash:{},fn:e.program(16,o,0),inverse:e.noop,data:o}))?a:""},16:function(e,t,n,r,o){var a,i=null!=t?t:e.nullContext||{};return'\n\t\t<span class="msg pull-right '+(null!=(a=n.if.call(i,null!=t?t.errorMessage:t,{name:"if",hash:{},fn:e.program(17,o,0),inverse:e.program(19,o,0),data:o}))?a:"")+'">\n\t\t\t\t\t'+e.escapeExpression(e.lambda(null!=t?t.message:t,t))+(null!=(a=n.if.call(i,null!=t?t.errorMessage:t,{name:"if",hash:{},fn:e.program(21,o,0),inverse:e.noop,data:o}))?a:"")+"\n\t\t\t\t</span>\n\t"},17:function(e,t,n,r,o){return"error"},19:function(e,t,n,r,o){return"success"},21:function(e,t,n,r,o){return" "+e.escapeExpression(e.lambda(null!=t?t.errorMessage:t,t))},compiler:[7,">= 4.0.0"],main:function(e,t,n,r,o,a,i){var l,s=null!=t?t:e.nullContext||{},u=e.lambda,c=e.escapeExpression;return'<div class="operation'+(null!=(l=n.if.call(s,null!=t?t.hasChanged:t,{name:"if",hash:{},fn:e.program(1,o,0,a,i),inverse:e.noop,data:o}))?l:"")+'">\n\t<div class="operation-header">\n\t\t<input type="text" class="operation-name" placeholder="'+c(u(null!=t?t.shortRuleDescTXT:t,t))+'" value="'+c(u(null!=(l=null!=t?t.operation:t)?l.name:l,t))+'" />\n\t\t<input type="text" class="operation-operation" value="'+c(u(null!=(l=null!=t?t.operation:t)?l.operation:l,t))+'" />\n'+(null!=(l=n.if.call(s,null!=(l=null!=t?t.operation:t)?l.id:l,{name:"if",hash:{},fn:e.program(3,o,0,a,i),inverse:e.noop,data:o}))?l:"")+'\t</div>\n\n\t<div class="checks">\n'+(null!=(l=n.each.call(s,null!=(l=null!=t?t.operation:t)?l.checks:l,{name:"each",hash:{},fn:e.program(5,o,0,a,i),inverse:e.noop,data:o}))?l:"")+'\t</div>\n\t<button class="button-add">'+c(u(null!=t?t.addRuleTXT:t,t))+"</button>\n"+(null!=(l=n.if.call(s,null!=t?t.hasChanged:t,{name:"if",hash:{},fn:e.program(10,o,0,a,i),inverse:e.noop,data:o}))?l:"")+(null!=(l=n.if.call(s,null!=t?t.saving:t,{name:"if",hash:{},fn:e.program(13,o,0,a,i),inverse:e.program(15,o,0,a,i),data:o}))?l:"")+"\n</div>\n"},useData:!0,useDepths:!0})},function(e,t,n){var r=n(2);e.exports=(r.default||r).template({compiler:[7,">= 4.0.0"],main:function(e,t,n,r,o){var a;return'<div class="operations"></div>\n<button class="button-add-operation">'+e.escapeExpression("function"==typeof(a=null!=(a=n.addRuleGroupTXT||(null!=t?t.addRuleGroupTXT:t))?a:n.helperMissing)?a.call(null!=t?t:e.nullContext||{},{name:"addRuleGroupTXT",hash:{},data:o}):a)+"</button>\n"},useData:!0})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.__esModule=!0;var a=o(n(3)),i=r(n(19)),l=r(n(1)),s=o(n(0)),u=o(n(20)),c=r(n(21));function f(){var e=new a.HandlebarsEnvironment;return s.extend(e,a),e.SafeString=i.default,e.Exception=l.default,e.Utils=s,e.escapeExpression=s.escapeExpression,e.VM=u,e.template=function(t){return u.template(t,e)},e}var d=f();d.create=f,c.default(d),d.default=d,t.default=d,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){o.default(e),a.default(e),i.default(e),l.default(e),s.default(e),u.default(e),c.default(e)};var o=r(n(9)),a=r(n(10)),i=r(n(11)),l=r(n(12)),s=r(n(13)),u=r(n(14)),c=r(n(15))},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0);t.default=function(e){e.registerHelper("blockHelperMissing",function(t,n){var o=n.inverse,a=n.fn;if(!0===t)return a(this);if(!1===t||null==t)return o(this);if(r.isArray(t))return t.length>0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):o(this);if(n.data&&n.ids){var i=r.createFrame(n.data);i.contextPath=r.appendContextPath(n.data.contextPath,n.name),n={data:i}}return a(t,n)})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(0),a=n(1),i=(r=a)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("each",function(e,t){if(!t)throw new i.default("Must pass iterator to #each");var n=t.fn,r=t.inverse,a=0,l="",s=void 0,u=void 0;function c(t,r,a){s&&(s.key=t,s.index=r,s.first=0===r,s.last=!!a,u&&(s.contextPath=u+t)),l+=n(e[t],{data:s,blockParams:o.blockParams([e[t],t],[u+t,null])})}if(t.data&&t.ids&&(u=o.appendContextPath(t.data.contextPath,t.ids[0])+"."),o.isFunction(e)&&(e=e.call(this)),t.data&&(s=o.createFrame(t.data)),e&&"object"==typeof e)if(o.isArray(e))for(var f=e.length;a<f;a++)a in e&&c(a,a,a===e.length-1);else{var d=void 0;for(var p in e)e.hasOwnProperty(p)&&(void 0!==d&&c(d,a-1),d=p,a++);void 0!==d&&c(d,a-1,!0)}return 0===a&&(l=r(this)),l})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r,o=n(1),a=(r=o)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new a.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0);t.default=function(e){e.registerHelper("if",function(e,t){return r.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||r.isEmpty(e)?t.inverse(this):t.fn(this)}),e.registerHelper("unless",function(t,n){return e.helpers.if.call(this,t,{fn:n.inverse,inverse:n.fn,hash:n.hash})})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",function(){for(var t=[void 0],n=arguments[arguments.length-1],r=0;r<arguments.length-1;r++)t.push(arguments[r]);var o=1;null!=n.hash.level?o=n.hash.level:n.data&&null!=n.data.level&&(o=n.data.level),t[0]=o,e.log.apply(e,t)})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",function(e,t){return e?"constructor"!==t||e.propertyIsEnumerable(t)?e[t]:void 0:e})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0);t.default=function(e){e.registerHelper("with",function(e,t){r.isFunction(e)&&(e=e.call(this));var n=t.fn;if(r.isEmpty(e))return t.inverse(this);var o=t.data;return t.data&&t.ids&&((o=r.createFrame(t.data)).contextPath=r.appendContextPath(t.data.contextPath,t.ids[0])),n(e,{data:o,blockParams:r.blockParams([e],[o&&o.contextPath])})})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){a.default(e)};var r,o=n(17),a=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0);t.default=function(e){e.registerDecorator("inline",function(e,t,n,o){var a=e;return t.partials||(t.partials={},a=function(o,a){var i=n.partials;n.partials=r.extend({},i,t.partials);var l=e(o,a);return n.partials=i,l}),t.partials[o.args[0]]=o.fn,a})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0),o={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=r.indexOf(o.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=o.lookupLevel(e),"undefined"!=typeof console&&o.lookupLevel(o.level)<=e){var t=o.methodMap[e];console[t]||(t="log");for(var n=arguments.length,r=Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];console[t].apply(console,r)}}};t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e){this.string=e}t.__esModule=!0,r.prototype.toString=r.prototype.toHTML=function(){return""+this.string},t.default=r,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,n=l.COMPILER_REVISION;if(t!==n){if(t<n){var r=l.REVISION_CHANGES[n],o=l.REVISION_CHANGES[t];throw new i.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+r+") or downgrade your runtime to an older version ("+o+").")}throw new i.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}},t.template=function(e,t){if(!t)throw new i.default("No environment passed to template");if(!e||!e.main)throw new i.default("Unknown template object: "+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var n={strict:function(e,t){if(!(t in e))throw new i.default('"'+t+'" not defined in '+e);return e[t]},lookup:function(e,t){for(var n=e.length,r=0;r<n;r++)if(e[r]&&null!=e[r][t])return e[r][t]},lambda:function(e,t){return"function"==typeof e?e.call(t):e},escapeExpression:o.escapeExpression,invokePartial:function(n,r,a){a.hash&&(r=o.extend({},r,a.hash),a.ids&&(a.ids[0]=!0));n=t.VM.resolvePartial.call(this,n,r,a);var l=t.VM.invokePartial.call(this,n,r,a);null==l&&t.compile&&(a.partials[a.name]=t.compile(n,e.compilerOptions,t),l=a.partials[a.name](r,a));if(null!=l){if(a.indent){for(var s=l.split("\n"),u=0,c=s.length;u<c&&(s[u]||u+1!==c);u++)s[u]=a.indent+s[u];l=s.join("\n")}return l}throw new i.default("The partial "+a.name+" could not be compiled when running in runtime-only mode")},fn:function(t){var n=e[t];return n.decorator=e[t+"_d"],n},programs:[],program:function(e,t,n,r,o){var a=this.programs[e],i=this.fn(e);return t||o||r||n?a=s(this,e,i,t,n,r,o):a||(a=this.programs[e]=s(this,e,i)),a},data:function(e,t){for(;e&&t--;)e=e._parent;return e},merge:function(e,t){var n=e||t;return e&&t&&e!==t&&(n=o.extend({},t,e)),n},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function r(t){var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=o.data;r._setup(o),!o.partial&&e.useData&&(a=function(e,t){t&&"root"in t||((t=t?l.createFrame(t):{}).root=e);return t}(t,a));var i=void 0,s=e.useBlockParams?[]:void 0;function u(t){return""+e.main(n,t,n.helpers,n.partials,a,s,i)}return e.useDepths&&(i=o.depths?t!=o.depths[0]?[t].concat(o.depths):o.depths:[t]),(u=c(e.main,u,n,o.depths||[],a,s))(t,o)}return r.isTop=!0,r._setup=function(r){r.partial?(n.helpers=r.helpers,n.partials=r.partials,n.decorators=r.decorators):(n.helpers=n.merge(r.helpers,t.helpers),e.usePartial&&(n.partials=n.merge(r.partials,t.partials)),(e.usePartial||e.useDecorators)&&(n.decorators=n.merge(r.decorators,t.decorators)))},r._child=function(t,r,o,a){if(e.useBlockParams&&!o)throw new i.default("must pass block params");if(e.useDepths&&!a)throw new i.default("must pass parent depths");return s(n,t,e[t],r,0,o,a)},r},t.wrapProgram=s,t.resolvePartial=function(e,t,n){e?e.call||n.name||(n.name=e,e=n.partials[e]):e="@partial-block"===n.name?n.data["partial-block"]:n.partials[n.name];return e},t.invokePartial=function(e,t,n){var r=n.data&&n.data["partial-block"];n.partial=!0,n.ids&&(n.data.contextPath=n.ids[0]||n.data.contextPath);var a=void 0;n.fn&&n.fn!==u&&function(){n.data=l.createFrame(n.data);var e=n.fn;a=n.data["partial-block"]=function(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return n.data=l.createFrame(n.data),n.data["partial-block"]=r,e(t,n)},e.partials&&(n.partials=o.extend({},n.partials,e.partials))}();void 0===e&&a&&(e=a);if(void 0===e)throw new i.default("The partial "+n.name+" could not be found");if(e instanceof Function)return e(t,n)},t.noop=u;var r,o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(0)),a=n(1),i=(r=a)&&r.__esModule?r:{default:r},l=n(3);function s(e,t,n,r,o,a,i){function l(t){var o=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],l=i;return!i||t==i[0]||t===e.nullContext&&null===i[0]||(l=[t].concat(i)),n(e,t,e.helpers,e.partials,o.data||r,a&&[o.blockParams].concat(a),l)}return(l=c(n,l,e,i,r,a)).program=t,l.depth=i?i.length:0,l.blockParams=o||0,l}function u(){return""}function c(e,t,n,r,a,i){if(e.decorator){var l={};t=e.decorator(t,l,n,r&&r[0],a,i,r),o.extend(t,l)}return t}},function(e,t,n){"use strict";(function(n){t.__esModule=!0,t.default=function(e){var t=void 0!==n?n:window,r=t.Handlebars;e.noConflict=function(){return t.Handlebars===e&&(t.Handlebars=r),e}},e.exports=t.default}).call(this,n(22))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){var t=OCA.WorkflowEngine.getCheckByClass(e);return _.isUndefined(t)?[]:t.operators}},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileMimeTypePlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\FileMimeType",name:t("workflowengine","File MIME type"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\FileMimeType"===n.class){var r="text/plain";"matches"!==n.operator&&"!matches"!==n.operator||(r="/^text\\/(plain|html)$/i",this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input")),$(e).css("width","250px").attr("placeholder",r).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:r})).addClass("has-tooltip").tooltip({placement:"bottom"})}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileMimeTypePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileNamePlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\FileName",name:t("workflowengine","File name"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\FileName"===n.class){var r="dummy.jpg";"matches"!==n.operator&&"!matches"!==n.operator||(r="/^dummy-.+$/i",this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input")),$(e).css("width","250px").attr("placeholder",r).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:r})).addClass("has-tooltip").tooltip({placement:"bottom"})}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileNamePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileSizePlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\FileSize",name:t("workflowengine","File size (upload)"),operators:[{operator:"less",name:t("workflowengine","less")},{operator:"!greater",name:t("workflowengine","less or equals")},{operator:"!less",name:t("workflowengine","greater or equals")},{operator:"greater",name:t("workflowengine","greater")}]}},render:function(e,n){"OCA\\WorkflowEngine\\Check\\FileSize"===n.class&&$(e).css("width","250px").attr("placeholder","12 MB").attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"12 MB"})).addClass("has-tooltip").tooltip({placement:"bottom"})}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileSizePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin={getCheck:function(){return this.collection=OC.SystemTags.collection,{class:"OCA\\WorkflowEngine\\Check\\FileSystemTags",name:t("workflowengine","File system tag"),operators:[{operator:"is",name:t("workflowengine","is tagged with")},{operator:"!is",name:t("workflowengine","is not tagged with")}]}},render:function(e,n){"OCA\\WorkflowEngine\\Check\\FileSystemTags"===n.class&&($(e).css("width","400px"),$(e).select2({allowClear:!1,multiple:!1,placeholder:t("workflowengine","Select tag…"),query:_.debounce(function(e){e.callback({results:OC.SystemTags.collection.filterByName(e.term)})},100,!0),id:function(e){return e.get("id")},initSelection:function(e,t){t($(e).val())},formatResult:function(e){return OC.SystemTags.getDescriptiveTag(e)},formatSelection:function(e){var t=OC.SystemTags.collection.get(e);if(!_.isUndefined(t))return OC.SystemTags.getDescriptiveTag(t)},escapeMarkup:function(e){return e}}))}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestRemoteAddressPlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestRemoteAddress",name:t("workflowengine","Request remote address"),operators:[{operator:"matchesIPv4",name:t("workflowengine","matches IPv4")},{operator:"!matchesIPv4",name:t("workflowengine","does not match IPv4")},{operator:"matchesIPv6",name:t("workflowengine","matches IPv6")},{operator:"!matchesIPv6",name:t("workflowengine","does not match IPv6")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestRemoteAddress"===n.class){var r="127.0.0.1/32";"matchesIPv6"===n.operator||"!matchesIPv6"===n.operator?(r="::1/128",this._validateIPv6(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input")):this._validateIPv4(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input"),$(e).css("width","300px").attr("placeholder",r).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:r})).addClass("has-tooltip").tooltip({placement:"bottom"})}},_validateIPv4:function(e){return null!==/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2][0-9]|[1-9])$/.exec(e)},_validateIPv6:function(e){return null!==/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(1([01][0-9]|2[0-8])|[1-9][0-9]|[0-9])$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestRemoteAddressPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestTimePlugin={timezones:["Europe/Berlin","Europe/London"],_$element:null,getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestTime",name:t("workflowengine","Request time"),operators:[{operator:"in",name:t("workflowengine","between")},{operator:"!in",name:t("workflowengine","not between")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestTime"===n.class){var r="09:00",o="18:00",a=jstz.determine().name(),i=$(e);if(_.isString(n.value)&&""!==n.value){var l=JSON.parse(n.value),s=l[0].split(" ",2),u=l[1].split(" ",2);r=s[0],o=u[0],a=s[1]}var c=JSON.stringify([r+" "+a,o+" "+a]);n.value!==c&&(n.value=c,i.val(c)),i.css("display","none"),$("<input>").attr("type","text").attr("placeholder",t("workflowengine","Start")).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"16:00"})).addClass("has-tooltip").tooltip({placement:"bottom"}).addClass("start").val(r).insertBefore(i),$("<input>").attr("type","text").attr("placeholder",t("workflowengine","End")).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"16:00"})).addClass("has-tooltip").tooltip({placement:"bottom"}).addClass("end").val(o).insertBefore(i);var f=$("<input>").attr("type","hidden").css("width","250px").insertBefore(i).val(a);f.select2({allowClear:!1,multiple:!1,placeholder:t("workflowengine","Select timezone…"),ajax:{url:OC.generateUrl("apps/workflowengine/timezones"),dataType:"json",quietMillis:100,data:function(e){return""===e&&(e=(e=jstz.determine().name().split("/"))[0]),{search:e}},results:function(e){var t=[];return $.each(e,function(e){t.push({id:e})}),{results:t,more:!1}}},initSelection:function(e,t){t(e.val())},formatResult:function(e){return"<span>"+e.id+"</span>"},formatSelection:function(e){return _.isUndefined(e.id)||(e=e.id),"<span>"+e+"</span>"}}),f.addClass("timezone"),i.parent().on("change",".start",_.bind(this.update,this)).on("change",".end",_.bind(this.update,this)).on("change",".timezone",_.bind(this.update,this)),this._$element=i}},update:function(e){for(var t=e.target.value,n=null,r=0;r<e.target.classList.length;r++)n=e.target.classList[r];if(null!==n){var o=JSON.parse(this._$element.val()),a=moment(o[0].split(" ",2)[0],"H:m Z"),i=moment(o[1].split(" ",2)[0],"H:m Z"),l=o[0].split(" ",2)[1];if("start"===n||"end"===n){var s=moment(t,["H:m","h:m a"],!0).format("HH:mm");if("Invalid date"===s)return;var u=0;"end"===n&&(u=1),o[u]=s+" "+l}"timezone"===n&&(o[0]=a.format("HH:mm")+" "+t,o[1]=i.format("HH:mm")+" "+t),this._$element.val(JSON.stringify(o)),this._$element.trigger("change")}else console.warn("update triggered but element doesn't have any class")}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestTimePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestURLPlugin={predefinedValues:["webdav"],getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestURL",name:t("workflowengine","Request URL"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestURL"===n.class){var r="https://localhost/index.php";if("matches"!==n.operator&&"!matches"!==n.operator||(r="/^https\\:\\/\\/localhost\\/index\\.php$/i"),$(e).css("width","250px").attr("placeholder",r).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:r})).addClass("has-tooltip").tooltip({placement:"bottom"}),"matches"===n.operator||"!matches"===n.operator)this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input");else{var o=this,a=[{text:t("workflowengine","Predefined URLs"),children:[{id:"webdav",text:t("workflowengine","Files WebDAV")}]}];-1===this.predefinedValues.indexOf(n.value)&&a.unshift({id:n.value,text:n.value}),$(e).select2({data:a,createSearchChoice:function(e){if(-1===o.predefinedValues.indexOf(n.value))return{id:e,text:e}},id:function(e){return e.id},formatResult:function(e){return e.text},formatSelection:function(e){return e.text},escapeMarkup:function(e){return e}})}}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestURLPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestUserAgentPlugin={predefinedValues:["android","ios","desktop"],getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestUserAgent",name:t("workflowengine","Request user agent"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestUserAgent"===n.class){var r="Mozilla/5.0 User Agent";if("matches"!==n.operator&&"!matches"!==n.operator||(r="/^Mozilla\\/5\\.0 (.*)$/i"),$(e).css("width","250px").attr("placeholder",r).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:r})).addClass("has-tooltip").tooltip({placement:"bottom"}),"matches"===n.operator||"!matches"===n.operator)this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input");else{var o=this,a=[{text:t("workflowengine","Sync clients"),children:[{id:"android",text:t("workflowengine","Android client")},{id:"ios",text:t("workflowengine","iOS client")},{id:"desktop",text:t("workflowengine","Desktop client")},{id:"mail",text:t("workflowengine","Thunderbird & Outlook addons")}]}];-1===this.predefinedValues.indexOf(n.value)&&a.unshift({id:n.value,text:n.value}),$(e).select2({data:a,createSearchChoice:function(e){if(-1===o.predefinedValues.indexOf(n.value))return{id:e,text:e}},id:function(e){return e.id},formatResult:function(e){return e.text},formatSelection:function(e){return e.text},escapeMarkup:function(e){return e}})}}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestUserAgentPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\UserGroupMembership",name:t("workflowengine","User group membership"),operators:[{operator:"is",name:t("workflowengine","is member of")},{operator:"!is",name:t("workflowengine","is not member of")}]}},render:function(e,t,n){"OCA\\WorkflowEngine\\Check\\UserGroupMembership"===t.class&&($(e).css("width","400px"),$(e).select2({data:{results:n,text:"displayname"},initSelection:function(e,t){var r=e.val();r&&n.length>0?t({id:r,displayname:n.find(function(e){return e.id===r}).displayname}):r?t({id:r,displayname:r}):t()},formatResult:function(e){return"<span>"+escapeHTML(e.displayname)+"</span>"},formatSelection:function(e){return'<span title="'+escapeHTML(e.id)+'">'+escapeHTML(e.displayname)+"</span>"}}))}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin)},function(e,n,r){"use strict";r.r(n);var o=r(5),a=r.n(o),i=r(6),l=r.n(i);OCA.WorkflowEngine=_.extend(OCA.WorkflowEngine||{},{availablePlugins:[],availableChecks:[],getCheckByClass:function(e){for(var t=OCA.WorkflowEngine.availableChecks.length,n=0;n<t;n++)if(OCA.WorkflowEngine.availableChecks[n].class===e)return OCA.WorkflowEngine.availableChecks[n]}}),OCA.WorkflowEngine.Operation=OC.Backbone.Model.extend({defaults:{class:"OCA\\WorkflowEngine\\Operation",name:"",checks:[],operation:""}}),OCA.WorkflowEngine.OperationsCollection=OC.Backbone.Collection.extend({model:OCA.WorkflowEngine.Operation,url:OC.generateUrl("apps/workflowengine/operations")}),OCA.WorkflowEngine.OperationView=OC.Backbone.View.extend({templateId:"#operation-template",events:{"change .check-class":"checkChanged","change .check-operator":"checkChanged","change .check-value":"checkChanged","change .operation-name":"operationChanged","change .operation-operation":"operationChanged","click .button-reset":"reset","click .button-save":"save","click .button-add":"add","click .button-delete":"delete","click .button-delete-check":"deleteCheck"},originalModel:null,hasChanged:!1,message:"",errorMessage:"",saving:!1,groups:[],template:function(e){return a()(_.extend({shortRuleDescTXT:t("workflowengine","Short rule description"),addRuleTXT:t("workflowengine","Add rule"),resetTXT:t("workflowengine","Reset"),saveTXT:t("workflowengine","Save"),savingTXT:t("workflowengine","Saving…")},e))},initialize:function(){this.originalModel=JSON.parse(JSON.stringify(this.model)),this.model.on("change",function(){console.log("model changed"),this.hasChanged=!0,this.render()},this),void 0===this.model.get("id")&&(this.hasChanged=!0);var e=this;$.ajax({url:OC.linkToOCS("cloud/groups",2)+"details",dataType:"json",quietMillis:100}).success(function(n){n.ocs.data.groups&&n.ocs.data.groups.length>0?(n.ocs.data.groups.forEach(function(t){e.groups.push({id:t.id,displayname:t.displayname})}),e.render()):(OC.Notification.error(t("workflowengine","Group list is empty"),{type:"error"}),console.log(n))}).error(function(e){OC.Notification.error(t("workflowengine","Unable to retrieve the group list"),{type:"error"}),console.log(e)})},delete:function(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.delete,this)):(this.model.destroy(),this.remove())},reset:function(){this.hasChanged=!1,this.model.set(this.originalModel,{silent:!0}),this.render()},save:function(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.save,this)):(this.hasChanged=!1,this.saving=!0,this.render(),this.model.save(null,{success:function(e,n,r){this.saving=!1,this.originalModel=JSON.parse(JSON.stringify(this.model)),this.message=t("workflowengine","Saved"),this.errorMessage="",this.render()},error:function(e,n,r){this.saving=!1,this.hasChanged=!0,this.message=t("workflowengine","Saving failed:"),this.errorMessage=n.responseText,this.render()},context:this}))},add:function(){var e=_.clone(this.model.get("checks")),t=OCA.WorkflowEngine.availableChecks[0].class,n=OCA.WorkflowEngine.availableChecks[0].operators;e.push({class:t,operator:n[0].operator,value:""}),this.model.set({checks:e})},checkChanged:function(e){for(var t=e.target.value,n=$(e.target.parentElement).data("id"),r=JSON.parse(JSON.stringify(this.model.get("checks"))),o=null,a=0;a<e.target.classList.length;a++){var i=e.target.classList[a];if("check-"===i.substr(0,"check-".length)){o=i.substr("check-".length);break}}if(null!==o)if(_.has(r[n],o)){if(r[n][o]=t,"class"===o){var l=OCA.WorkflowEngine.getCheckByClass(t);_.isUndefined(l)||(r[n].operator=l.operators[0].operator,r[n].value="")}this.model.set({checks:r})}else console.warn('key "'+o+'" is not available in check',l);else console.warn('checkChanged triggered but element doesn\'t have any "check-" class')},deleteCheck:function(e){console.log(arguments);var t=$(e.target.parentElement).data("id"),n=JSON.parse(JSON.stringify(this.model.get("checks")));n.splice(t,1),this.model.set({checks:n})},operationChanged:function(e){for(var t=e.target.value,n=null,r=0;r<e.target.classList.length;r++){var o=e.target.classList[r];if("operation-"===o.substr(0,"operation-".length)){n=o.substr("operation-".length);break}}null!==n?"name"===n||"operation"===n?this.model.set(n,t):console.warn('key "'+n+'" is no valid attribute'):console.warn('operationChanged triggered but element doesn\'t have any "operation-" class')},render:function(){this.$el.html(this.template({operation:this.model.toJSON(),classes:OCA.WorkflowEngine.availableChecks,hasChanged:this.hasChanged,message:this.message,errorMessage:this.errorMessage,saving:this.saving}));var e=this.model.get("checks");return _.each(this.$el.find(".check"),function(t){var n=$(t),r=n.data("id"),o=e[r],a=n.find(".check-value").first(),i=this;_.each(OCA.WorkflowEngine.availablePlugins,function(e){_.isFunction(e.render)&&e.render(a,o,i.groups)})},this),""!==this.message&&(_.delay(function(e){$(e).css("opacity",0)},7e3,this.$el.find(".msg.success")),this.message=""),this.$el}}),OCA.WorkflowEngine.OperationsView=OC.Backbone.View.extend({templateId:"#operations-template",collection:null,$el:null,events:{"click .button-add-operation":"add"},template:function(e){return l()(_.extend({addRuleGroupTXT:t("workflowengine","Add rule group")},e))},initialize:function(e){OCA.WorkflowEngine.availablePlugins.length||(OCA.WorkflowEngine.availablePlugins=OC.Plugins.getPlugins("OCA.WorkflowEngine.CheckPlugins"),_.each(OCA.WorkflowEngine.availablePlugins,function(t){_.isFunction(t.getCheck)&&OCA.WorkflowEngine.availableChecks.push(t.getCheck(e))})),this.collection.fetch({data:{class:e}}),this.collection.once("sync",this.render,this)},add:function(){var e=this.collection.create();this.renderOperation(e)},renderOperation:function(e){this.$el.find(".operations").append(e.$el),e.render()},render:function(){this.$el.html(this.template()),this.collection.each(this.renderOperation,this)}});r(24),r(25),r(26),r(27),r(28),r(29),r(30),r(31),r(32);window.OCA.WorkflowEngine=OCA.WorkflowEngine}]);
+!function(e){var t={};function n(a){if(t[a])return t[a].exports;var r=t[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(a,r,function(t){return e[t]}.bind(null,r));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/js/",n(n.s=31)}([function(e,t,n){"use strict";t.__esModule=!0,t.extend=i,t.indexOf=function(e,t){for(var n=0,a=e.length;n<a;n++)if(e[n]===t)return n;return-1},t.escapeExpression=function(e){if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML();if(null==e)return"";if(!e)return e+"";e=""+e}if(!l.test(e))return e;return e.replace(r,o)},t.isEmpty=function(e){return!e&&0!==e||!(!u(e)||0!==e.length)},t.createFrame=function(e){var t=i({},e);return t._parent=e,t},t.blockParams=function(e,t){return e.path=t,e},t.appendContextPath=function(e,t){return(e?e+".":"")+t};var a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},r=/[&<>"'`=]/g,l=/[&<>"'`=]/;function o(e){return a[e]}function i(e){for(var t=1;t<arguments.length;t++)for(var n in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],n)&&(e[n]=arguments[t][n]);return e}var s=Object.prototype.toString;t.toString=s;var c=function(e){return"function"==typeof e};c(/x/)&&(t.isFunction=c=function(e){return"function"==typeof e&&"[object Function]"===s.call(e)}),t.isFunction=c;var u=Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===s.call(e)};t.isArray=u},function(e,t,n){"use strict";t.__esModule=!0;var a=["description","fileName","lineNumber","message","name","number","stack"];function r(e,t){var n=t&&t.loc,l=void 0,o=void 0;n&&(e+=" - "+(l=n.start.line)+":"+(o=n.start.column));for(var i=Error.prototype.constructor.call(this,e),s=0;s<a.length;s++)this[a[s]]=i[a[s]];Error.captureStackTrace&&Error.captureStackTrace(this,r);try{n&&(this.lineNumber=l,Object.defineProperty?Object.defineProperty(this,"column",{value:o,enumerable:!0}):this.column=o)}catch(e){}}r.prototype=new Error,t.default=r,e.exports=t.default},function(e,t,n){e.exports=n(6).default},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=c;var r=n(0),l=a(n(1)),o=n(7),i=n(15),s=a(n(17));t.VERSION="4.1.2";t.COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};function c(e,t,n){this.helpers=e||{},this.partials=t||{},this.decorators=n||{},o.registerDefaultHelpers(this),i.registerDefaultDecorators(this)}c.prototype={constructor:c,logger:s.default,log:s.default.log,registerHelper:function(e,t){if("[object Object]"===r.toString.call(e)){if(t)throw new l.default("Arg not supported with multiple helpers");r.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===r.toString.call(e))r.extend(this.partials,e);else{if(void 0===t)throw new l.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if("[object Object]"===r.toString.call(e)){if(t)throw new l.default("Arg not supported with multiple decorators");r.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]}};var u=s.default.log;t.log=u,t.createFrame=r.createFrame,t.logger=s.default},function(e,t,n){var a=n(2);e.exports=(a.default||a).template({compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){return'var Handlebars = require("../../../../node_modules/handlebars/runtime.js");\nfunction __default(obj) { return obj && (obj.__esModule ? obj["default"] : obj); }\nmodule.exports = (Handlebars["default"] || Handlebars).template({"1":function(container,depth0,helpers,partials,data) {\n return " modified";\n},"3":function(container,depth0,helpers,partials,data) {\n return "\t\t\t<span class=\\"button-delete icon-delete\\"></span>\\n";\n},"5":function(container,depth0,helpers,partials,data,blockParams,depths) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;\n\n return "\t\t\t<div class=\\"check\\" data-id=\\""\n + alias4(((helper = (helper = helpers.index || (data && data.index)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"index","hash":{},"data":data}) : helper)))\n + "\\">\\n\t\t\t\t<select class=\\"check-class\\">\\n"\n + ((stack1 = helpers.each.call(alias1,(depths[1] != null ? depths[1].classes : depths[1]),{"name":"each","hash":{},"fn":container.program(6, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")\n + "\t\t\t\t</select>\\n\t\t\t\t<select class=\\"check-operator\\">\\n"\n + ((stack1 = helpers.each.call(alias1,(helpers.getOperators || (depth0 && depth0.getOperators) || alias2).call(alias1,(depth0 != null ? depth0["class"] : depth0),{"name":"getOperators","hash":{},"data":data}),{"name":"each","hash":{},"fn":container.program(8, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")\n + "\t\t\t\t</select>\\n\t\t\t\t<input type=\\"text\\" class=\\"check-value\\" value=\\""\n + alias4(((helper = (helper = helpers.value || (depth0 != null ? depth0.value : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"value","hash":{},"data":data}) : helper)))\n + "\\">\\n\t\t\t\t<span class=\\"button-delete-check icon-delete\\"></span>\\n\t\t\t</div>\\n";\n},"6":function(container,depth0,helpers,partials,data,blockParams,depths) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;\n\n return "\t\t\t\t\t\t<option value=\\""\n + alias4(((helper = (helper = helpers["class"] || (depth0 != null ? depth0["class"] : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"class","hash":{},"data":data}) : helper)))\n + "\\" "\n + ((stack1 = (helpers.selectItem || (depth0 && depth0.selectItem) || alias2).call(alias1,(depth0 != null ? depth0["class"] : depth0),(depths[1] != null ? depths[1]["class"] : depths[1]),{"name":"selectItem","hash":{},"data":data})) != null ? stack1 : "")\n + ">"\n + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))\n + "</option>\\n";\n},"8":function(container,depth0,helpers,partials,data,blockParams,depths) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;\n\n return "\t\t\t\t\t\t<option value=\\""\n + alias4(((helper = (helper = helpers.operator || (depth0 != null ? depth0.operator : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"operator","hash":{},"data":data}) : helper)))\n + "\\" "\n + ((stack1 = (helpers.selectItem || (depth0 && depth0.selectItem) || alias2).call(alias1,(depth0 != null ? depth0.operator : depth0),(depths[1] != null ? depths[1].operator : depths[1]),{"name":"selectItem","hash":{},"data":data})) != null ? stack1 : "")\n + ">"\n + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))\n + "</option>\\n";\n},"10":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});\n\n return ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.id : stack1),{"name":"if","hash":{},"fn":container.program(11, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")\n + "\t\t<button class=\\"button-save pull-right\\">"\n + container.escapeExpression(((helper = (helper = helpers.saveTXT || (depth0 != null ? depth0.saveTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"saveTXT","hash":{},"data":data}) : helper)))\n + "</button>\\n";\n},"11":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return "\t\t\t<button class=\\"button-reset pull-right\\">"\n + container.escapeExpression(((helper = (helper = helpers.resetTXT || (depth0 != null ? depth0.resetTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"resetTXT","hash":{},"data":data}) : helper)))\n + "</button>\\n";\n},"13":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return "\t\t<span class=\\"icon-loading-small pull-right\\"></span>\\n\t\t<span class=\\"pull-right\\">"\n + container.escapeExpression(((helper = (helper = helpers.savingTXT || (depth0 != null ? depth0.savingTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"savingTXT","hash":{},"data":data}) : helper)))\n + "</span>\\n\t";\n},"15":function(container,depth0,helpers,partials,data) {\n var stack1;\n\n return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.message : depth0),{"name":"if","hash":{},"fn":container.program(16, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "");\n},"16":function(container,depth0,helpers,partials,data) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});\n\n return "\\n\t\t<span class=\\"msg pull-right "\n + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.errorMessage : depth0),{"name":"if","hash":{},"fn":container.program(17, data, 0),"inverse":container.program(19, data, 0),"data":data})) != null ? stack1 : "")\n + "\\">\\n\t\t\t\t\t"\n + container.escapeExpression(((helper = (helper = helpers.message || (depth0 != null ? depth0.message : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"message","hash":{},"data":data}) : helper)))\n + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.errorMessage : depth0),{"name":"if","hash":{},"fn":container.program(21, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")\n + "\\n\t\t\t\t</span>\\n\t";\n},"17":function(container,depth0,helpers,partials,data) {\n return "error";\n},"19":function(container,depth0,helpers,partials,data) {\n return "success";\n},"21":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return " "\n + container.escapeExpression(((helper = (helper = helpers.errorMessage || (depth0 != null ? depth0.errorMessage : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"errorMessage","hash":{},"data":data}) : helper)));\n},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) {\n var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression, alias5=container.lambda;\n\n return "<div class=\\"operation"\n + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasChanged : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")\n + "\\">\\n\t<div class=\\"operation-header\\">\\n\t\t<input type=\\"text\\" class=\\"operation-name\\" placeholder=\\""\n + alias4(((helper = (helper = helpers.shortRuleDescTXT || (depth0 != null ? depth0.shortRuleDescTXT : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"shortRuleDescTXT","hash":{},"data":data}) : helper)))\n + "\\" value=\\""\n + alias4(alias5(((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.name : stack1), depth0))\n + "\\" />\\n\t\t<input type=\\"text\\" class=\\"operation-operation\\" value=\\""\n + alias4(alias5(((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.operation : stack1), depth0))\n + "\\" />\\n"\n + ((stack1 = helpers["if"].call(alias1,((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.id : stack1),{"name":"if","hash":{},"fn":container.program(3, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")\n + "\t</div>\\n\\n\t<div class=\\"checks\\">\\n"\n + ((stack1 = helpers.each.call(alias1,((stack1 = (depth0 != null ? depth0.operation : depth0)) != null ? stack1.checks : stack1),{"name":"each","hash":{},"fn":container.program(5, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")\n + "\t</div>\\n\t<button class=\\"button-add\\">"\n + alias4(((helper = (helper = helpers.addRuleTXT || (depth0 != null ? depth0.addRuleTXT : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addRuleTXT","hash":{},"data":data}) : helper)))\n + "</button>\\n"\n + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.hasChanged : depth0),{"name":"if","hash":{},"fn":container.program(10, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")\n + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.saving : depth0),{"name":"if","hash":{},"fn":container.program(13, data, 0, blockParams, depths),"inverse":container.program(15, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")\n + "\\n</div>\\n";\n},"useData":true,"useDepths":true});'},useData:!0})},function(e,t,n){var a=n(2);e.exports=(a.default||a).template({compiler:[7,">= 4.0.0"],main:function(e,t,n,a,r){return'var Handlebars = require("../../../../node_modules/handlebars/runtime.js");\nfunction __default(obj) { return obj && (obj.__esModule ? obj["default"] : obj); }\nmodule.exports = (Handlebars["default"] || Handlebars).template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {\n var helper;\n\n return "<div class=\\"operations\\"></div>\\n<button class=\\"button-add-operation\\">"\n + container.escapeExpression(((helper = (helper = helpers.addRuleGroupTXT || (depth0 != null ? depth0.addRuleGroupTXT : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"addRuleGroupTXT","hash":{},"data":data}) : helper)))\n + "</button>\\n";\n},"useData":true});'},useData:!0})},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}t.__esModule=!0;var l=r(n(3)),o=a(n(18)),i=a(n(1)),s=r(n(0)),c=r(n(19)),u=a(n(20));function p(){var e=new l.HandlebarsEnvironment;return s.extend(e,l),e.SafeString=o.default,e.Exception=i.default,e.Utils=s,e.escapeExpression=s.escapeExpression,e.VM=c,e.template=function(t){return c.template(t,e)},e}var d=p();d.create=p,u.default(d),d.default=d,t.default=d,e.exports=t.default},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.registerDefaultHelpers=function(e){r.default(e),l.default(e),o.default(e),i.default(e),s.default(e),c.default(e),u.default(e)};var r=a(n(8)),l=a(n(9)),o=a(n(10)),i=a(n(11)),s=a(n(12)),c=a(n(13)),u=a(n(14))},function(e,t,n){"use strict";t.__esModule=!0;var a=n(0);t.default=function(e){e.registerHelper("blockHelperMissing",function(t,n){var r=n.inverse,l=n.fn;if(!0===t)return l(this);if(!1===t||null==t)return r(this);if(a.isArray(t))return t.length>0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):r(this);if(n.data&&n.ids){var o=a.createFrame(n.data);o.contextPath=a.appendContextPath(n.data.contextPath,n.name),n={data:o}}return l(t,n)})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var a,r=n(0),l=n(1),o=(a=l)&&a.__esModule?a:{default:a};t.default=function(e){e.registerHelper("each",function(e,t){if(!t)throw new o.default("Must pass iterator to #each");var n=t.fn,a=t.inverse,l=0,i="",s=void 0,c=void 0;function u(t,a,l){s&&(s.key=t,s.index=a,s.first=0===a,s.last=!!l,c&&(s.contextPath=c+t)),i+=n(e[t],{data:s,blockParams:r.blockParams([e[t],t],[c+t,null])})}if(t.data&&t.ids&&(c=r.appendContextPath(t.data.contextPath,t.ids[0])+"."),r.isFunction(e)&&(e=e.call(this)),t.data&&(s=r.createFrame(t.data)),e&&"object"==typeof e)if(r.isArray(e))for(var p=e.length;l<p;l++)l in e&&u(l,l,l===e.length-1);else{var d=void 0;for(var h in e)e.hasOwnProperty(h)&&(void 0!==d&&u(d,l-1),d=h,l++);void 0!==d&&u(d,l-1,!0)}return 0===l&&(i=a(this)),i})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var a,r=n(1),l=(a=r)&&a.__esModule?a:{default:a};t.default=function(e){e.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new l.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var a=n(0);t.default=function(e){e.registerHelper("if",function(e,t){return a.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||a.isEmpty(e)?t.inverse(this):t.fn(this)}),e.registerHelper("unless",function(t,n){return e.helpers.if.call(this,t,{fn:n.inverse,inverse:n.fn,hash:n.hash})})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",function(){for(var t=[void 0],n=arguments[arguments.length-1],a=0;a<arguments.length-1;a++)t.push(arguments[a]);var r=1;null!=n.hash.level?r=n.hash.level:n.data&&null!=n.data.level&&(r=n.data.level),t[0]=r,e.log.apply(e,t)})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("lookup",function(e,t){return e?"constructor"!==t||e.propertyIsEnumerable(t)?e[t]:void 0:e})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var a=n(0);t.default=function(e){e.registerHelper("with",function(e,t){a.isFunction(e)&&(e=e.call(this));var n=t.fn;if(a.isEmpty(e))return t.inverse(this);var r=t.data;return t.data&&t.ids&&((r=a.createFrame(t.data)).contextPath=a.appendContextPath(t.data.contextPath,t.ids[0])),n(e,{data:r,blockParams:a.blockParams([e],[r&&r.contextPath])})})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){l.default(e)};var a,r=n(16),l=(a=r)&&a.__esModule?a:{default:a}},function(e,t,n){"use strict";t.__esModule=!0;var a=n(0);t.default=function(e){e.registerDecorator("inline",function(e,t,n,r){var l=e;return t.partials||(t.partials={},l=function(r,l){var o=n.partials;n.partials=a.extend({},o,t.partials);var i=e(r,l);return n.partials=o,i}),t.partials[r.args[0]]=r.fn,l})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var a=n(0),r={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=a.indexOf(r.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=r.lookupLevel(e),"undefined"!=typeof console&&r.lookupLevel(r.level)<=e){var t=r.methodMap[e];console[t]||(t="log");for(var n=arguments.length,a=Array(n>1?n-1:0),l=1;l<n;l++)a[l-1]=arguments[l];console[t].apply(console,a)}}};t.default=r,e.exports=t.default},function(e,t,n){"use strict";function a(e){this.string=e}t.__esModule=!0,a.prototype.toString=a.prototype.toHTML=function(){return""+this.string},t.default=a,e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,n=i.COMPILER_REVISION;if(t!==n){if(t<n){var a=i.REVISION_CHANGES[n],r=i.REVISION_CHANGES[t];throw new o.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+a+") or downgrade your runtime to an older version ("+r+").")}throw new o.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}},t.template=function(e,t){if(!t)throw new o.default("No environment passed to template");if(!e||!e.main)throw new o.default("Unknown template object: "+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var n={strict:function(e,t){if(!(t in e))throw new o.default('"'+t+'" not defined in '+e);return e[t]},lookup:function(e,t){for(var n=e.length,a=0;a<n;a++)if(e[a]&&null!=e[a][t])return e[a][t]},lambda:function(e,t){return"function"==typeof e?e.call(t):e},escapeExpression:r.escapeExpression,invokePartial:function(n,a,l){l.hash&&(a=r.extend({},a,l.hash),l.ids&&(l.ids[0]=!0));n=t.VM.resolvePartial.call(this,n,a,l);var i=t.VM.invokePartial.call(this,n,a,l);null==i&&t.compile&&(l.partials[l.name]=t.compile(n,e.compilerOptions,t),i=l.partials[l.name](a,l));if(null!=i){if(l.indent){for(var s=i.split("\n"),c=0,u=s.length;c<u&&(s[c]||c+1!==u);c++)s[c]=l.indent+s[c];i=s.join("\n")}return i}throw new o.default("The partial "+l.name+" could not be compiled when running in runtime-only mode")},fn:function(t){var n=e[t];return n.decorator=e[t+"_d"],n},programs:[],program:function(e,t,n,a,r){var l=this.programs[e],o=this.fn(e);return t||r||a||n?l=s(this,e,o,t,n,a,r):l||(l=this.programs[e]=s(this,e,o)),l},data:function(e,t){for(;e&&t--;)e=e._parent;return e},merge:function(e,t){var n=e||t;return e&&t&&e!==t&&(n=r.extend({},t,e)),n},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function a(t){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],l=r.data;a._setup(r),!r.partial&&e.useData&&(l=function(e,t){t&&"root"in t||((t=t?i.createFrame(t):{}).root=e);return t}(t,l));var o=void 0,s=e.useBlockParams?[]:void 0;function c(t){return""+e.main(n,t,n.helpers,n.partials,l,s,o)}return e.useDepths&&(o=r.depths?t!=r.depths[0]?[t].concat(r.depths):r.depths:[t]),(c=u(e.main,c,n,r.depths||[],l,s))(t,r)}return a.isTop=!0,a._setup=function(a){a.partial?(n.helpers=a.helpers,n.partials=a.partials,n.decorators=a.decorators):(n.helpers=n.merge(a.helpers,t.helpers),e.usePartial&&(n.partials=n.merge(a.partials,t.partials)),(e.usePartial||e.useDecorators)&&(n.decorators=n.merge(a.decorators,t.decorators)))},a._child=function(t,a,r,l){if(e.useBlockParams&&!r)throw new o.default("must pass block params");if(e.useDepths&&!l)throw new o.default("must pass parent depths");return s(n,t,e[t],a,0,r,l)},a},t.wrapProgram=s,t.resolvePartial=function(e,t,n){e?e.call||n.name||(n.name=e,e=n.partials[e]):e="@partial-block"===n.name?n.data["partial-block"]:n.partials[n.name];return e},t.invokePartial=function(e,t,n){var a=n.data&&n.data["partial-block"];n.partial=!0,n.ids&&(n.data.contextPath=n.ids[0]||n.data.contextPath);var l=void 0;n.fn&&n.fn!==c&&function(){n.data=i.createFrame(n.data);var e=n.fn;l=n.data["partial-block"]=function(t){var n=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return n.data=i.createFrame(n.data),n.data["partial-block"]=a,e(t,n)},e.partials&&(n.partials=r.extend({},n.partials,e.partials))}();void 0===e&&l&&(e=l);if(void 0===e)throw new o.default("The partial "+n.name+" could not be found");if(e instanceof Function)return e(t,n)},t.noop=c;var a,r=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(0)),l=n(1),o=(a=l)&&a.__esModule?a:{default:a},i=n(3);function s(e,t,n,a,r,l,o){function i(t){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],i=o;return!o||t==o[0]||t===e.nullContext&&null===o[0]||(i=[t].concat(o)),n(e,t,e.helpers,e.partials,r.data||a,l&&[r.blockParams].concat(l),i)}return(i=u(n,i,e,o,a,l)).program=t,i.depth=o?o.length:0,i.blockParams=r||0,i}function c(){return""}function u(e,t,n,a,l,o){if(e.decorator){var i={};t=e.decorator(t,i,n,a&&a[0],l,o,a),r.extend(t,i)}return t}},function(e,t,n){"use strict";(function(n){t.__esModule=!0,t.default=function(e){var t=void 0!==n?n:window,a=t.Handlebars;e.noConflict=function(){return t.Handlebars===e&&(t.Handlebars=a),e}},e.exports=t.default}).call(this,n(21))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileMimeTypePlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\FileMimeType",name:t("workflowengine","File MIME type"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\FileMimeType"===n.class){var a="text/plain";"matches"!==n.operator&&"!matches"!==n.operator||(a="/^text\\/(plain|html)$/i",this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input")),$(e).css("width","250px").attr("placeholder",a).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:a})).addClass("has-tooltip").tooltip({placement:"bottom"})}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileMimeTypePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileNamePlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\FileName",name:t("workflowengine","File name"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\FileName"===n.class){var a="dummy.jpg";"matches"!==n.operator&&"!matches"!==n.operator||(a="/^dummy-.+$/i",this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input")),$(e).css("width","250px").attr("placeholder",a).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:a})).addClass("has-tooltip").tooltip({placement:"bottom"})}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileNamePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileSizePlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\FileSize",name:t("workflowengine","File size (upload)"),operators:[{operator:"less",name:t("workflowengine","less")},{operator:"!greater",name:t("workflowengine","less or equals")},{operator:"!less",name:t("workflowengine","greater or equals")},{operator:"greater",name:t("workflowengine","greater")}]}},render:function(e,n){"OCA\\WorkflowEngine\\Check\\FileSize"===n.class&&$(e).css("width","250px").attr("placeholder","12 MB").attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"12 MB"})).addClass("has-tooltip").tooltip({placement:"bottom"})}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileSizePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin={getCheck:function(){return this.collection=OC.SystemTags.collection,{class:"OCA\\WorkflowEngine\\Check\\FileSystemTags",name:t("workflowengine","File system tag"),operators:[{operator:"is",name:t("workflowengine","is tagged with")},{operator:"!is",name:t("workflowengine","is not tagged with")}]}},render:function(e,n){"OCA\\WorkflowEngine\\Check\\FileSystemTags"===n.class&&($(e).css("width","400px"),$(e).select2({allowClear:!1,multiple:!1,placeholder:t("workflowengine","Select tag…"),query:_.debounce(function(e){e.callback({results:OC.SystemTags.collection.filterByName(e.term)})},100,!0),id:function(e){return e.get("id")},initSelection:function(e,t){t($(e).val())},formatResult:function(e){return OC.SystemTags.getDescriptiveTag(e)},formatSelection:function(e){var t=OC.SystemTags.collection.get(e);if(!_.isUndefined(t))return OC.SystemTags.getDescriptiveTag(t)},escapeMarkup:function(e){return e}}))}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestRemoteAddressPlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestRemoteAddress",name:t("workflowengine","Request remote address"),operators:[{operator:"matchesIPv4",name:t("workflowengine","matches IPv4")},{operator:"!matchesIPv4",name:t("workflowengine","does not match IPv4")},{operator:"matchesIPv6",name:t("workflowengine","matches IPv6")},{operator:"!matchesIPv6",name:t("workflowengine","does not match IPv6")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestRemoteAddress"===n.class){var a="127.0.0.1/32";"matchesIPv6"===n.operator||"!matchesIPv6"===n.operator?(a="::1/128",this._validateIPv6(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input")):this._validateIPv4(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input"),$(e).css("width","300px").attr("placeholder",a).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:a})).addClass("has-tooltip").tooltip({placement:"bottom"})}},_validateIPv4:function(e){return null!==/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/(3[0-2]|[1-2][0-9]|[1-9])$/.exec(e)},_validateIPv6:function(e){return null!==/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(1([01][0-9]|2[0-8])|[1-9][0-9]|[0-9])$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestRemoteAddressPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestTimePlugin={timezones:["Europe/Berlin","Europe/London"],_$element:null,getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestTime",name:t("workflowengine","Request time"),operators:[{operator:"in",name:t("workflowengine","between")},{operator:"!in",name:t("workflowengine","not between")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestTime"===n.class){var a="09:00",r="18:00",l=jstz.determine().name(),o=$(e);if(_.isString(n.value)&&""!==n.value){var i=JSON.parse(n.value),s=i[0].split(" ",2),c=i[1].split(" ",2);a=s[0],r=c[0],l=s[1]}var u=JSON.stringify([a+" "+l,r+" "+l]);n.value!==u&&(n.value=u,o.val(u)),o.css("display","none"),$("<input>").attr("type","text").attr("placeholder",t("workflowengine","Start")).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"16:00"})).addClass("has-tooltip").tooltip({placement:"bottom"}).addClass("start").val(a).insertBefore(o),$("<input>").attr("type","text").attr("placeholder",t("workflowengine","End")).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:"16:00"})).addClass("has-tooltip").tooltip({placement:"bottom"}).addClass("end").val(r).insertBefore(o);var p=$("<input>").attr("type","hidden").css("width","250px").insertBefore(o).val(l);p.select2({allowClear:!1,multiple:!1,placeholder:t("workflowengine","Select timezone…"),ajax:{url:OC.generateUrl("apps/workflowengine/timezones"),dataType:"json",quietMillis:100,data:function(e){return""===e&&(e=(e=jstz.determine().name().split("/"))[0]),{search:e}},results:function(e){var t=[];return $.each(e,function(e){t.push({id:e})}),{results:t,more:!1}}},initSelection:function(e,t){t(e.val())},formatResult:function(e){return"<span>"+e.id+"</span>"},formatSelection:function(e){return _.isUndefined(e.id)||(e=e.id),"<span>"+e+"</span>"}}),p.addClass("timezone"),o.parent().on("change",".start",_.bind(this.update,this)).on("change",".end",_.bind(this.update,this)).on("change",".timezone",_.bind(this.update,this)),this._$element=o}},update:function(e){for(var t=e.target.value,n=null,a=0;a<e.target.classList.length;a++)n=e.target.classList[a];if(null!==n){var r=JSON.parse(this._$element.val()),l=moment(r[0].split(" ",2)[0],"H:m Z"),o=moment(r[1].split(" ",2)[0],"H:m Z"),i=r[0].split(" ",2)[1];if("start"===n||"end"===n){var s=moment(t,["H:m","h:m a"],!0).format("HH:mm");if("Invalid date"===s)return;var c=0;"end"===n&&(c=1),r[c]=s+" "+i}"timezone"===n&&(r[0]=l.format("HH:mm")+" "+t,r[1]=o.format("HH:mm")+" "+t),this._$element.val(JSON.stringify(r)),this._$element.trigger("change")}else console.warn("update triggered but element doesn't have any class")}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestTimePlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestURLPlugin={predefinedValues:["webdav"],getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestURL",name:t("workflowengine","Request URL"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestURL"===n.class){var a="https://localhost/index.php";if("matches"!==n.operator&&"!matches"!==n.operator||(a="/^https\\:\\/\\/localhost\\/index\\.php$/i"),$(e).css("width","250px").attr("placeholder",a).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:a})).addClass("has-tooltip").tooltip({placement:"bottom"}),"matches"===n.operator||"!matches"===n.operator)this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input");else{var r=this,l=[{text:t("workflowengine","Predefined URLs"),children:[{id:"webdav",text:t("workflowengine","Files WebDAV")}]}];-1===this.predefinedValues.indexOf(n.value)&&l.unshift({id:n.value,text:n.value}),$(e).select2({data:l,createSearchChoice:function(e){if(-1===r.predefinedValues.indexOf(n.value))return{id:e,text:e}},id:function(e){return e.id},formatResult:function(e){return e.text},formatSelection:function(e){return e.text},escapeMarkup:function(e){return e}})}}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestURLPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.RequestUserAgentPlugin={predefinedValues:["android","ios","desktop"],getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\RequestUserAgent",name:t("workflowengine","Request user agent"),operators:[{operator:"is",name:t("workflowengine","is")},{operator:"!is",name:t("workflowengine","is not")},{operator:"matches",name:t("workflowengine","matches")},{operator:"!matches",name:t("workflowengine","does not match")}]}},render:function(e,n){if("OCA\\WorkflowEngine\\Check\\RequestUserAgent"===n.class){var a="Mozilla/5.0 User Agent";if("matches"!==n.operator&&"!matches"!==n.operator||(a="/^Mozilla\\/5\\.0 (.*)$/i"),$(e).css("width","250px").attr("placeholder",a).attr("title",t("workflowengine","Example: {placeholder}",{placeholder:a})).addClass("has-tooltip").tooltip({placement:"bottom"}),"matches"===n.operator||"!matches"===n.operator)this._validateRegex(n.value)?$(e).removeClass("invalid-input"):$(e).addClass("invalid-input");else{var r=this,l=[{text:t("workflowengine","Sync clients"),children:[{id:"android",text:t("workflowengine","Android client")},{id:"ios",text:t("workflowengine","iOS client")},{id:"desktop",text:t("workflowengine","Desktop client")},{id:"mail",text:t("workflowengine","Thunderbird & Outlook addons")}]}];-1===this.predefinedValues.indexOf(n.value)&&l.unshift({id:n.value,text:n.value}),$(e).select2({data:l,createSearchChoice:function(e){if(-1===r.predefinedValues.indexOf(n.value))return{id:e,text:e}},id:function(e){return e.id},formatResult:function(e){return e.text},formatSelection:function(e){return e.text},escapeMarkup:function(e){return e}})}}},_validateRegex:function(e){return null!==/^\/(.*)\/([gui]{0,3})$/.exec(e)}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.RequestUserAgentPlugin)},function(e,n){OCA.WorkflowEngine=OCA.WorkflowEngine||{},OCA.WorkflowEngine.Plugins=OCA.WorkflowEngine.Plugins||{},OCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin={getCheck:function(){return{class:"OCA\\WorkflowEngine\\Check\\UserGroupMembership",name:t("workflowengine","User group membership"),operators:[{operator:"is",name:t("workflowengine","is member of")},{operator:"!is",name:t("workflowengine","is not member of")}]}},render:function(e,t,n){"OCA\\WorkflowEngine\\Check\\UserGroupMembership"===t.class&&($(e).css("width","400px"),$(e).select2({data:{results:n,text:"displayname"},initSelection:function(e,t){var a=e.val();a&&n.length>0?t({id:a,displayname:n.find(function(e){return e.id===a}).displayname}):a?t({id:a,displayname:a}):t()},formatResult:function(e){return"<span>"+escapeHTML(e.displayname)+"</span>"},formatSelection:function(e){return'<span title="'+escapeHTML(e.id)+'">'+escapeHTML(e.displayname)+"</span>"}}))}},OC.Plugins.register("OCA.WorkflowEngine.CheckPlugins",OCA.WorkflowEngine.Plugins.UserGroupMembershipPlugin)},function(e,n,a){"use strict";a.r(n);var r=a(4),l=a.n(r),o=a(5),i=a.n(o);OCA.WorkflowEngine=_.extend(OCA.WorkflowEngine||{},{availablePlugins:[],availableChecks:[],getCheckByClass:function(e){for(var t=OCA.WorkflowEngine.availableChecks.length,n=0;n<t;n++)if(OCA.WorkflowEngine.availableChecks[n].class===e)return OCA.WorkflowEngine.availableChecks[n]}}),OCA.WorkflowEngine.Operation=OC.Backbone.Model.extend({defaults:{class:"OCA\\WorkflowEngine\\Operation",name:"",checks:[],operation:""}}),OCA.WorkflowEngine.OperationsCollection=OC.Backbone.Collection.extend({model:OCA.WorkflowEngine.Operation,url:OC.generateUrl("apps/workflowengine/operations")}),OCA.WorkflowEngine.OperationView=OC.Backbone.View.extend({templateId:"#operation-template",events:{"change .check-class":"checkChanged","change .check-operator":"checkChanged","change .check-value":"checkChanged","change .operation-name":"operationChanged","change .operation-operation":"operationChanged","click .button-reset":"reset","click .button-save":"save","click .button-add":"add","click .button-delete":"delete","click .button-delete-check":"deleteCheck"},originalModel:null,hasChanged:!1,message:"",errorMessage:"",saving:!1,groups:[],template:function(e){return l()(_.extend({shortRuleDescTXT:t("workflowengine","Short rule description"),addRuleTXT:t("workflowengine","Add rule"),resetTXT:t("workflowengine","Reset"),saveTXT:t("workflowengine","Save"),savingTXT:t("workflowengine","Saving…")},e))},initialize:function(){this.originalModel=JSON.parse(JSON.stringify(this.model)),this.model.on("change",function(){console.log("model changed"),this.hasChanged=!0,this.render()},this),void 0===this.model.get("id")&&(this.hasChanged=!0);var e=this;$.ajax({url:OC.linkToOCS("cloud/groups",2)+"details",dataType:"json",quietMillis:100}).success(function(n){n.ocs.data.groups&&n.ocs.data.groups.length>0?(n.ocs.data.groups.forEach(function(t){e.groups.push({id:t.id,displayname:t.displayname})}),e.render()):(OC.Notification.error(t("workflowengine","Group list is empty"),{type:"error"}),console.log(n))}).error(function(e){OC.Notification.error(t("workflowengine","Unable to retrieve the group list"),{type:"error"}),console.log(e)})},delete:function(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.delete,this)):(this.model.destroy(),this.remove())},reset:function(){this.hasChanged=!1,this.model.set(this.originalModel,{silent:!0}),this.render()},save:function(){OC.PasswordConfirmation.requiresPasswordConfirmation()?OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this.save,this)):(this.hasChanged=!1,this.saving=!0,this.render(),this.model.save(null,{success:function(e,n,a){this.saving=!1,this.originalModel=JSON.parse(JSON.stringify(this.model)),this.message=t("workflowengine","Saved"),this.errorMessage="",this.render()},error:function(e,n,a){this.saving=!1,this.hasChanged=!0,this.message=t("workflowengine","Saving failed:"),this.errorMessage=n.responseText,this.render()},context:this}))},add:function(){var e=_.clone(this.model.get("checks")),t=OCA.WorkflowEngine.availableChecks[0].class,n=OCA.WorkflowEngine.availableChecks[0].operators;e.push({class:t,operator:n[0].operator,value:""}),this.model.set({checks:e})},checkChanged:function(e){for(var t=e.target.value,n=$(e.target.parentElement).data("id"),a=JSON.parse(JSON.stringify(this.model.get("checks"))),r=null,l=0;l<e.target.classList.length;l++){var o=e.target.classList[l];if("check-"===o.substr(0,"check-".length)){r=o.substr("check-".length);break}}if(null!==r)if(_.has(a[n],r)){if(a[n][r]=t,"class"===r){var i=OCA.WorkflowEngine.getCheckByClass(t);_.isUndefined(i)||(a[n].operator=i.operators[0].operator,a[n].value="")}this.model.set({checks:a})}else console.warn('key "'+r+'" is not available in check',i);else console.warn('checkChanged triggered but element doesn\'t have any "check-" class')},deleteCheck:function(e){console.log(arguments);var t=$(e.target.parentElement).data("id"),n=JSON.parse(JSON.stringify(this.model.get("checks")));n.splice(t,1),this.model.set({checks:n})},operationChanged:function(e){for(var t=e.target.value,n=null,a=0;a<e.target.classList.length;a++){var r=e.target.classList[a];if("operation-"===r.substr(0,"operation-".length)){n=r.substr("operation-".length);break}}null!==n?"name"===n||"operation"===n?this.model.set(n,t):console.warn('key "'+n+'" is no valid attribute'):console.warn('operationChanged triggered but element doesn\'t have any "operation-" class')},render:function(){this.$el.html(this.template({operation:this.model.toJSON(),classes:OCA.WorkflowEngine.availableChecks,hasChanged:this.hasChanged,message:this.message,errorMessage:this.errorMessage,saving:this.saving}));var e=this.model.get("checks");return _.each(this.$el.find(".check"),function(t){var n=$(t),a=n.data("id"),r=e[a],l=n.find(".check-value").first(),o=this;_.each(OCA.WorkflowEngine.availablePlugins,function(e){_.isFunction(e.render)&&e.render(l,r,o.groups)})},this),""!==this.message&&(_.delay(function(e){$(e).css("opacity",0)},7e3,this.$el.find(".msg.success")),this.message=""),this.$el}}),OCA.WorkflowEngine.OperationsView=OC.Backbone.View.extend({templateId:"#operations-template",collection:null,$el:null,events:{"click .button-add-operation":"add"},template:function(e){return i()(_.extend({addRuleGroupTXT:t("workflowengine","Add rule group")},e))},initialize:function(e){OCA.WorkflowEngine.availablePlugins.length||(OCA.WorkflowEngine.availablePlugins=OC.Plugins.getPlugins("OCA.WorkflowEngine.CheckPlugins"),_.each(OCA.WorkflowEngine.availablePlugins,function(t){_.isFunction(t.getCheck)&&OCA.WorkflowEngine.availableChecks.push(t.getCheck(e))})),this.collection.fetch({data:{class:e}}),this.collection.once("sync",this.render,this)},add:function(){var e=this.collection.create();this.renderOperation(e)},renderOperation:function(e){this.$el.find(".operations").append(e.$el),e.render()},render:function(){this.$el.html(this.template()),this.collection.each(this.renderOperation,this)}});a(22),a(23),a(24),a(25),a(26),a(27),a(28),a(29),a(30);window.OCA.WorkflowEngine=OCA.WorkflowEngine}]);
//# sourceMappingURL=workflowengine.js.map \ No newline at end of file