admission 0.4.9 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f03c5417670b97a8de57b5a1254e1152a2a159f5
4
- data.tar.gz: 7fdb46a9dc899c36c592b6c7d920768f93ed0add
3
+ metadata.gz: 71b602ebc6eb991561c298a07838ffc1832a3108
4
+ data.tar.gz: 8610564b982d63a74056567a7358d64ef3c38b8a
5
5
  SHA512:
6
- metadata.gz: a87e3b4e647e3bb83acc3edc42b0d22ad29550ab0a75bd0e37b393eb04138386579d0d69d85a786bd14c20fca7c78bcfdff94a07d8c74c0b664c530bd6f663f2
7
- data.tar.gz: c381044a18429eaf0615fae7d2a0e98e2b8803bb75345e8a1091c4531d35da2cbc5214d934b338e5de207a7732620f64038152d293436208dfec010317e70ec4
6
+ metadata.gz: 2f9cfd81aecc86ba02926266113029354ce66e467c34c6ff46b444ba25349820ee443eadacbfad5a5bfa04959d59d39dec55551948bc37355d8398d45abacb45
7
+ data.tar.gz: 1f482260466f15bbd8076565865c1f0a8b16493d6c0ace7a608f21803a807fe3c4e453eaf778c8b63dcdbf00239b7a722ae24d7554bf87a2c280cab2397da614
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = 'Admission rules to actions or resources, privileges system included'
13
13
  spec.email = 'zelazk.o@email.cz'
14
14
 
15
- spec.files = (`git ls-files -z lib visualisation/dist/app.js admission.gemspec`).split "\x0"
15
+ spec.files = (`git ls-files -z lib admission.gemspec`).split "\x0"
16
16
  spec.require_paths = ['lib']
17
17
 
18
18
  spec.required_ruby_version = '>= 2.3.0'
@@ -2,6 +2,7 @@ require_relative 'admission/admission'
2
2
  require_relative 'admission/version'
3
3
 
4
4
  require_relative 'admission/privilege'
5
+ require_relative 'admission/privileges_order'
5
6
  require_relative 'admission/status'
6
7
  require_relative 'admission/arbitration'
7
8
  require_relative 'admission/resource_arbitration'
@@ -9,4 +9,9 @@ module Admission
9
9
 
10
10
  end
11
11
 
12
+ def self.define_privileges &block
13
+ index = Admission::PrivilegesOrder::Definer.define &block
14
+ Admission::PrivilegesOrder.new index
15
+ end
16
+
12
17
  end
@@ -81,8 +81,8 @@ class Admission::Arbitration
81
81
  end
82
82
 
83
83
  def privilege name, level=nil
84
- @privilege = Admission::Privilege.get_from_order privilege_order, name, level
85
- raise "no such privilege: #{name}-#{level}" unless @privilege
84
+ @privilege = privilege_order.get name, level
85
+ raise "no such privilege: #{name}#{Admission::Privilege::SEPARATOR}#{level}" unless @privilege
86
86
  yield
87
87
  @privilege = nil
88
88
  end
@@ -1,8 +1,9 @@
1
1
  class Admission::Privilege
2
2
 
3
- RESERVED_ID = :'^'
3
+ RESERVED_ID = :'^'.freeze
4
4
  TOP_LEVEL_KEY = RESERVED_ID
5
5
  BASE_LEVEL_NAME = :base
6
+ SEPARATOR = '-'.freeze
6
7
 
7
8
  attr_reader :name, :level, :hash
8
9
  attr_reader :inherited, :context
@@ -37,7 +38,11 @@ class Admission::Privilege
37
38
  end
38
39
 
39
40
  def text_key
40
- level == BASE_LEVEL_NAME ? name.to_s : "#{name}-#{level}"
41
+ @text_key ||= level == BASE_LEVEL_NAME ? name.to_s : "#{name}#{SEPARATOR}#{level}"
42
+ end
43
+
44
+ def self.split_text_key value
45
+ return value.split(SEPARATOR)
41
46
  end
42
47
 
43
48
  def inspect
@@ -55,90 +60,4 @@ class Admission::Privilege
55
60
  ].join ''
56
61
  end
57
62
 
58
- def self.define_order &block
59
- Admission::Privilege::OrderDefiner.define &block
60
- end
61
-
62
- def self.get_from_order index, name, level=nil
63
- levels = index[name.to_sym] || return
64
- if level && !level.empty?
65
- levels[level.to_sym]
66
- else
67
- levels[Admission::Privilege::BASE_LEVEL_NAME]
68
- end
69
- end
70
-
71
- def self.order_to_array index
72
- index.values.map(&:values).flatten.uniq
73
- end
74
-
75
- class OrderDefiner
76
-
77
- attr_reader :definitions
78
-
79
- def initialize
80
- @definitions = {}
81
- end
82
-
83
- def privilege name, levels: [], inherits: nil
84
- name = name.to_sym
85
- if ([name] + levels).any?{|id| id == Admission::Privilege::RESERVED_ID }
86
- raise "reserved name `#{Admission::Privilege::RESERVED_ID}` !"
87
- end
88
-
89
- levels.unshift Admission::Privilege::BASE_LEVEL_NAME
90
- levels.map!{|level| Admission::Privilege.new name, level}
91
-
92
- inherits = nil if inherits && inherits.empty?
93
- if inherits
94
- inherits = *inherits
95
- inherits = inherits.map(&:to_sym).uniq
96
- end
97
-
98
- @definitions[name] = {levels: levels, inherits: inherits}
99
- end
100
-
101
- def self.define &block
102
- definer = new
103
- definer.instance_exec &block
104
-
105
- definer.send :setup_inheritance
106
- definer.send :build_index
107
- end
108
-
109
- private
110
-
111
- def setup_inheritance
112
- # set inheritance for all privileges
113
- definitions.values.each do |levels:, inherits:|
114
- levels.each_with_index do |privilege, index|
115
- if index > 0 # higher level of privilege, inherits one step lower level
116
- privilege.inherits_from levels[index - 1]
117
-
118
- elsif inherits # lowest level, inherits top level of other privileges
119
- inherits = inherits.map{|name| definitions[name][:levels].last if definitions.has_key? name}
120
- privilege.inherits_from *inherits
121
-
122
- end
123
- end
124
- end
125
- end
126
-
127
- def build_index
128
- definitions.each_pair.reduce({}) do |h, pair|
129
- name = pair[0]
130
- levels = pair[1][:levels]
131
-
132
- levels_hash = levels.reduce({Admission::Privilege::TOP_LEVEL_KEY => levels.last}) do |lh, privilege|
133
- lh[privilege.level] = privilege
134
- lh
135
- end.freeze
136
-
137
- h[name] = levels_hash
138
- h
139
- end.freeze
140
- end
141
-
142
- end
143
-
144
63
  end
@@ -0,0 +1,96 @@
1
+ class Admission::PrivilegesOrder
2
+
3
+ attr_reader :index
4
+
5
+ def initialize index
6
+ @index = index
7
+ end
8
+
9
+ def get name, level=nil
10
+ levels = index[name.to_sym] || return
11
+ if level && !level.empty?
12
+ levels[level.to_sym]
13
+ else
14
+ levels[Admission::Privilege::BASE_LEVEL_NAME]
15
+ end
16
+ end
17
+
18
+ def to_list
19
+ @list ||= index.values.map(&:values).flatten.uniq
20
+ end
21
+
22
+ def entitled_for ref_privilege
23
+ to_list.select{|privilege| privilege.eql_or_inherits? ref_privilege}
24
+ end
25
+
26
+ class Definer
27
+
28
+ attr_reader :definitions
29
+
30
+ def initialize
31
+ @definitions = {}
32
+ end
33
+
34
+ def privilege name, levels: [], inherits: nil
35
+ name = name.to_sym
36
+ if ([name] + levels).any?{|id| id == Admission::Privilege::RESERVED_ID }
37
+ raise "reserved name `#{Admission::Privilege::RESERVED_ID}` !"
38
+ end
39
+
40
+ levels.unshift Admission::Privilege::BASE_LEVEL_NAME
41
+ levels.map!{|level| Admission::Privilege.new name, level}
42
+
43
+ inherits = nil if inherits && inherits.empty?
44
+ if inherits
45
+ inherits = *inherits
46
+ inherits = inherits.map(&:to_sym).uniq
47
+ end
48
+
49
+ @definitions[name] = {levels: levels, inherits: inherits}
50
+ end
51
+
52
+ def self.define &block
53
+ definer = new
54
+ definer.instance_exec &block
55
+
56
+ definer.send :setup_inheritance
57
+ definer.send :build_index
58
+ end
59
+
60
+ private
61
+
62
+ def setup_inheritance
63
+ # set inheritance for all privileges
64
+ definitions.values.each do |levels:, inherits:|
65
+ levels.each_with_index do |privilege, index|
66
+ if index > 0 # higher level of privilege, inherits one step lower level
67
+ privilege.inherits_from levels[index - 1]
68
+
69
+ elsif inherits # lowest level, inherits top level of other privileges
70
+ inherits = inherits.map{|name| definitions[name][:levels].last if definitions.has_key? name}
71
+ privilege.inherits_from *inherits
72
+
73
+ end
74
+ end
75
+ end
76
+ end
77
+
78
+ def build_index
79
+ definitions.each_pair.reduce({}) do |h, pair|
80
+ name = pair[0]
81
+ levels = pair[1][:levels]
82
+
83
+ levels_hash = levels.reduce({Admission::Privilege::TOP_LEVEL_KEY => levels.last}) do |lh, privilege|
84
+ lh[privilege.level] = privilege
85
+ lh
86
+ end.freeze
87
+
88
+ h[name] = levels_hash
89
+ h
90
+ end.freeze
91
+ end
92
+
93
+ end
94
+
95
+
96
+ end
@@ -1,8 +1,18 @@
1
1
  module Admission::Rails
2
2
 
3
+
4
+
5
+ end
6
+
7
+ Admission::ResourceArbitration.class_exec do
8
+
9
+ # use active_support's inflection to get the scope of resource type
10
+ def self.type_to_scope type
11
+ type.name.tableize.to_sym
12
+ end
13
+
3
14
  end
4
15
 
5
16
  require_relative './rails/action_admission'
6
17
  require_relative './rails/controller_addon'
7
- require_relative './rails/scope_resolver'
8
- require_relative './rails/scope_not_defined'
18
+ require_relative './rails/scope_resolver'
@@ -11,8 +11,15 @@ module Admission
11
11
  @resolvers = {}
12
12
  end
13
13
 
14
- # config methods (adding resolvers)
15
-
14
+ # Sets `action_admission` to be resolved to given scope for particular actions.
15
+ #
16
+ # action_admission.for :show, :edit, resolve_to: :find_record
17
+ # action_admission.for %i[show edit], resolve_to: :find_record
18
+ #
19
+ # action_admission.for :show, resolve_to: :method_that_returns_the_scope
20
+ # action_admission.for :show, resolve_to: ->{ 'the_scope' }
21
+ # action_admission.for(:show){ 'the_scope' }
22
+ #
16
23
  def for *actions, resolve_to: nil, &block
17
24
  resolve_to = resolve_to || block
18
25
  resolver = ScopeResolver.using resolve_to
@@ -20,11 +27,53 @@ module Admission
20
27
  set_resolver actions, resolver
21
28
  end
22
29
 
30
+ # Sets `action_admission` to be resolved to given scope for all actions.
31
+ #
32
+ # action_admission.for_all :method_that_returns_the_scope
33
+ # action_admission.for_all ->{ 'the_scope' }
34
+ # action_admission.for_all{ 'the_scope' }
35
+ #
23
36
  def for_all resolve_to=nil, &block
24
- self.for ALL_ACTIONS, resolve_to: (resolve_to || block || ScopeResolver.default)
37
+ self.for ALL_ACTIONS, resolve_to: (resolve_to || block)
38
+ end
39
+
40
+ # Sets `action_admission` to be resolved to default scope for particular actions.
41
+ # i.e. this is the means to reset to default functionality.
42
+ #
43
+ # action_admission.default_for :show, :edit
44
+ # action_admission.default_for %i[show edit]
45
+ #
46
+ def default_for *actions
47
+ set_resolver actions, ScopeResolver.default
25
48
  end
26
49
 
27
- def for_resource *actions, all: false, nested: false
50
+ # Sets `action_admission` to be resolved to resource scope for particular actions.
51
+ # Resource scope is just a resource instance (or nested resource) which is load
52
+ # in method with predefined standard name. for example:
53
+ #
54
+ # class PeopleController
55
+ # action_admission.resource_for :show
56
+ #
57
+ # # scope is `:people`, with resource `@person`
58
+ # # i.e. defined rule: `allow_resource(Person, %i[show]`){|person| # ... }
59
+ # def find_person
60
+ # @person = Person.find params[:id]
61
+ # end
62
+ # end
63
+ #
64
+ # class PropertiesController
65
+ # action_admission.resource_for :show, nested: true
66
+ #
67
+ # # scope is `:'people-properties'` with resource `@person`
68
+ # # i.e. defined rule: `allow_resource([Person, :properties], %i[show]`){|person| # ... }
69
+ # def properties_admission_scope
70
+ # @property = Property.find params[:id]
71
+ # @person = @property.owner
72
+ # [@person, controller_name.to_sym]
73
+ # end
74
+ # end
75
+ #
76
+ def resource_for *actions, all: false, nested: false
28
77
  finder_name = if nested
29
78
  "#{controller.controller_name}_admission_scope"
30
79
  else
@@ -36,26 +85,27 @@ module Admission
36
85
  set_resolver actions, resolver
37
86
  end
38
87
 
88
+ # Sets `action_admission` to be ignored for given actions.
89
+ # Useful when you have `action_admission` included inherently.
90
+ # Or for when you are brave enough to check the admission on your own
91
+ # within the action (though you should rather never need to do that).
92
+ #
93
+ # action_admission.skip :homepage, :news_feed
94
+ # action_admission.skip %i[homepage news_feed]
95
+ #
39
96
  def skip *actions
40
97
  set_resolver actions, ScopeResolver.void
41
98
  end
42
99
 
43
- # run-time
100
+ # run-time means to find the scope resolver for the action
44
101
  def scope_for_action action
45
102
  resolvers[action] ||
46
103
  resolvers[ALL_ACTIONS] ||
47
- parent&.scope_for_action(action)
104
+ ScopeResolver.default
48
105
  end
49
106
 
50
107
  private
51
108
 
52
- def parent
53
- klass = @controller.superclass
54
- if klass.respond_to? :action_admission
55
- klass.action_admission
56
- end
57
- end
58
-
59
109
  def set_resolver actions, resolver
60
110
  if actions.is_a? Array
61
111
  actions.flatten.compact.map(&:to_s).each do |action|
@@ -5,11 +5,16 @@ module Admission
5
5
  def self.included controller
6
6
  controller.extend ClassMethods
7
7
  controller.before_action :assure_admission
8
- controller.action_admission.for_all
9
8
  end
10
9
 
11
10
  module ClassMethods
12
11
 
12
+ # `action_admission` defines your configuration of admission scopes for actions.
13
+ # By default, scope is the controller's name, which should be good starting point,
14
+ # but you can change it to what ever suits you; and for resources you need
15
+ # to set it explicitly.
16
+ #
17
+ # For all options see `Admission::Rails::ActionAdmission`
13
18
  def action_admission
14
19
  @action_admission ||= ActionAdmission.new(self)
15
20
  end
@@ -18,18 +23,20 @@ module Admission
18
23
 
19
24
  private
20
25
 
26
+ # This is just a helper to proxy the admission request to the user
27
+ # you may need to redefine it if `current_user` is not the right accessor
21
28
  def request_admission! action, scope
22
29
  current_user.status.request! action, scope
23
30
  end
24
31
 
32
+ # The default callback method that assures the admission request.
33
+ # It is included automatically if you include `Admission::Rails::ControllerAddon`.
34
+ #
35
+ # `#action_admission` is used to get the scope for the action (`#action_name`).
25
36
  def assure_admission
26
37
  action = action_name
27
38
  scope_resolver = self.class.action_admission.scope_for_action action
28
39
 
29
- unless scope_resolver
30
- raise ScopeNotDefined.new(self)
31
- end
32
-
33
40
  scope_resolver.apply self do |scope|
34
41
  request_admission! action.to_sym, scope
35
42
  end
@@ -1,6 +1,7 @@
1
1
  module Admission::Test
2
2
 
3
3
  class << self
4
+ attr_accessor :order
4
5
  attr_accessor :all_privileges
5
6
 
6
7
  def assertion_failed_message arbitration, privilege
@@ -23,7 +24,7 @@ module Admission::Test
23
24
  block = case selector
24
25
  when String
25
26
  if inheritance
26
- ref_privilege = Admission::Privilege.get_from_order UserStatus.privileges, *selector.split('-')
27
+ ref_privilege = order.get *Admission::Privilege.split_text_key(selector)
27
28
  ->(p){ p.eql_or_inherits? ref_privilege }
28
29
 
29
30
  else
@@ -33,7 +34,7 @@ module Admission::Test
33
34
  when Array
34
35
  if inheritance
35
36
  ref_privileges = selector.map do |s|
36
- Admission::Privilege.get_from_order UserStatus.privileges, *s.split('-')
37
+ order.get *Admission::Privilege.split_text_key(s)
37
38
  end
38
39
  ->(p){
39
40
  ref_privileges.any?{|ref_p| p.eql_or_inherits? ref_p }
@@ -1,3 +1,3 @@
1
1
  module Admission
2
- VERSION = '0.4.9'
2
+ VERSION = '0.5.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: admission
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ondřej Želazko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-17 00:00:00.000000000 Z
11
+ date: 2018-04-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Admission rules to actions or resources, privileges system included
14
14
  email: zelazk.o@email.cz
@@ -25,17 +25,15 @@ files:
25
25
  - lib/admission/index.rb
26
26
  - lib/admission/minitest.rb
27
27
  - lib/admission/privilege.rb
28
+ - lib/admission/privileges_order.rb
28
29
  - lib/admission/rails.rb
29
30
  - lib/admission/rails/action_admission.rb
30
31
  - lib/admission/rails/controller_addon.rb
31
- - lib/admission/rails/scope_not_defined.rb
32
32
  - lib/admission/rails/scope_resolver.rb
33
33
  - lib/admission/resource_arbitration.rb
34
34
  - lib/admission/status.rb
35
35
  - lib/admission/tests.rb
36
36
  - lib/admission/version.rb
37
- - lib/admission/visualisation_app.rb
38
- - visualisation/dist/app.js
39
37
  homepage: https://github.com/doooby/admission
40
38
  licenses:
41
39
  - GPL-3.0
@@ -1,21 +0,0 @@
1
- module Admission
2
- module Rails
3
- class ScopeNotDefined < ::StandardError
4
-
5
- attr_reader :controller
6
-
7
- def initialize controller
8
- @controller = controller
9
- end
10
-
11
- def action
12
- "#{controller.class.name}##{controller.action_name}"
13
- end
14
-
15
- def message
16
- "Undefined scope to resolve admission to. Requested action: #{action}."
17
- end
18
-
19
- end
20
- end
21
- end
@@ -1,135 +0,0 @@
1
- require 'pathname'
2
- require 'json'
3
-
4
- class Admission::VisualisationApp
5
-
6
- def initialize **settings
7
- order = settings[:order] || (raise 'order not defined, cannot visualise data')
8
- raise 'order must be a Proc' unless Proc === order
9
-
10
- settings[:js_entry] ||= Pathname.new(__FILE__).join('..', '..', '..',
11
- 'visualisation', 'dist', 'app.js')
12
-
13
- @settings = settings
14
- end
15
-
16
- def call env
17
- case env['PATH_INFO'].to_s
18
- when %r~^/(\.html)?$~
19
- [
20
- 200,
21
- {'Content-Type' => 'text/html; charset=utf-8'},
22
- [render_page]
23
- ]
24
-
25
- when %r~/app\.js~
26
- [
27
- 200,
28
- {'Content-Type' => 'application/js; charset=utf-8'},
29
- [File.read(@settings[:js_entry])]
30
- ]
31
-
32
- when %r~/data\.json~
33
- [
34
- 200,
35
- {'Content-Type' => 'application/json; charset=utf-8'},
36
- [render_data(@settings[:order].call)]
37
- ]
38
-
39
- else
40
- default_404_response
41
-
42
- end
43
- end
44
-
45
- def render_page
46
- data_url = "#{@settings[:url_prefix]}/data.json"
47
- script_url = "#{@settings[:url_prefix]}/app.js"
48
-
49
- <<-HEREDOC
50
- <!DOCTYPE html>
51
- <html>
52
- <head>
53
- <title>Admission</title>
54
- </head>
55
- <body class='flex-column'>
56
-
57
- <div data-url="#{data_url}" id="admission-visualisation"></div>
58
- <script src="#{script_url}"></script>
59
-
60
- </body>
61
- </html>
62
- HEREDOC
63
- end
64
-
65
- def render_data privileges:, rules:, arbitrator: Admission::ResourceArbitration
66
- js_data = {}
67
-
68
- top_levels = []
69
- privileges = privileges.values.inject Array.new do |arr, levels|
70
- tops, others = levels.to_a.partition{|key, _| key == :'^'}
71
- tops.first[1].tap{|privilege| top_levels << privilege.text_key}
72
-
73
- others.each do |_, privilege|
74
- arr << {name: privilege.name, level: privilege.level,
75
- inherits: privilege.inherited && privilege.inherited.map(&:text_key)}
76
- end
77
-
78
- arr
79
- end
80
-
81
- js_data[:privileges] = privileges
82
- js_data[:top_levels] = top_levels
83
- js_data[:levels] = privileges.inject Hash.new do |hash, p|
84
- (hash[p[:name]] ||= []) << p[:level]
85
- hash
86
- end
87
-
88
- actions_reduce = -> (index) {
89
- index.to_a.map do |action, action_index|
90
- action_index = action_index.to_a.map do |privilege, rule|
91
- if rule.is_a? Proc
92
- rule = 'proc'
93
- end
94
-
95
- [privilege.text_key, rule]
96
- end
97
-
98
- [action, Hash[action_index]]
99
- end
100
- }
101
-
102
- rules = if arbitrator == Admission::Arbitration
103
- single_scope = actions_reduce[rules]
104
- [['-non-scoped-', Hash[single_scope]]]
105
-
106
- elsif arbitrator == Admission::ResourceArbitration
107
- rules.to_a.map do |scope, scope_index|
108
- scope_index = actions_reduce[scope_index]
109
- [scope, Hash[scope_index]]
110
- end
111
-
112
- else
113
- raise "not implemented for #{arbitrator.name}"
114
-
115
- end
116
- js_data[:rules] = Hash[rules]
117
-
118
- JSON.generate js_data
119
- end
120
-
121
- def default_404_response
122
- page = if @settings[:file_404]
123
- File.read @settings[:file_404]
124
- else
125
- 'Admission::VisualisationApp : page not found'
126
- end
127
-
128
- [
129
- 404,
130
- {'Content-Type' => 'text/html; charset=utf-8'},
131
- [page]
132
- ]
133
- end
134
-
135
- end
@@ -1,6 +0,0 @@
1
- !function(e){function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var t={};n.m=e,n.c=t,n.i=function(e){return e},n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},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,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=23)}([function(e,n,t){!function(){"use strict";function n(){}function t(e,t){var o,r,i,a,s=R;for(a=arguments.length;a-- >2;)N.push(arguments[a]);for(t&&null!=t.children&&(N.length||N.push(t.children),delete t.children);N.length;)if((r=N.pop())&&void 0!==r.pop)for(a=r.length;a--;)N.push(r[a]);else!0!==r&&!1!==r||(r=null),(i="function"!=typeof e)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(i=!1)),i&&o?s[s.length-1]+=r:s===R?s=[r]:s.push(r),o=i;var l=new n;return l.nodeName=e,l.children=s,l.attributes=null==t?void 0:t,l.key=null==t?void 0:t.key,void 0!==A.vnode&&A.vnode(l),l}function o(e,n){for(var t in n)e[t]=n[t];return e}function r(e,n){return t(e.nodeName,o(o({},e.attributes),n),arguments.length>2?[].slice.call(arguments,2):e.children)}function i(e){!e.__d&&(e.__d=!0)&&1==U.push(e)&&(A.debounceRendering||setTimeout)(a)}function a(){var e,n=U;for(U=[];e=n.pop();)e.__d&&j(e)}function s(e,n,t){return"string"==typeof n||"number"==typeof n?void 0!==e.splitText:"string"==typeof n.nodeName?!e._componentConstructor&&l(e,n.nodeName):t||e._componentConstructor===n.nodeName}function l(e,n){return e.__n===n||e.nodeName.toLowerCase()===n.toLowerCase()}function u(e){var n=o({},e.attributes);n.children=e.children;var t=e.nodeName.defaultProps;if(void 0!==t)for(var r in t)void 0===n[r]&&(n[r]=t[r]);return n}function c(e,n){var t=n?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return t.__n=e,t}function f(e){e.parentNode&&e.parentNode.removeChild(e)}function d(e,n,t,o,r){if("className"===n&&(n="class"),"key"===n);else if("ref"===n)t&&t(null),o&&o(e);else if("class"!==n||r)if("style"===n){if(o&&"string"!=typeof o&&"string"!=typeof t||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof t)for(var i in t)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===I.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===n)o&&(e.innerHTML=o.__html||"");else if("o"==n[0]&&"n"==n[1]){var a=n!==(n=n.replace(/Capture$/,""));n=n.toLowerCase().substring(2),o?t||e.addEventListener(n,h,a):e.removeEventListener(n,h,a),(e.__l||(e.__l={}))[n]=o}else if("list"!==n&&"type"!==n&&!r&&n in e)p(e,n,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(n);else{var s=r&&n!==(n=n.replace(/^xlink\:?/,""));null==o||!1===o?s?e.removeAttributeNS("http://www.w3.org/1999/xlink",n.toLowerCase()):e.removeAttribute(n):"function"!=typeof o&&(s?e.setAttributeNS("http://www.w3.org/1999/xlink",n.toLowerCase(),o):e.setAttribute(n,o))}else e.className=o||""}function p(e,n,t){try{e[n]=t}catch(e){}}function h(e){return this.__l[e.type](A.event&&A.event(e)||e)}function b(){for(var e;e=L.pop();)A.afterMount&&A.afterMount(e),e.componentDidMount&&e.componentDidMount()}function y(e,n,t,o,r,i){B++||(D=null!=r&&void 0!==r.ownerSVGElement,M=null!=e&&!("__preactattr_"in e));var a=v(e,n,t,o,i);return r&&a.parentNode!==r&&r.appendChild(a),--B||(M=!1,i||b()),a}function v(e,n,t,o,r){var i=e,a=D;if(null==n&&(n=""),"string"==typeof n)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=n&&(e.nodeValue=n):(i=document.createTextNode(n),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),g(e,!0))),i.__preactattr_=!0,i;if("function"==typeof n.nodeName)return E(e,n,t,o);if(D="svg"===n.nodeName||"foreignObject"!==n.nodeName&&D,(!e||!l(e,String(n.nodeName)))&&(i=c(String(n.nodeName),D),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),g(e,!0)}var s=i.firstChild,u=i.__preactattr_||(i.__preactattr_={}),f=n.children;return!M&&f&&1===f.length&&"string"==typeof f[0]&&null!=s&&void 0!==s.splitText&&null==s.nextSibling?s.nodeValue!=f[0]&&(s.nodeValue=f[0]):(f&&f.length||null!=s)&&m(i,f,t,o,M||null!=u.dangerouslySetInnerHTML),w(i,n.attributes,u),D=a,i}function m(e,n,t,o,r){var i,a,l,u,c=e.childNodes,d=[],p={},h=0,b=0,y=c.length,m=0,_=n?n.length:0;if(0!==y)for(var w=0;w<y;w++){var x=c[w],k=x.__preactattr_,O=_&&k?x._component?x._component.__k:k.key:null;null!=O?(h++,p[O]=x):(k||(void 0!==x.splitText?!r||x.nodeValue.trim():r))&&(d[m++]=x)}if(0!==_)for(var w=0;w<_;w++){l=n[w],u=null;var O=l.key;if(null!=O)h&&void 0!==p[O]&&(u=p[O],p[O]=void 0,h--);else if(!u&&b<m)for(i=b;i<m;i++)if(void 0!==d[i]&&s(a=d[i],l,r)){u=a,d[i]=void 0,i===m-1&&m--,i===b&&b++;break}u=v(u,l,t,o),u&&u!==e&&(w>=y?e.appendChild(u):u!==c[w]&&(u===c[w+1]?f(c[w]):e.insertBefore(u,c[w]||null)))}if(h)for(var w in p)void 0!==p[w]&&g(p[w],!1);for(;b<=m;)void 0!==(u=d[m--])&&g(u,!1)}function g(e,n){var t=e._component;t?C(t):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==n&&null!=e.__preactattr_||f(e),_(e))}function _(e){for(e=e.lastChild;e;){var n=e.previousSibling;g(e,!0),e=n}}function w(e,n,t){var o;for(o in t)n&&null!=n[o]||null==t[o]||d(e,o,t[o],t[o]=void 0,D);for(o in n)"children"===o||"innerHTML"===o||o in t&&n[o]===("value"===o||"checked"===o?e[o]:t[o])||d(e,o,t[o],t[o]=n[o],D)}function x(e){var n=e.constructor.name;(z[n]||(z[n]=[])).push(e)}function k(e,n,t){var o,r=z[e.name];if(e.prototype&&e.prototype.render?(o=new e(n,t),T.call(o,n,t)):(o=new T(n,t),o.constructor=e,o.render=O),r)for(var i=r.length;i--;)if(r[i].constructor===e){o.__b=r[i].__b,r.splice(i,1);break}return o}function O(e,n,t){return this.constructor(e,t)}function S(e,n,t,o,r){e.__x||(e.__x=!0,(e.__r=n.ref)&&delete n.ref,(e.__k=n.key)&&delete n.key,!e.base||r?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(n,o),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=n,e.__x=!1,0!==t&&(1!==t&&!1===A.syncComponentUpdates&&e.base?i(e):j(e,1,r)),e.__r&&e.__r(e))}function j(e,n,t,r){if(!e.__x){var i,a,s,l=e.props,c=e.state,f=e.context,d=e.__p||l,p=e.__s||c,h=e.__c||f,v=e.base,m=e.__b,_=v||m,w=e._component,x=!1;if(v&&(e.props=d,e.state=p,e.context=h,2!==n&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(l,c,f)?x=!0:e.componentWillUpdate&&e.componentWillUpdate(l,c,f),e.props=l,e.state=c,e.context=f),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!x){i=e.render(l,c,f),e.getChildContext&&(f=o(o({},f),e.getChildContext()));var O,E,T=i&&i.nodeName;if("function"==typeof T){var P=u(i);a=w,a&&a.constructor===T&&P.key==a.__k?S(a,P,1,f,!1):(O=a,e._component=a=k(T,P,f),a.__b=a.__b||m,a.__u=e,S(a,P,0,f,!1),j(a,1,t,!0)),E=a.base}else s=_,O=w,O&&(s=e._component=null),(_||1===n)&&(s&&(s._component=null),E=y(s,i,f,t||!v,_&&_.parentNode,!0));if(_&&E!==_&&a!==w){var N=_.parentNode;N&&E!==N&&(N.replaceChild(E,_),O||(_._component=null,g(_,!1)))}if(O&&C(O),e.base=E,E&&!r){for(var R=e,I=e;I=I.__u;)(R=I).base=E;E._component=R,E._componentConstructor=R.constructor}}if(!v||t?L.unshift(e):x||(b(),e.componentDidUpdate&&e.componentDidUpdate(d,p,h),A.afterUpdate&&A.afterUpdate(e)),null!=e.__h)for(;e.__h.length;)e.__h.pop().call(e);B||r||b()}}function E(e,n,t,o){for(var r=e&&e._component,i=r,a=e,s=r&&e._componentConstructor===n.nodeName,l=s,c=u(n);r&&!l&&(r=r.__u);)l=r.constructor===n.nodeName;return r&&l&&(!o||r._component)?(S(r,c,3,t,o),e=r.base):(i&&!s&&(C(i),e=a=null),r=k(n.nodeName,c,t),e&&!r.__b&&(r.__b=e,a=null),S(r,c,1,t,o),e=r.base,a&&e!==a&&(a._component=null,g(a,!1))),e}function C(e){A.beforeUnmount&&A.beforeUnmount(e);var n=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var t=e._component;t?C(t):n&&(n.__preactattr_&&n.__preactattr_.ref&&n.__preactattr_.ref(null),e.__b=n,f(n),x(e),_(n)),e.__r&&e.__r(null)}function T(e,n){this.__d=!0,this.context=n,this.props=e,this.state=this.state||{}}function P(e,n,t){return y(t,e,{},!1,n,!1)}var A={},N=[],R=[],I=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,U=[],L=[],B=0,D=!1,M=!1,z={};o(T.prototype,{setState:function(e,n){var t=this.state;this.__s||(this.__s=o({},t)),o(t,"function"==typeof e?e(t,this.props):e),n&&(this.__h=this.__h||[]).push(n),i(this)},forceUpdate:function(e){e&&(this.__h=this.__h||[]).push(e),j(this,2)},render:function(){}});var F={h:t,createElement:t,cloneElement:r,Component:T,render:P,rerender:a,options:A};e.exports=F}()},function(e,n,t){var o,r;/*!
2
- Copyright (c) 2016 Jed Watson.
3
- Licensed under the MIT License (MIT), see
4
- http://jedwatson.github.io/classnames
5
- */
6
- !function(){"use strict";function t(){for(var e=[],n=0;n<arguments.length;n++){var o=arguments[n];if(o){var r=typeof o;if("string"===r||"number"===r)e.push(o);else if(Array.isArray(o))e.push(t.apply(null,o));else if("object"===r)for(var a in o)i.call(o,a)&&o[a]&&e.push(a)}}return e.join(" ")}var i={}.hasOwnProperty;void 0!==e&&e.exports?e.exports=t:(o=[],void 0!==(r=function(){return t}.apply(n,o))&&(e.exports=r))}()},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function i(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),l=t(0),u=o(l),c=t(1),f=o(c),d=t(22),p=o(d),h=function(e){function n(e){r(this,n);var t=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={text:e.defaultText||"",matching:null},t.setParentRef=function(e){return t.element=e},t.setListRef=function(e){return t.list=e},t.onKeyDown=t.onKeyDown.bind(t),t.onTextChange=p.default.debounce(t.onTextChange.bind(t),400),t.toggleList=p.default.debounce(t.toggleList.bind(t),400,!0),t.closeList=t.closeList.bind(t),t.onSelected=t.onSelected.bind(t),t}return a(n,e),s(n,[{key:"render",value:function(e,n){var t=e.placeholder,o=n.text,r=n.matching;return r||(this.list=null),u.default.h("div",{ref:this.setParentRef,className:"select_box"},u.default.h("div",{className:"_inputs"},u.default.h("input",{type:"text",className:"input_text",placeholder:t,onKeyDown:this.onKeyDown,value:o}),u.default.h("button",{type:"button",tabIndex:"-1",className:"button",onClick:this.toggleList},"\u2304")),r&&u.default.h(b,{ref:this.setListRef,items:r,toSelect:this.onSelected,toClose:this.closeList}))}},{key:"componentDidMount",value:function(){var e=this;this._outside_click_listener=function(n){!e.element.contains(n.target)&&e.list&&e.closeList()},document.addEventListener("click",this._outside_click_listener)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this._outside_click_listener)}},{key:"componentWillReceiveProps",value:function(e){e.defaultText!==this.props.defaultText&&this.setState({text:e.defaultText})}},{key:"onKeyDown",value:function(e){if(!this.list||!this.list.onKeyDown(e))return 13===e.keyCode&&this.props.enterable?void this.onSelected(e.target.value.trim()):void this.onTextChange(e)}},{key:"onTextChange",value:function(e){var n=e.target.value.trim(),t=null;(n&&n!==this.state.text||40===e.keyCode)&&(t=this.filtered_items(n)),this.setState({matching:t,text:n})}},{key:"toggleList",value:function(){this.list?this.closeList():this.setState({matching:this.filtered_items()})}},{key:"closeList",value:function(){this.setState({matching:null})}},{key:"onSelected",value:function(e){this.setState({text:e,matching:null}),this.props.onSelect(e)}},{key:"filtered_items",value:function(e){var n=this.props.all_items;return e&&(n=n.filter(function(n){return n.startsWith(e)})),this.props.nullable&&n.unshift(null),0===n.length?null:n}}]),n}(u.default.Component);n.default=h;var b=function(e){function n(e){r(this,n);var t=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={selected:-1},t}return a(n,e),s(n,[{key:"render",value:function(e,n){var t=e.items,o=e.toSelect,r=n.selected;return u.default.h("div",{className:"_dropdown"},u.default.h("ul",null,t.map(function(e,n){return u.default.h("li",{className:(0,f.default)({selected:r===n}),onClick:function(){return o(e)}},null===e?"\xa0":e)})))}},{key:"onKeyDown",value:function(e){switch(e.keyCode){case 40:return this.changeSelection(1),!0;case 38:return this.changeSelection(-1),!0;case 13:var n=this.state.selected;if(-1!==n)return this.props.toSelect(this.props.items[n]),!0;break;case 27:return this.props.toClose(),!0}return!1}},{key:"changeSelection",value:function(e){var n=this.state.selected;n+=e,n<0&&(n=0),n>=this.props.items.length&&(n=this.props.items.length-1),this.setState({selected:n})}}]),n}(u.default.Component)},function(e,n,t){"use strict";function o(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function r(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function i(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var a=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),s=t(0),l=function(e){return e&&e.__esModule?e:{default:e}}(s),u=function(e){function n(e){o(this,n);var t=r(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={unrolled:!!e.defaultUnrolled},t.toggleRollOut=t.toggleRollOut.bind(t),t}return i(n,e),a(n,[{key:"render",value:function(e,t){var o=this,r=e.app,i=e.content,a=e.nestedRows,s=t.unrolled;return l.default.h("li",null,l.default.h("div",{onClick:this.toggleRollOut,className:"nested-list-content"},a&&l.default.h("span",{className:"icon"},s?"\u25b6":"\u25bc"),l.default.h("span",{className:"content"},i)),s&&a&&l.default.h("ul",{className:"nested-list"},a.map(function(e){return l.default.h(n,{app:r,content:e.content,nestedRows:e.nested_rows,defaultUnrolled:o.props.defaultUnrolled})})))}},{key:"componentWillReceiveProps",value:function(e){var n=e.defaultUnrolled;n!==this.props.defaultUnrolled&&this.setState({unrolled:!!n})}},{key:"toggleRollOut",value:function(){this.setState({unrolled:!this.state.unrolled})}}]),n}(l.default.Component);n.default=u},function(e,n){function t(e,n){var t=e[1]||"",r=e[3];if(!r)return t;if(n&&"function"==typeof btoa){var i=o(r);return[t].concat(r.sources.map(function(e){return"/*# sourceURL="+r.sourceRoot+e+" */"})).concat([i]).join("\n")}return[t].join("\n")}function o(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var n=[];return n.toString=function(){return this.map(function(n){var o=t(n,e);return n[2]?"@media "+n[2]+"{"+o+"}":o}).join("")},n.i=function(e,t){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},r=0;r<this.length;r++){var i=this[r][0];"number"==typeof i&&(o[i]=!0)}for(r=0;r<e.length;r++){var a=e[r];"number"==typeof a[0]&&o[a[0]]||(t&&!a[2]?a[2]=t:t&&(a[2]="("+a[2]+") and ("+t+")"),n.push(a))}},n}},function(e,n,t){"use strict";var o=t(32),r=o.a.Symbol;n.a=r},function(e,n,t){"use strict";function o(e){if(!t.i(a.a)(e)||t.i(r.a)(e)!=s)return!1;var n=t.i(i.a)(e);if(null===n)return!0;var o=f.call(n,"constructor")&&n.constructor;return"function"==typeof o&&o instanceof o&&c.call(o)==d}var r=t(26),i=t(28),a=t(33),s="[object Object]",l=Function.prototype,u=Object.prototype,c=l.toString,f=u.hasOwnProperty,d=c.call(Object);n.a=o},function(e,n,t){"use strict";function o(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];if(0===n.length)return function(e){return e};if(1===n.length)return n[0];var o=n[n.length-1],r=n.slice(0,-1);return function(){return r.reduceRight(function(e,n){return n(e)},o.apply(void 0,arguments))}}n.a=o},function(e,n,t){"use strict";function o(e,n,i){function l(){m===v&&(m=v.slice())}function u(){return y}function c(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var n=!0;return l(),m.push(e),function(){if(n){n=!1,l();var t=m.indexOf(e);m.splice(t,1)}}}function f(e){if(!t.i(r.a)(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(g)throw new Error("Reducers may not dispatch actions.");try{g=!0,y=b(y,e)}finally{g=!1}for(var n=v=m,o=0;o<n.length;o++)n[o]();return e}function d(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");b=e,f({type:s.INIT})}function p(){var e,n=c;return e={subscribe:function(e){function t(){e.next&&e.next(u())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");return t(),{unsubscribe:n(t)}}},e[a.a]=function(){return this},e}var h;if("function"==typeof n&&void 0===i&&(i=n,n=void 0),void 0!==i){if("function"!=typeof i)throw new Error("Expected the enhancer to be a function.");return i(o)(e,n)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var b=e,y=n,v=[],m=v,g=!1;return f({type:s.INIT}),h={dispatch:f,subscribe:c,getState:u,replaceReducer:d},h[a.a]=p,h}t.d(n,"b",function(){return s}),n.a=o;var r=t(6),i=t(38),a=t.n(i),s={INIT:"@@redux/INIT"}},function(e,n,t){"use strict"},function(e,n,t){function o(e,n){for(var t=0;t<e.length;t++){var o=e[t],r=h[o.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](o.parts[i]);for(;i<o.parts.length;i++)r.parts.push(c(o.parts[i],n))}else{for(var a=[],i=0;i<o.parts.length;i++)a.push(c(o.parts[i],n));h[o.id]={id:o.id,refs:1,parts:a}}}}function r(e,n){for(var t=[],o={},r=0;r<e.length;r++){var i=e[r],a=n.base?i[0]+n.base:i[0],s=i[1],l=i[2],u=i[3],c={css:s,media:l,sourceMap:u};o[a]?o[a].parts.push(c):t.push(o[a]={id:a,parts:[c]})}return t}function i(e,n){var t=y(e.insertInto);if(!t)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=g[g.length-1];if("top"===e.insertAt)o?o.nextSibling?t.insertBefore(n,o.nextSibling):t.appendChild(n):t.insertBefore(n,t.firstChild),g.push(n);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");t.appendChild(n)}}function a(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var n=g.indexOf(e);n>=0&&g.splice(n,1)}function s(e){var n=document.createElement("style");return e.attrs.type="text/css",u(n,e.attrs),i(e,n),n}function l(e){var n=document.createElement("link");return e.attrs.type="text/css",e.attrs.rel="stylesheet",u(n,e.attrs),i(e,n),n}function u(e,n){Object.keys(n).forEach(function(t){e.setAttribute(t,n[t])})}function c(e,n){var t,o,r,i;if(n.transform&&e.css){if(!(i=n.transform(e.css)))return function(){};e.css=i}if(n.singleton){var u=m++;t=v||(v=s(n)),o=f.bind(null,t,u,!1),r=f.bind(null,t,u,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(t=l(n),o=p.bind(null,t,n),r=function(){a(t),t.href&&URL.revokeObjectURL(t.href)}):(t=s(n),o=d.bind(null,t),r=function(){a(t)});return o(e),function(n){if(n){if(n.css===e.css&&n.media===e.media&&n.sourceMap===e.sourceMap)return;o(e=n)}else r()}}function f(e,n,t,o){var r=t?"":o.css;if(e.styleSheet)e.styleSheet.cssText=w(n,r);else{var i=document.createTextNode(r),a=e.childNodes;a[n]&&e.removeChild(a[n]),a.length?e.insertBefore(i,a[n]):e.appendChild(i)}}function d(e,n){var t=n.css,o=n.media;if(o&&e.setAttribute("media",o),e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}function p(e,n,t){var o=t.css,r=t.sourceMap,i=void 0===n.convertToAbsoluteUrls&&r;(n.convertToAbsoluteUrls||i)&&(o=_(o)),r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([o],{type:"text/css"}),s=e.href;e.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var h={},b=function(e){var n;return function(){return void 0===n&&(n=e.apply(this,arguments)),n}}(function(){return window&&document&&document.all&&!window.atob}),y=function(e){var n={};return function(t){return void 0===n[t]&&(n[t]=e.call(this,t)),n[t]}}(function(e){return document.querySelector(e)}),v=null,m=0,g=[],_=t(37);e.exports=function(e,n){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");n=n||{},n.attrs="object"==typeof n.attrs?n.attrs:{},n.singleton||(n.singleton=b()),n.insertInto||(n.insertInto="head"),n.insertAt||(n.insertAt="bottom");var t=r(e,n);return o(t,n),function(e){for(var i=[],a=0;a<t.length;a++){var s=t[a],l=h[s.id];l.refs--,i.push(l)}if(e){o(r(e,n),n)}for(var a=0;a<i.length;a++){var l=i[a];if(0===l.refs){for(var u=0;u<l.parts.length;u++)l.parts[u]();delete h[l.id]}}}};var w=function(){var e=[];return function(n,t){return e[n]=t,e.filter(Boolean).join("\n")}}()},function(e,n){var t;t=function(){return this}();try{t=t||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,n,t){"use strict"},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function i(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),l=t(0),u=o(l),c=t(1),f=o(c),d=t(20),p=o(d),h=t(21),b=o(h),y=function(e){function n(e){r(this,n);var t=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.switchToPrivileges=t.changePanel.bind(t,"privileges"),t.switchToRules=t.changePanel.bind(t,"rules"),t}return a(n,e),s(n,[{key:"render",value:function(e,n){var t=(e.app,n.loaded),o=n.load_fail,r=n.panel;return t?o?u.default.h("div",{className:"splash-message"},u.default.h("h4",null,"failed to load admission data"),u.default.h("code",null,o)):u.default.h("div",{className:"admission-app-container"},u.default.h("ul",{className:"panels-list"},u.default.h("li",{onClick:this.switchToPrivileges,className:(0,f.default)({active:"privileges"===r})},"Privileges Order"),u.default.h("li",{onClick:this.switchToRules,className:(0,f.default)({active:"rules"===r})},"Rules Listing")),this.renderPanel()):u.default.h("div",{className:"splash-message"},u.default.h("code",null,"... loading admission data ..."))}},{key:"componentDidMount",value:function(){var e=this,n=this.props.app.store;this.store_unsibscribe=n.subscribe(function(){var t=n.getState();e.setState({loaded:t.loaded,panel:t.panel})}),setTimeout(this.props.onMounted,0)}},{key:"componentWillUnmount",value:function(){this.store_unsibscribe()}},{key:"changePanel",value:function(e){this.props.app.store.dispatch({type:"PANEL_CHANGE",panel:e})}},{key:"renderPanel",value:function(){var e=this.props.app;switch(this.state.panel){case"privileges":return u.default.h(p.default,{app:e});case"rules":return u.default.h(b.default,{app:e})}}}]),n}(u.default.Component);n.default=y},function(e,n,t){"use strict";function o(e,n){if(void 0===e)return r;if(!e.loaded)return"APP_READY"===n.type?Object.assign({},e,{loaded:!0,panel:"rules"}):e;switch(n.type){case"PANEL_CHANGE":return Object.assign({},e,{panel:n.panel});default:return e}}Object.defineProperty(n,"__esModule",{value:!0});var r={loaded:!1};n.default=o},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=t(8),r=t(36),i=t(35),a=t(34),s=t(7);t(9);t.d(n,"createStore",function(){return o.a}),t.d(n,"combineReducers",function(){return r.a}),t.d(n,"bindActionCreators",function(){return i.a}),t.d(n,"applyMiddleware",function(){return a.a}),t.d(n,"compose",function(){return s.a})},function(e,n,t){var o=t(24);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;t(10)(o,r);o.locals&&(e.exports=o.locals)},function(e,n,t){var o=t(25);"string"==typeof o&&(o=[[e.i,o,""]]);var r={};r.transform=void 0;t(10)(o,r);o.locals&&(e.exports=o.locals)},function(e,n){!function(e){"use strict";function n(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function t(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var n={next:function(){var n=e.shift();return{done:void 0===n,value:n}}};return v.iterable&&(n[Symbol.iterator]=function(){return n}),n}function r(e){this.map={},e instanceof r?e.forEach(function(e,n){this.append(n,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(n){this.append(n,e[n])},this)}function i(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function a(e){return new Promise(function(n,t){e.onload=function(){n(e.result)},e.onerror=function(){t(e.error)}})}function s(e){var n=new FileReader,t=a(n);return n.readAsArrayBuffer(e),t}function l(e){var n=new FileReader,t=a(n);return n.readAsText(e),t}function u(e){for(var n=new Uint8Array(e),t=new Array(n.length),o=0;o<n.length;o++)t[o]=String.fromCharCode(n[o]);return t.join("")}function c(e){if(e.slice)return e.slice(0);var n=new Uint8Array(e.byteLength);return n.set(new Uint8Array(e)),n.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e)if("string"==typeof e)this._bodyText=e;else if(v.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(v.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(v.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else if(v.arrayBuffer&&v.blob&&g(e))this._bodyArrayBuffer=c(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!v.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(e)&&!_(e))throw new Error("unsupported BodyInit type");this._bodyArrayBuffer=c(e)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):v.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},v.blob&&(this.blob=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(s)}),this.text=function(){var e=i(this);if(e)return e;if(this._bodyBlob)return l(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(u(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},v.formData&&(this.formData=function(){return this.text().then(h)}),this.json=function(){return this.text().then(JSON.parse)},this}function d(e){var n=e.toUpperCase();return w.indexOf(n)>-1?n:e}function p(e,n){n=n||{};var t=n.body;if(e instanceof p){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,n.headers||(this.headers=new r(e.headers)),this.method=e.method,this.mode=e.mode,t||null==e._bodyInit||(t=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=n.credentials||this.credentials||"omit",!n.headers&&this.headers||(this.headers=new r(n.headers)),this.method=d(n.method||this.method||"GET"),this.mode=n.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&t)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(t)}function h(e){var n=new FormData;return e.trim().split("&").forEach(function(e){if(e){var t=e.split("="),o=t.shift().replace(/\+/g," "),r=t.join("=").replace(/\+/g," ");n.append(decodeURIComponent(o),decodeURIComponent(r))}}),n}function b(e){var n=new r;return e.split(/\r?\n/).forEach(function(e){var t=e.split(":"),o=t.shift().trim();if(o){var r=t.join(":").trim();n.append(o,r)}}),n}function y(e,n){n||(n={}),this.type="default",this.status="status"in n?n.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in n?n.statusText:"OK",this.headers=new r(n.headers),this.url=n.url||"",this._initBody(e)}if(!e.fetch){var v={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(v.arrayBuffer)var m=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],g=function(e){return e&&DataView.prototype.isPrototypeOf(e)},_=ArrayBuffer.isView||function(e){return e&&m.indexOf(Object.prototype.toString.call(e))>-1};r.prototype.append=function(e,o){e=n(e),o=t(o);var r=this.map[e];this.map[e]=r?r+","+o:o},r.prototype.delete=function(e){delete this.map[n(e)]},r.prototype.get=function(e){return e=n(e),this.has(e)?this.map[e]:null},r.prototype.has=function(e){return this.map.hasOwnProperty(n(e))},r.prototype.set=function(e,o){this.map[n(e)]=t(o)},r.prototype.forEach=function(e,n){for(var t in this.map)this.map.hasOwnProperty(t)&&e.call(n,this.map[t],t,this)},r.prototype.keys=function(){var e=[];return this.forEach(function(n,t){e.push(t)}),o(e)},r.prototype.values=function(){var e=[];return this.forEach(function(n){e.push(n)}),o(e)},r.prototype.entries=function(){var e=[];return this.forEach(function(n,t){e.push([t,n])}),o(e)},v.iterable&&(r.prototype[Symbol.iterator]=r.prototype.entries);var w=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];p.prototype.clone=function(){return new p(this,{body:this._bodyInit})},f.call(p.prototype),f.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers),url:this.url})},y.error=function(){var e=new y(null,{status:0,statusText:""});return e.type="error",e};var x=[301,302,303,307,308];y.redirect=function(e,n){if(-1===x.indexOf(n))throw new RangeError("Invalid status code");return new y(null,{status:n,headers:{location:e}})},e.Headers=r,e.Request=p,e.Response=y,e.fetch=function(e,n){return new Promise(function(t,o){var r=new p(e,n),i=new XMLHttpRequest;i.onload=function(){var e={status:i.status,statusText:i.statusText,headers:b(i.getAllResponseHeaders()||"")};e.url="responseURL"in i?i.responseURL:e.headers.get("X-Request-URL");var n="response"in i?i.response:i.responseText;t(new y(n,e))},i.onerror=function(){o(new TypeError("Network request failed"))},i.ontimeout=function(){o(new TypeError("Network request failed"))},i.open(r.method,r.url,!0),"include"===r.credentials&&(i.withCredentials=!0),"responseType"in i&&v.blob&&(i.responseType="blob"),r.headers.forEach(function(e,n){i.setRequestHeader(n,e)}),i.send(void 0===r._bodyInit?null:r._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function i(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var s=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),l=t(0),u=o(l),c=t(2),f=o(c),d=function(e){function n(e){r(this,n);var t=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state=e.app.keyToPrivilege(e.defaultValue),t.onNameSelected=t.onNameSelected.bind(t),t.onLevelSelected=t.onLevelSelected.bind(t),t.onClearSelection=t.onClearSelection.bind(t),t}return a(n,e),s(n,[{key:"render",value:function(e,n){var t=e.app,o=n.name,r=n.level;return u.default.h("div",{className:"controls-group"},u.default.h(f.default,{defaultText:o,placeholder:"name",all_items:t.listPrivilegesNames(),onSelect:this.onNameSelected}),u.default.h(f.default,{defaultText:r,placeholder:"level",all_items:t.listPrivilegeLevels(o),onSelect:this.onLevelSelected}),u.default.h("button",{type:"button",tabIndex:"-1",className:"button",onClick:this.onClearSelection},"Clear"))}},{key:"componentWillReceiveProps",value:function(e){var n=e.defaultValue;n!==this.props.defaultValue&&this.setState(this.props.app.keyToPrivilege(n))}},{key:"onNameSelected",value:function(e){var n=this.props.app.admission.levels[e],t=void 0;t=n?n[n.length-1]:"base",this.setState({name:e,level:t}),this.props.onChanged({name:e,level:t})}},{key:"onLevelSelected",value:function(e){var n=this.state.name;this.setState({level:e}),this.props.onChanged({name:n,level:e})}},{key:"onClearSelection",value:function(){var e={name:"",level:""};this.setState(e),this.props.onChanged(e)}}]),n}(u.default.Component);n.default=d},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function i(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}function s(e,n){var t=n.privilege,o=n.key;!t&&o&&(t=e.getPrivilegeData(o));var r=void 0;return t?t.inherits&&(r=t.inherits):r=e.admission.top_levels,r&&(r=r.map(function(n){return s(e,{key:n})})),{content:t?e.privilegeToKey(t):"-listing-",nested_rows:r}}Object.defineProperty(n,"__esModule",{value:!0});var l=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),u=t(0),c=o(u),f=t(1),d=o(f),p=t(19),h=o(p),b=t(3),y=o(b),v=function(e){function n(e){r(this,n);var t=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.state={roll_down_all:!0,privilege_key:""},t.onToggleRollDownAll=t.onToggleRollDownAll.bind(t),t.onPrivilegeSelected=t.onPrivilegeSelected.bind(t),t}return a(n,e),l(n,[{key:"render",value:function(e,n){var t=e.app,o=n.privilege_key,r=n.roll_down_all,i=s(t,{key:o});return c.default.h("div",{className:"panel"},c.default.h("div",{className:"controls"},c.default.h("div",{className:"controls-group"},c.default.h("div",{className:(0,d.default)("check_box",r&&"checked"),onClick:this.onToggleRollDownAll},"\u25bc")),c.default.h(h.default,{app:t,defaultValue:o,onChanged:this.onPrivilegeSelected})),c.default.h("ul",{className:"nested-list"},c.default.h(y.default,{app:t,content:i.content,nestedRows:i.nested_rows,defaultUnrolled:r})))}},{key:"onToggleRollDownAll",value:function(){this.setState({roll_down_all:!this.state.roll_down_all})}},{key:"onPrivilegeSelected",value:function(e){this.setState({privilege_key:this.props.app.privilegeToKey(e)})}}]),n}(c.default.Component);n.default=v},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}function r(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function i(e,n){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?e:n}function a(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(e,n):e.__proto__=n)}function s(e,n){if(!n)return e;var t=Object.assign({},e);return Object.keys(t).forEach(function(e){e.includes(n)||delete t[e]}),t}function l(e,n){var t=n.action;return Object.keys(e).map(function(n){var o=u(e[n],{action:t});return o.length?{content:n,nested_rows:o}:null}).filter(function(e){return e})}function u(e,n){var t=n.action,o=Object.keys(e);return t&&(o=o.filter(function(e){return e.includes(t)})),o.map(function(n){return{content:n,nested_rows:c(e[n])}})}function c(e){return Object.keys(e).map(function(n){return{content:n+": "+e[n]}})}function f(e){var n=[];return Object.keys(e).forEach(function(t){return n=n.concat(Object.keys(e[t]))}),n.filter(function(e,n,t){return n===t.indexOf(e)})}Object.defineProperty(n,"__esModule",{value:!0});var d=function(){function e(e,n){for(var t=0;t<n.length;t++){var o=n[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(n,t,o){return t&&e(n.prototype,t),o&&e(n,o),n}}(),p=t(0),h=o(p),b=t(1),y=o(b),v=t(2),m=o(v),g=t(3),_=o(g),w=function(e){function n(e){r(this,n);var t=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.onToggleRollDownAll=t.onToggleRollDownAll.bind(t),t.onScopeSelected=t.onScopeSelected.bind(t),t.onActionSelected=t.onActionSelected.bind(t),t}return a(n,e),d(n,[{key:"render",value:function(e,n){var t=e.app,o=n.scope,r=n.action,i=n.roll_down_all,a=s(t.admission.rules,o),u=l(a,{action:r});return h.default.h("div",{className:"panel"},h.default.h("div",{className:"controls"},h.default.h("div",{className:"controls-group"},h.default.h("div",{className:(0,y.default)("check_box",i&&"checked"),onClick:this.onToggleRollDownAll},"\u25bc")),h.default.h("div",{className:"controls-group"},h.default.h(m.default,{defaultText:o,placeholder:"scope",enterable:!0,nullable:!0,all_items:Object.keys(t.admission.rules),onSelect:this.onScopeSelected}),h.default.h(m.default,{defaultText:r,placeholder:"action",enterable:!0,nullable:!0,all_items:f(a),onSelect:this.onActionSelected}))),h.default.h("ul",{className:"nested-list"},u.map(function(e){return h.default.h(_.default,{app:t,content:e.content,nestedRows:e.nested_rows,defaultUnrolled:i})})))}},{key:"onToggleRollDownAll",value:function(){this.setState({roll_down_all:!this.state.roll_down_all})}},{key:"onScopeSelected",value:function(e){this.setState({scope:e})}},{key:"onActionSelected",value:function(e){this.setState({action:e})}}]),n}(h.default.Component);n.default=w},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o={debounce:function(e,n,t){var o=void 0,r=void 0,i=void 0;return t?function(){var t=!0;r=this,i=arguments,o&&(t=!1,clearTimeout(o)),o=setTimeout(function(){o=null},n),t&&e.apply(r,i)}:function(){r=this,i=arguments,o&&clearTimeout(o),o=setTimeout(function(){o=null,e.apply(r,i)},n)}},throttle:function(e,n,t){var o=void 0,r=void 0,i=void 0,a=void 0;return function(){if(i=this,a=arguments,o)return void(r=!0);var s=function t(){o=null,r&&(r=!1,o=setTimeout(t,n),e.apply(i,a))};r=!0,t?s():o=setTimeout(s,n)}}};n.default=o},function(e,n,t){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var r=function(){function e(e,n){var t=[],o=!0,r=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(o=(a=s.next()).done)&&(t.push(a.value),!n||t.length!==n);o=!0);}catch(e){r=!0,i=e}finally{try{!o&&s.return&&s.return()}finally{if(r)throw i}}return t}return function(n,t){if(Array.isArray(n))return n;if(Symbol.iterator in Object(n))return e(n,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t(16),t(17),t(18);var i=t(0),a=o(i),s=t(15),l=t(14),u=o(l),c=t(12),f=(o(c),t(13)),d=o(f);document.addEventListener("DOMContentLoaded",function(){function e(){fetch(p.container.dataset.url,{credentials:"include"}).then(function(e){if(!e.ok)return void p.container_component.setState({loaded:!0,load_fail:e.statusText});e.json().then(function(e){p.admission=e,p.store.dispatch({type:"APP_READY"})}).catch(function(e){p.container_component.setState({loaded:!0,load_fail:e.message})})}).catch(function(e){p.container_component.setState({loaded:!0,load_fail:e.message})})}p.store=(0,s.createStore)(u.default),p.container=document.getElementById("admission-visualisation"),window.app=p,a.default.render(a.default.h(d.default,{ref:function(e){return p.container_component=e},app:p,onMounted:e}),p.container)});var p={getPrivilegeData:function(e){var n=p.keyToPrivilege(e),t=n.name,o=n.level;return this.admission.privileges.find(function(e){return e.name===t&&e.level===o})},listPrivilegesNames:function(){return this.admission.privileges.map(function(e){return e.name}).filter(function(e,n,t){return n===t.indexOf(e)})},listPrivilegeLevels:function(e){return e?this.admission.privileges.filter(function(n){return n.name===e}).map(function(e){return e.level}):[]},privilegeToKey:function(e){var n=e.name,t=e.level;return t&&"base"!==t?n+"-"+t:n||""},keyToPrivilege:function(e){if(!e)return{name:"",level:""};var n=e.split("-"),t=r(n,2),o=t[0],i=t[1];return i||(i="base"),{name:o,level:i}}}},function(e,n,t){n=e.exports=t(4)(void 0),n.push([e.i,'/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */\n\n/* Document\n ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in\n * IE on Windows Phone and in iOS.\n */\n\nhtml {\n line-height: 1.15; /* 1 */\n -ms-text-size-adjust: 100%; /* 2 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n ========================================================================== */\n\n/**\n * Remove the margin in all browsers (opinionated).\n */\n\nbody {\n margin: 0;\n}\n\n/**\n * Add the correct display in IE 9-.\n */\n\narticle,\naside,\nfooter,\nheader,\nnav,\nsection {\n display: block;\n}\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * Add the correct display in IE 9-.\n * 1. Add the correct display in IE.\n */\n\nfigcaption,\nfigure,\nmain { /* 1 */\n display: block;\n}\n\n/**\n * Add the correct margin in IE 8.\n */\n\nfigure {\n margin: 1em 40px;\n}\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\npre {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * 1. Remove the gray background on active links in IE 10.\n * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.\n */\n\na {\n background-color: transparent; /* 1 */\n -webkit-text-decoration-skip: objects; /* 2 */\n}\n\n/**\n * 1. Remove the bottom border in Chrome 57- and Firefox 39-.\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n text-decoration: underline dotted; /* 2 */\n}\n\n/**\n * Prevent the duplicate application of `bolder` by the next rule in Safari 6.\n */\n\nb,\nstrong {\n font-weight: inherit;\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font style in Android 4.3-.\n */\n\ndfn {\n font-style: italic;\n}\n\n/**\n * Add the correct background and color in IE 9-.\n */\n\nmark {\n background-color: #ff0;\n color: #000;\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Add the correct display in IE 9-.\n */\n\naudio,\nvideo {\n display: inline-block;\n}\n\n/**\n * Add the correct display in iOS 4-7.\n */\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\n/**\n * Remove the border on images inside links in IE 10-.\n */\n\nimg {\n border-style: none;\n}\n\n/**\n * Hide the overflow in IE.\n */\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change the font styles in all browsers (opinionated).\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: sans-serif; /* 1 */\n font-size: 100%; /* 1 */\n line-height: 1.15; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput { /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\n * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`\n * controls in Android 4.\n * 2. Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\nhtml [type="button"], /* 1 */\n[type="reset"],\n[type="submit"] {\n -webkit-appearance: button; /* 2 */\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type="button"]::-moz-focus-inner,\n[type="reset"]::-moz-focus-inner,\n[type="submit"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\nbutton:-moz-focusring,\n[type="button"]:-moz-focusring,\n[type="reset"]:-moz-focusring,\n[type="submit"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/**\n * Correct the padding in Firefox.\n */\n\nfieldset {\n padding: 0.35em 0.75em 0.625em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * 1. Add the correct display in IE 9-.\n * 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n display: inline-block; /* 1 */\n vertical-align: baseline; /* 2 */\n}\n\n/**\n * Remove the default vertical scrollbar in IE.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10-.\n * 2. Remove the padding in IE 10-.\n */\n\n[type="checkbox"],\n[type="radio"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type="number"]::-webkit-inner-spin-button,\n[type="number"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type="search"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding and cancel buttons in Chrome and Safari on macOS.\n */\n\n[type="search"]::-webkit-search-cancel-button,\n[type="search"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/* Interactive\n ========================================================================== */\n\n/*\n * Add the correct display in IE 9-.\n * 1. Add the correct display in Edge, IE, and Firefox.\n */\n\ndetails, /* 1 */\nmenu {\n display: block;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\nsummary {\n display: list-item;\n}\n\n/* Scripting\n ========================================================================== */\n\n/**\n * Add the correct display in IE 9-.\n */\n\ncanvas {\n display: inline-block;\n}\n\n/**\n * Add the correct display in IE.\n */\n\ntemplate {\n display: none;\n}\n\n/* Hidden\n ========================================================================== */\n\n/**\n * Add the correct display in IE 10-.\n */\n\n[hidden] {\n display: none;\n}\n',""])},function(e,n,t){n=e.exports=t(4)(void 0),n.push([e.i,"html, body {\n height: 100%; }\n\nbody {\n margin: 0;\n align-items: center;\n background-color: #717171;\n overflow-y: scroll; }\n\n#admission-visualisation {\n flex: 0 0;\n max-width: 100%;\n max-height: 100%; }\n #admission-visualisation .splash-message {\n padding: 10px;\n background-color: #eee6ff;\n margin: 50px 0; }\n #admission-visualisation .admission-app-container {\n background-color: #eee6ff;\n margin: 50px 0; }\n #admission-visualisation .panels-list {\n list-style-type: none;\n margin: 0;\n padding: 0;\n display: flex; }\n #admission-visualisation .panels-list > li {\n margin: 5px;\n margin-left: 0;\n padding: 10px;\n border: 2px solid black;\n cursor: pointer;\n font-weight: bold; }\n #admission-visualisation .panels-list > li:first-of-type {\n margin-left: 5px; }\n #admission-visualisation .panels-list > li.active {\n background-color: #d5c3fc;\n border-style: solid;\n color: #4a207e; }\n #admission-visualisation .panels-list > li:hover {\n background-color: #d5c3fc; }\n #admission-visualisation .panel {\n padding: 5px; }\n\n.flex-column {\n display: flex;\n flex-direction: column; }\n\n.input_text {\n padding: 5px;\n margin: 0;\n outline: none;\n border: 1px solid black;\n border-radius: 0;\n background-color: white; }\n .input_text:active {\n border: 1px solid black;\n outline: none; }\n\n.check_box {\n display: inline-block;\n padding: 5px;\n border: 1px solid black;\n background-color: white; }\n .check_box.checked {\n background-color: #d5c3fc; }\n .check_box:hover {\n cursor: pointer; }\n\n.button {\n display: inline-block;\n padding: 5px;\n margin: 0;\n border: 1px solid black;\n border-radius: 0;\n background-color: white; }\n .button:hover {\n background-color: #d5c3fc;\n cursor: pointer; }\n .button.small {\n font-size: 80%;\n padding: 2.5px; }\n\n.select_box > ._inputs {\n display: flex; }\n .select_box > ._inputs > input {\n flex: 1 1;\n border-right: none;\n max-width: 100px; }\n .select_box > ._inputs > button {\n border-left: none; }\n\n.select_box > ._dropdown {\n position: relative; }\n .select_box > ._dropdown > ul {\n z-index: 1;\n background-color: white;\n position: absolute;\n max-width: 300%;\n border: 1px solid black;\n list-style-type: none;\n margin: 0;\n padding: 0;\n top: -1px; }\n .select_box > ._dropdown > ul > li {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n padding: 5px;\n border: 1px solid transparent;\n overflow: hidden; }\n .select_box > ._dropdown > ul > li.selected {\n background-color: #4a207e;\n color: white; }\n .select_box > ._dropdown > ul > li:hover {\n background-color: #d5c3fc;\n color: inherit; }\n\n.controls > .controls-group {\n margin-left: 5px;\n border-left: 1px solid black;\n padding-left: 5px; }\n .controls > .controls-group:first-child {\n margin-left: 0;\n border-left: none;\n padding-left: 0; }\n\n.controls-group {\n display: inline-block;\n margin: 5px 0; }\n .controls-group > * {\n display: inline-block;\n margin-left: 5px; }\n .controls-group > *:first-child {\n margin-left: 0; }\n\n.nested-list {\n width: 500px;\n padding: 5px 0 0 0;\n list-style-type: none;\n margin: 0 0 0 5px;\n z-index: 0;\n position: relative; }\n .nested-list .nested-list-content {\n display: inline-block; }\n .nested-list .nested-list-content .icon {\n margin-left: 5px; }\n .nested-list .nested-list-content .content {\n margin-left: 5px; }\n .nested-list:before {\n content: '';\n position: absolute;\n display: block;\n width: 0;\n top: 0;\n bottom: 0;\n left: 0;\n border-left: 1px solid black; }\n .nested-list > li {\n padding-left: 15px;\n line-height: 1.5em;\n position: relative; }\n .nested-list > li:before {\n content: '';\n position: absolute;\n display: block;\n width: 15px;\n height: 0;\n margin-top: 1px;\n top: 0.75em;\n left: 0;\n border-top: 1px solid black; }\n .nested-list > li:last-child:before {\n background-color: #eee6ff;\n height: auto;\n top: 0.75em;\n bottom: 0; }\n",""])},function(e,n,t){"use strict";function o(e){return null==e?void 0===e?l:s:u&&u in Object(e)?t.i(i.a)(e):t.i(a.a)(e)}var r=t(5),i=t(29),a=t(30),s="[object Null]",l="[object Undefined]",u=r.a?r.a.toStringTag:void 0;n.a=o},function(e,n,t){"use strict";(function(e){var t="object"==typeof e&&e&&e.Object===Object&&e;n.a=t}).call(n,t(11))},function(e,n,t){"use strict";var o=t(31),r=t.i(o.a)(Object.getPrototypeOf,Object);n.a=r},function(e,n,t){"use strict";function o(e){var n=a.call(e,l),t=e[l];try{e[l]=void 0;var o=!0}catch(e){}var r=s.call(e);return o&&(n?e[l]=t:delete e[l]),r}var r=t(5),i=Object.prototype,a=i.hasOwnProperty,s=i.toString,l=r.a?r.a.toStringTag:void 0;n.a=o},function(e,n,t){"use strict";function o(e){return i.call(e)}var r=Object.prototype,i=r.toString;n.a=o},function(e,n,t){"use strict";function o(e,n){return function(t){return e(n(t))}}n.a=o},function(e,n,t){"use strict";var o=t(27),r="object"==typeof self&&self&&self.Object===Object&&self,i=o.a||r||Function("return this")();n.a=i},function(e,n,t){"use strict";function o(e){return null!=e&&"object"==typeof e}n.a=o},function(e,n,t){"use strict";function o(){for(var e=arguments.length,n=Array(e),t=0;t<e;t++)n[t]=arguments[t];return function(e){return function(t,o,a){var s=e(t,o,a),l=s.dispatch,u=[],c={getState:s.getState,dispatch:function(e){return l(e)}};return u=n.map(function(e){return e(c)}),l=r.a.apply(void 0,u)(s.dispatch),i({},s,{dispatch:l})}}}n.a=o;var r=t(7),i=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e}},function(e,n,t){"use strict";function o(e,n){return function(){return n(e.apply(void 0,arguments))}}function r(e,n){if("function"==typeof e)return o(e,n);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var t=Object.keys(e),r={},i=0;i<t.length;i++){var a=t[i],s=e[a];"function"==typeof s&&(r[a]=o(s,n))}return r}n.a=r},function(e,n,t){"use strict";function o(e,n){var t=n&&n.type;return"Given action "+(t&&'"'+t.toString()+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state.'}function r(e){Object.keys(e).forEach(function(n){var t=e[n];if(void 0===t(void 0,{type:a.b.INIT}))throw new Error('Reducer "'+n+'" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.');if(void 0===t(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+n+"\" returned undefined when probed with a random type. Don't try to handle "+a.b.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined.')})}function i(e){for(var n=Object.keys(e),t={},i=0;i<n.length;i++){var a=n[i];"function"==typeof e[a]&&(t[a]=e[a])}var s,l=Object.keys(t);try{r(t)}catch(e){s=e}return function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=arguments[1];if(s)throw s;for(var r=!1,i={},a=0;a<l.length;a++){var u=l[a],c=t[u],f=e[u],d=c(f,n);if(void 0===d){var p=o(u,n);throw new Error(p)}i[u]=d,r=r||d!==f}return r?i:e}}n.a=i;var a=t(8);t(6),t(9)},function(e,n){e.exports=function(e){var n="undefined"!=typeof window&&window.location;if(!n)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var t=n.protocol+"//"+n.host,o=t+n.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,n){var r=n.trim().replace(/^"(.*)"$/,function(e,n){return n}).replace(/^'(.*)'$/,function(e,n){return n});if(/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(r))return e;var i;return i=0===r.indexOf("//")?r:0===r.indexOf("/")?t+r:o+r.replace(/^\.\//,""),"url("+JSON.stringify(i)+")"})}},function(e,n,t){e.exports=t(39)},function(e,n,t){"use strict";(function(e,o){Object.defineProperty(n,"__esModule",{value:!0});var r,i=t(40),a=function(e){return e&&e.__esModule?e:{default:e}}(i);r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:o;var s=(0,a.default)(r);n.default=s}).call(n,t(11),t(41)(e))},function(e,n,t){"use strict";function o(e){var n,t=e.Symbol;return"function"==typeof t?t.observable?n=t.observable:(n=t("observable"),t.observable=n):n="@@observable",n}Object.defineProperty(n,"__esModule",{value:!0}),n.default=o},function(e,n){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}}]);