2 lines
40 KiB
JavaScript
2 lines
40 KiB
JavaScript
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.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 a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));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=31)}([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(!o.test(e))return e;return e.replace(a,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={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},a=/[&<>"'`=]/g,o=/[&<>"'`=]/;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 a(e,t){var n=t&&t.loc,o=void 0,i=void 0;n&&(e+=" - "+(o=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,a);try{n&&(this.lineNumber=o,Object.defineProperty?Object.defineProperty(this,"column",{value:i,enumerable:!0}):this.column=i)}catch(e){}}a.prototype=new Error,t.default=a,e.exports=t.default},function(e,t,n){e.exports=n(6).default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.HandlebarsEnvironment=u;var a=n(0),o=r(n(1)),i=n(7),l=n(15),s=r(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 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]"===a.toString.call(e)){if(t)throw new o.default("Arg not supported with multiple helpers");a.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===a.toString.call(e))a.extend(this.partials,e);else{if(void 0===t)throw new o.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]"===a.toString.call(e)){if(t)throw new o.default("Arg not supported with multiple decorators");a.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=a.createFrame,t.logger=s.default},function(e,t,n){var r=n(2);e.exports=(r.default||r).template({1:function(e,t,n,r,a){return" modified"},3:function(e,t,n,r,a){return'\t\t\t<span class="button-delete icon-delete"></span>\n'},5:function(e,t,n,r,a,o,i){var l,s,u=null!=t?t:e.nullContext||{},c=n.helperMissing,f=e.escapeExpression;return'\t\t\t<div class="check" data-id="'+f("function"==typeof(s=null!=(s=n.index||a&&a.index)?s:c)?s.call(u,{name:"index",hash:{},data:a}):s)+'">\n\t\t\t\t<select class="check-class">\n'+(null!=(l=n.each.call(u,null!=i[1]?i[1].classes:i[1],{name:"each",hash:{},fn:e.program(6,a,0,o,i),inverse:e.noop,data:a}))?l:"")+'\t\t\t\t</select>\n\t\t\t\t<select class="check-operator">\n'+(null!=(l=n.each.call(u,(n.getOperators||t&&t.getOperators||c).call(u,null!=t?t.class:t,{name:"getOperators",hash:{},data:a}),{name:"each",hash:{},fn:e.program(8,a,0,o,i),inverse:e.noop,data:a}))?l:"")+'\t\t\t\t</select>\n\t\t\t\t<input type="text" class="check-value" value="'+f("function"==typeof(s=null!=(s=n.value||(null!=t?t.value:t))?s:c)?s.call(u,{name:"value",hash:{},data:a}):s)+'">\n\t\t\t\t<span class="button-delete-check icon-delete"></span>\n\t\t\t</div>\n'},6:function(e,t,n,r,a,o,i){var l,s,u=null!=t?t:e.nullContext||{},c=n.helperMissing,f=e.escapeExpression;return'\t\t\t\t\t\t<option value="'+f("function"==typeof(s=null!=(s=n.class||(null!=t?t.class:t))?s:c)?s.call(u,{name:"class",hash:{},data:a}):s)+'" '+(null!=(l=(n.selectItem||t&&t.selectItem||c).call(u,null!=t?t.class:t,null!=i[1]?i[1].class:i[1],{name:"selectItem",hash:{},data:a}))?l:"")+">"+f("function"==typeof(s=null!=(s=n.name||(null!=t?t.name:t))?s:c)?s.call(u,{name:"name",hash:{},data:a}):s)+"</option>\n"},8:function(e,t,n,r,a,o,i){var l,s,u=null!=t?t:e.nullContext||{},c=n.helperMissing,f=e.escapeExpression;return'\t\t\t\t\t\t<option value="'+f("function"==typeof(s=null!=(s=n.operator||(null!=t?t.operator:t))?s:c)?s.call(u,{name:"operator",hash:{},data:a}):s)+'" '+(null!=(l=(n.selectItem||t&&t.selectItem||c).call(u,null!=t?t.operator:t,null!=i[1]?i[1].operator:i[1],{name:"selectItem",hash:{},data:a}))?l:"")+">"+f("function"==typeof(s=null!=(s=n.name||(null!=t?t.name:t))?s:c)?s.call(u,{name:"name",hash:{},data:a}):s)+"</option>\n"},10:function(e,t,n,r,a){var o,i,l=null!=t?t:e.nullContext||{};return(null!=(o=n.if.call(l,null!=(o=null!=t?t.operation:t)?o.id:o,{name:"if",hash:{},fn:e.program(11,a,0),inverse:e.noop,data:a}))?o:"")+'\t\t<button class="button-save pull-right">'+e.escapeExpression("function"==typeof(i=null!=(i=n.saveTXT||(null!=t?t.saveTXT:t))?i:n.helperMissing)?i.call(l,{name:"saveTXT",hash:{},data:a}):i)+"</button>\n"},11:function(e,t,n,r,a){var o;return'\t\t\t<button class="button-reset pull-right">'+e.escapeExpression("function"==typeof(o=null!=(o=n.resetTXT||(null!=t?t.resetTXT:t))?o:n.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"resetTXT",hash:{},data:a}):o)+"</button>\n"},13:function(e,t,n,r,a){var o;return'\t\t<span class="icon-loading-small pull-right"></span>\n\t\t<span class="pull-right">'+e.escapeExpression("function"==typeof(o=null!=(o=n.savingTXT||(null!=t?t.savingTXT:t))?o:n.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"savingTXT",hash:{},data:a}):o)+"</span>\n\t"},15:function(e,t,n,r,a){var o;return null!=(o=n.if.call(null!=t?t:e.nullContext||{},null!=t?t.message:t,{name:"if",hash:{},fn:e.program(16,a,0),inverse:e.noop,data:a}))?o:""},16:function(e,t,n,r,a){var o,i,l=null!=t?t:e.nullContext||{};return'\n\t\t<span class="msg pull-right '+(null!=(o=n.if.call(l,null!=t?t.errorMessage:t,{name:"if",hash:{},fn:e.program(17,a,0),inverse:e.program(19,a,0),data:a}))?o:"")+'">\n\t\t\t\t\t'+e.escapeExpression("function"==typeof(i=null!=(i=n.message||(null!=t?t.message:t))?i:n.helperMissing)?i.call(l,{name:"message",hash:{},data:a}):i)+(null!=(o=n.if.call(l,null!=t?t.errorMessage:t,{name:"if",hash:{},fn:e.program(21,a,0),inverse:e.noop,data:a}))?o:"")+"\n\t\t\t\t</span>\n\t"},17:function(e,t,n,r,a){return"error"},19:function(e,t,n,r,a){return"success"},21:function(e,t,n,r,a){var o;return" "+e.escapeExpression("function"==typeof(o=null!=(o=n.errorMessage||(null!=t?t.errorMessage:t))?o:n.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"errorMessage",hash:{},data:a}):o)},compiler:[7,">= 4.0.0"],main:function(e,t,n,r,a,o,i){var l,s,u=null!=t?t:e.nullContext||{},c=n.helperMissing,f=e.escapeExpression,d=e.lambda;return'<div class="operation'+(null!=(l=n.if.call(u,null!=t?t.hasChanged:t,{name:"if",hash:{},fn:e.program(1,a,0,o,i),inverse:e.noop,data:a}))?l:"")+'">\n\t<div class="operation-header">\n\t\t<input type="text" class="operation-name" placeholder="'+f("function"==typeof(s=null!=(s=n.shortRuleDescTXT||(null!=t?t.shortRuleDescTXT:t))?s:c)?s.call(u,{name:"shortRuleDescTXT",hash:{},data:a}):s)+'" value="'+f(d(null!=(l=null!=t?t.operation:t)?l.name:l,t))+'" />\n\t\t<input type="text" class="operation-operation" value="'+f(d(null!=(l=null!=t?t.operation:t)?l.operation:l,t))+'" />\n'+(null!=(l=n.if.call(u,null!=(l=null!=t?t.operation:t)?l.id:l,{name:"if",hash:{},fn:e.program(3,a,0,o,i),inverse:e.noop,data:a}))?l:"")+'\t</div>\n\n\t<div class="checks">\n'+(null!=(l=n.each.call(u,null!=(l=null!=t?t.operation:t)?l.checks:l,{name:"each",hash:{},fn:e.program(5,a,0,o,i),inverse:e.noop,data:a}))?l:"")+'\t</div>\n\t<button class="button-add">'+f("function"==typeof(s=null!=(s=n.addRuleTXT||(null!=t?t.addRuleTXT:t))?s:c)?s.call(u,{name:"addRuleTXT",hash:{},data:a}):s)+"</button>\n"+(null!=(l=n.if.call(u,null!=t?t.hasChanged:t,{name:"if",hash:{},fn:e.program(10,a,0,o,i),inverse:e.noop,data:a}))?l:"")+(null!=(l=n.if.call(u,null!=t?t.saving:t,{name:"if",hash:{},fn:e.program(13,a,0,o,i),inverse:e.program(15,a,0,o,i),data:a}))?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,a){var o;return'<div class="operations"></div>\n<button class="button-add-operation">'+e.escapeExpression("function"==typeof(o=null!=(o=n.addRuleGroupTXT||(null!=t?t.addRuleGroupTXT:t))?o:n.helperMissing)?o.call(null!=t?t:e.nullContext||{},{name:"addRuleGroupTXT",hash:{},data:a}):o)+"</button>\n"},useData:!0})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function a(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 o=a(n(3)),i=r(n(18)),l=r(n(1)),s=a(n(0)),u=a(n(19)),c=r(n(20));function f(){var e=new o.HandlebarsEnvironment;return s.extend(e,o),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){a.default(e),o.default(e),i.default(e),l.default(e),s.default(e),u.default(e),c.default(e)};var a=r(n(8)),o=r(n(9)),i=r(n(10)),l=r(n(11)),s=r(n(12)),u=r(n(13)),c=r(n(14))},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0);t.default=function(e){e.registerHelper("blockHelperMissing",function(t,n){var a=n.inverse,o=n.fn;if(!0===t)return o(this);if(!1===t||null==t)return a(this);if(r.isArray(t))return t.length>0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):a(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 o(t,n)})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r,a=n(0),o=n(1),i=(r=o)&&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,o=0,l="",s=void 0,u=void 0;function c(t,r,o){s&&(s.key=t,s.index=r,s.first=0===r,s.last=!!o,u&&(s.contextPath=u+t)),l+=n(e[t],{data:s,blockParams:a.blockParams([e[t],t],[u+t,null])})}if(t.data&&t.ids&&(u=a.appendContextPath(t.data.contextPath,t.ids[0])+"."),a.isFunction(e)&&(e=e.call(this)),t.data&&(s=a.createFrame(t.data)),e&&"object"==typeof e)if(a.isArray(e))for(var f=e.length;o<f;o++)o in e&&c(o,o,o===e.length-1);else{var d=void 0;for(var p in e)e.hasOwnProperty(p)&&(void 0!==d&&c(d,o-1),d=p,o++);void 0!==d&&c(d,o-1,!0)}return 0===o&&(l=r(this)),l})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r,a=n(1),o=(r=a)&&r.__esModule?r:{default:r};t.default=function(e){e.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new o.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 a=1;null!=n.hash.level?a=n.hash.level:n.data&&null!=n.data.level&&(a=n.data.level),t[0]=a,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 a=t.data;return t.data&&t.ids&&((a=r.createFrame(t.data)).contextPath=r.appendContextPath(t.data.contextPath,t.ids[0])),n(e,{data:a,blockParams:r.blockParams([e],[a&&a.contextPath])})})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0,t.registerDefaultDecorators=function(e){o.default(e)};var r,a=n(16),o=(r=a)&&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,a){var o=e;return t.partials||(t.partials={},o=function(a,o){var i=n.partials;n.partials=r.extend({},i,t.partials);var l=e(a,o);return n.partials=i,l}),t.partials[a.args[0]]=a.fn,o})},e.exports=t.default},function(e,t,n){"use strict";t.__esModule=!0;var r=n(0),a={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=r.indexOf(a.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=a.lookupLevel(e),"undefined"!=typeof console&&a.lookupLevel(a.level)<=e){var t=a.methodMap[e];console[t]||(t="log");for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];console[t].apply(console,r)}}};t.default=a,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],a=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 ("+a+").")}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:a.escapeExpression,invokePartial:function(n,r,o){o.hash&&(r=a.extend({},r,o.hash),o.ids&&(o.ids[0]=!0));n=t.VM.resolvePartial.call(this,n,r,o);var l=t.VM.invokePartial.call(this,n,r,o);null==l&&t.compile&&(o.partials[o.name]=t.compile(n,e.compilerOptions,t),l=o.partials[o.name](r,o));if(null!=l){if(o.indent){for(var s=l.split("\n"),u=0,c=s.length;u<c&&(s[u]||u+1!==c);u++)s[u]=o.indent+s[u];l=s.join("\n")}return l}throw new i.default("The partial "+o.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,a){var o=this.programs[e],i=this.fn(e);return t||a||r||n?o=s(this,e,i,t,n,r,a):o||(o=this.programs[e]=s(this,e,i)),o},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=a.extend({},t,e)),n},nullContext:Object.seal({}),noop:t.VM.noop,compilerInfo:e.compiler};function r(t){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=a.data;r._setup(a),!a.partial&&e.useData&&(o=function(e,t){t&&"root"in t||((t=t?l.createFrame(t):{}).root=e);return t}(t,o));var i=void 0,s=e.useBlockParams?[]:void 0;function u(t){return""+e.main(n,t,n.helpers,n.partials,o,s,i)}return e.useDepths&&(i=a.depths?t!=a.depths[0]?[t].concat(a.depths):a.depths:[t]),(u=c(e.main,u,n,a.depths||[],o,s))(t,a)}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,a,o){if(e.useBlockParams&&!a)throw new i.default("must pass block params");if(e.useDepths&&!o)throw new i.default("must pass parent depths");return s(n,t,e[t],r,0,a,o)},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 o=void 0;n.fn&&n.fn!==u&&function(){n.data=l.createFrame(n.data);var e=n.fn;o=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=a.extend({},n.partials,e.partials))}();void 0===e&&o&&(e=o);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,a=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)),o=n(1),i=(r=o)&&r.__esModule?r:{default:r},l=n(3);function s(e,t,n,r,a,o,i){function l(t){var a=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,a.data||r,o&&[a.blockParams].concat(o),l)}return(l=c(n,l,e,i,r,o)).program=t,l.depth=i?i.length:0,l.blockParams=a||0,l}function u(){return""}function c(e,t,n,r,o,i){if(e.decorator){var l={};t=e.decorator(t,l,n,r&&r[0],o,i,r),a.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(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 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",a="18:00",o=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],a=u[0],o=s[1]}var c=JSON.stringify([r+" "+o,a+" "+o]);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(a).insertBefore(i);var f=$("<input>").attr("type","hidden").css("width","250px").insertBefore(i).val(o);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 a=JSON.parse(this._$element.val()),o=moment(a[0].split(" ",2)[0],"H:m Z"),i=moment(a[1].split(" ",2)[0],"H:m Z"),l=a[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),a[u]=s+" "+l}"timezone"===n&&(a[0]=o.format("HH:mm")+" "+t,a[1]=i.format("HH:mm")+" "+t),this._$element.val(JSON.stringify(a)),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 a=this,o=[{text:t("workflowengine","Predefined URLs"),children:[{id:"webdav",text:t("workflowengine","Files WebDAV")}]}];-1===this.predefinedValues.indexOf(n.value)&&o.unshift({id:n.value,text:n.value}),$(e).select2({data:o,createSearchChoice:function(e){if(-1===a.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 a=this,o=[{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)&&o.unshift({id:n.value,text:n.value}),$(e).select2({data:o,createSearchChoice:function(e){if(-1===a.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 a=r(4),o=r.n(a),i=r(5),l=r.n(i);Handlebars.registerHelper("selectItem",function(e,t){return e===t?'selected="selected"':""}),Handlebars.registerHelper("getOperators",function(e){var t=OCA.WorkflowEngine.getCheckByClass(e);return _.isUndefined(t)?[]:t.operators}),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 o()(_.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"))),a=null,o=0;o<e.target.classList.length;o++){var i=e.target.classList[o];if("check-"===i.substr(0,"check-".length)){a=i.substr("check-".length);break}}if(null!==a)if(_.has(r[n],a)){if(r[n][a]=t,"class"===a){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 "'+a+'" 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 a=e.target.classList[r];if("operation-"===a.substr(0,"operation-".length)){n=a.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"),a=e[r],o=n.find(".check-value").first(),i=this;_.each(OCA.WorkflowEngine.availablePlugins,function(e){_.isFunction(e.render)&&e.render(o,a,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(22),r(23),r(24),r(25),r(26),r(27),r(28),r(29),r(30);window.OCA.WorkflowEngine=OCA.WorkflowEngine}]);
|
|
//# sourceMappingURL=workflowengine.js.map
|