bullet_train-fields 1.0.18 → 1.0.19

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
  SHA256:
3
- metadata.gz: e3298192458d16e5eb32a19b4644c328af13cb6dd7fc8992374eb54b14933534
4
- data.tar.gz: f54c1624d5b5574f495f8db87ffdae63bc398f8bc6b1d55432a430bac05f08d1
3
+ metadata.gz: 955500ace762c8286cd55318ac27669c0967adfcd5198c6c88db4542f9c553a9
4
+ data.tar.gz: 391e21fabc859f7ea4b209fc676d5e33a215dcc3defb14bb0726a05176d3976b
5
5
  SHA512:
6
- metadata.gz: 276ce35081f2c04cf75cdf569355817d72513c55f61d5dfb95d849597f7085b6ccc2df3a824ea0a136d8b1784fac6faa58f5265717e436bcf9e5e752a8580bdc
7
- data.tar.gz: 1b0addad1980538fd7c8bc506e60a064e551ab75339129bdc4bab53208be2fd8fcc23a536e1a270db3b6b36b2b59ca9ea34074c0c40a8767c50b6fb0f58d9322
6
+ metadata.gz: b6ba652dfd29a7550d65b51f05b8c68e318731e0fc40064a9d21f2306442608a026a12f9f5f14e4c55d2cbc1f8da1a4d1cc410fac03916bd0da0d37ab2cadfd5
7
+ data.tar.gz: e70c866711efec589e7f64a4b32b42ceaa8e8b0f53487adb294ad5332bda66490e551d0db4dd620be4e26e420ba551f3b5e33390e8e341ded720901956d8942d
@@ -3,9 +3,12 @@ import '@simonwep/pickr/dist/themes/monolith.min.css'
3
3
 
4
4
  import Pickr from '@simonwep/pickr';
5
5
 
6
+ const pickerHexInputSelector = 'input.pcr-result'
7
+
6
8
  export default class extends Controller {
7
- static targets = [ "colorPickerValue", "colorField", "colorInput", "userSelectedColor", "colorOptions" ];
9
+ static targets = [ "colorPickerValue", "colorField", "colorInput", "userSelectedColor", "colorOptions", "pickerContainer", "togglePickerButton", "colorButton" ];
8
10
  static values = { initialColor: String }
11
+ static classes = [ "colorSelected" ]
9
12
 
10
13
  connect() {
11
14
  this.initPluginInstance()
@@ -25,11 +28,9 @@ export default class extends Controller {
25
28
  $(this.colorInputTarget).val(color);
26
29
  $(this.colorPickerValueTarget).val(color);
27
30
  $(this.userSelectedColorTarget).data('color', color);
28
- $('.button-color').removeClass('ring-2 ring-offset-2');
31
+ this.highlightColorButtonsMatchingSelectedColor()
29
32
 
30
33
  this.pickr.setColor(color);
31
-
32
- targetEl.classList.add('ring-2', 'ring-offset-2');
33
34
  }
34
35
 
35
36
  pickRandomColor(event) {
@@ -50,7 +51,7 @@ export default class extends Controller {
50
51
  $(this.colorInputTarget).val(color);
51
52
  $(this.colorPickerValueTarget).val(color);
52
53
 
53
- $('.button-color').removeClass('ring-2 ring-offset-2');
54
+ this.highlightColorButtonsMatchingSelectedColor()
54
55
 
55
56
  $(this.userSelectedColorTarget)
56
57
  .addClass('ring-2')
@@ -66,7 +67,18 @@ export default class extends Controller {
66
67
  $(this.colorPickerValueTarget).val('');
67
68
  $(this.colorInputTarget).val('');
68
69
  $(this.userSelectedColorTarget).hide();
69
- $('.button-color').removeClass('ring-2 ring-offset-2');
70
+ this.highlightColorButtonsMatchingSelectedColor()
71
+ }
72
+
73
+ highlightColorButtonsMatchingSelectedColor() {
74
+ this.colorButtonTargets.forEach((button) => {
75
+ const buttonColor = button.dataset?.color
76
+ if (this.selectedColor !== undefined && buttonColor === this.selectedColor) {
77
+ button.classList.add(...this.colorSelectedClasses)
78
+ } else {
79
+ button.classList.remove(...this.colorSelectedClasses)
80
+ }
81
+ })
70
82
  }
71
83
 
72
84
  togglePickr(event) {
@@ -75,7 +87,8 @@ export default class extends Controller {
75
87
 
76
88
  initPluginInstance() {
77
89
  this.pickr = Pickr.create({
78
- el: '.btn-pickr',
90
+ el: this.togglePickerButtonTarget,
91
+ container: this.pickerContainerTarget,
79
92
  theme: 'monolith',
80
93
  useAsButton: true,
81
94
  default: this.initialColorValue || '#1E90FF',
@@ -99,17 +112,22 @@ export default class extends Controller {
99
112
  }
100
113
  this.pickr.hide();
101
114
  });
102
-
103
- const that = this
104
-
105
- $('input[type="text"].pcr-result').on('keydown', function (e) {
106
- if (e.key === 'Enter') {
107
- that.pickr.applyColor(false)
108
- }
109
- })
115
+ }
116
+
117
+ handleKeydown(event) {
118
+ if (!event.target.matches(pickerHexInputSelector)) { return }
119
+ if (event.key !== 'Enter') { return }
120
+
121
+ event.preventDefault()
122
+ event.stopPropagation()
123
+ this.pickr.applyColor(false)
110
124
  }
111
125
 
112
126
  teardownPluginInstance() {
113
127
  this.pickr.destroy()
114
128
  }
129
+
130
+ get selectedColor() {
131
+ return $(this.colorInputTarget).val()
132
+ }
115
133
  }
@@ -0,0 +1,38 @@
1
+ import { Controller } from "@hotwired/stimulus"
2
+ import { Picker } from 'emoji-mart'
3
+
4
+
5
+ export default class extends Controller {
6
+
7
+ static targets = [ "input", "display" ]
8
+
9
+ connect() {
10
+ this.visible = false
11
+ this.picker = new Picker({
12
+ data: async () => {
13
+ const response = await fetch(
14
+ 'https://cdn.jsdelivr.net/npm/@emoji-mart/data',
15
+ )
16
+
17
+ return response.json()
18
+ },
19
+ onEmojiSelect: (emoji) => {
20
+ this.displayTarget.innerHTML = emoji.native
21
+ this.inputTarget.value = emoji.native
22
+ this.element.removeChild(this.picker)
23
+ this.visible = false
24
+ },
25
+
26
+ })
27
+ }
28
+
29
+ toggle(event) {
30
+ event.preventDefault()
31
+ if (this.visible) {
32
+ this.element.removeChild(this.picker)
33
+ } else {
34
+ this.element.appendChild(this.picker)
35
+ }
36
+ this.visible = !this.visible
37
+ }
38
+ }
@@ -8,6 +8,7 @@ export default class extends Controller {
8
8
  "removeFileButton",
9
9
  "selectFileButton",
10
10
  "progressBar",
11
+ "progressLabel",
11
12
  ];
12
13
 
13
14
  connect() {
@@ -16,10 +17,10 @@ export default class extends Controller {
16
17
  "direct-upload:initialize",
17
18
  (event) => {
18
19
  this.selectFileButtonTarget.classList.add("hidden");
19
- this.progressBarTarget.innerText = "0%";
20
20
  this.progressBarTarget.style.width = "0%";
21
21
  this.progressBarTarget.setAttribute("aria-valuenow", 0);
22
22
  this.progressBarTarget.parentNode.classList.remove("hidden");
23
+ this.progressLabel.innerText = "0%";
23
24
  }
24
25
  );
25
26
 
@@ -29,9 +30,13 @@ export default class extends Controller {
29
30
  const { progress } = event.detail;
30
31
  const width = `${progress.toFixed(1)}%`;
31
32
 
32
- this.progressBarTarget.innerText = width;
33
33
  this.progressBarTarget.setAttribute("aria-valuenow", progress);
34
34
  this.progressBarTarget.style.width = width;
35
+ this.progressLabelTarget.innerText = width;
36
+
37
+ if (progress >= 50 && !this.progressLabelTarget.classList.contains("animate-pulse")) {
38
+ this.progressLabelTarget.classList.add("animate-pulse");
39
+ }
35
40
  }
36
41
  );
37
42
 
@@ -4,6 +4,7 @@ import ButtonToggleController from './fields/button_toggle_controller'
4
4
  import CloudinaryImageController from './fields/cloudinary_image_controller'
5
5
  import ColorPickerController from './fields/color_picker_controller'
6
6
  import DateController from './fields/date_controller'
7
+ import EmojiPickerController from './fields/emoji_picker_controller'
7
8
  import FileFieldController from './fields/file_field_controller'
8
9
  import PasswordController from './fields/password_controller'
9
10
  import PhoneController from './fields/phone_controller'
@@ -14,6 +15,7 @@ export const controllerDefinitions = [
14
15
  [CloudinaryImageController, 'fields/cloudinary_image_controller.js'],
15
16
  [ColorPickerController, 'fields/color_picker_controller.js'],
16
17
  [DateController, 'fields/date_controller.js'],
18
+ [EmojiPickerController, 'fields/emoji_picker_controller.js'],
17
19
  [FileFieldController, 'fields/file_field_controller.js'],
18
20
  [PasswordController, 'fields/password_controller.js'],
19
21
  [PhoneController, 'fields/phone_controller.js'],
@@ -32,8 +34,9 @@ export {
32
34
  CloudinaryImageController,
33
35
  ColorPickerController,
34
36
  DateController,
37
+ EmojiPickerController,
35
38
  FileFieldController,
36
39
  PasswordController,
37
40
  PhoneController,
38
41
  SuperSelectController,
39
- }
42
+ }
@@ -2,7 +2,10 @@ module BulletTrain
2
2
  module Fields
3
3
  class Engine < ::Rails::Engine
4
4
  initializer "bullet_train.fields" do |app|
5
- BulletTrain.linked_gems << "bullet_train-fields"
5
+ # Older versions of Bullet Train have a `BulletTrain` module, but it doesn't have `linked_gems`.
6
+ if BulletTrain.respond_to?(:linked_gems)
7
+ BulletTrain.linked_gems << "bullet_train-fields"
8
+ end
6
9
  end
7
10
  end
8
11
  end
@@ -1,5 +1,5 @@
1
1
  module BulletTrain
2
2
  module Fields
3
- VERSION = "1.0.18"
3
+ VERSION = "1.0.19"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-fields
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.18
4
+ version: 1.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-21 00:00:00.000000000 Z
11
+ date: 2022-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: standard
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rails
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -78,15 +92,6 @@ files:
78
92
  - README.md
79
93
  - Rakefile
80
94
  - app/assets/config/bullet_train_fields_manifest.js
81
- - app/assets/javascripts/fields.esm.js
82
- - app/assets/javascripts/fields.esm.js.map
83
- - app/assets/javascripts/fields.js
84
- - app/assets/javascripts/fields.js.map
85
- - app/assets/javascripts/fields.modern.js
86
- - app/assets/javascripts/fields.modern.js.map
87
- - app/assets/javascripts/fields.umd.js
88
- - app/assets/javascripts/fields.umd.js.map
89
- - app/assets/javascripts/intl-tel-input-utils.js
90
95
  - app/controllers/account/cloudinary/upload_signatures_controller.rb
91
96
  - app/controllers/concerns/fields/boolean_support.rb
92
97
  - app/controllers/concerns/fields/controller_support.rb
@@ -103,6 +108,7 @@ files:
103
108
  - app/javascript/controllers/fields/cloudinary_image_controller.js
104
109
  - app/javascript/controllers/fields/color_picker_controller.js
105
110
  - app/javascript/controllers/fields/date_controller.js
111
+ - app/javascript/controllers/fields/emoji_picker_controller.js
106
112
  - app/javascript/controllers/fields/file_field_controller.js
107
113
  - app/javascript/controllers/fields/password_controller.js
108
114
  - app/javascript/controllers/fields/phone_controller.js
@@ -1,2 +0,0 @@
1
- import{Controller as e}from"@hotwired/stimulus";import"@simonwep/pickr/dist/themes/monolith.min.css";import t from"@simonwep/pickr";import"daterangepicker";import i from"zxcvbn";import s from"intl-tel-input";import a from"select2";import n from"tributejs";function r(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}class l extends e{clickShadowField(e){e.preventDefault(),this.shadowFieldTarget.click()}}l.targets=["shadowField"];class o extends e{pickImageAndUpload(e){e.preventDefault();var t=["local","url","camera"];this.hasGoogleApiKeyValue&&t.push("image_search");var i={cloud_name:this.cloudNameValue,apiKey:this.apiKeyValue,upload_preset:this.uploadPresetValue,upload_signature:this.getCloudinarySignature.bind(this),multiple:!1,sources:this.hasSourcesValue?this.sourcesValue.split(","):t,search_by_rights:!this.hasSearchByRightsValue||!1!==this.searchByRightsValue};this.hasGoogleApiKeyValue&&(i.google_api_key=this.googleApiKeyValue),cloudinary.openUploadWidget(i,this.handleWidgetResponse.bind(this))}clearImage(e){e.preventDefault(),this.hiddenFieldTarget.value=null,this.removeThumbnail()}getCloudinarySignature(e,t){$.ajax({url:this.signaturesUrlValue,type:"GET",dataType:"text",data:{data:t},complete:function(){console.log("complete")},success:function(t,i,s){e(t)},error:function(e,t,i){console.log(e,t,i)}})}handleWidgetResponse(e,t){if(!e&&t&&"success"===t.event){const e=t.info;this.hiddenFieldTarget.value=e.public_id,this.removeThumbnail(),this.addThumbnail(this.urlFormatValue.replace("CLOUDINARY_ID",e.public_id))}}addThumbnail(e){var t=$('<img src="'+e+'" width="'+this.widthValue+'" height="'+this.heightValue+'" data-'+this.identifier+'-target="thumbnail" />');$(this.uploadButtonTarget).prepend(t),this.uploadButtonTarget.classList.add(this.thumbnailShownClass)}removeThumbnail(){this.hasThumbnailTarget&&(this.uploadButtonTarget.removeChild(this.thumbnailTarget),this.uploadButtonTarget.classList.remove(this.thumbnailShownClass))}}o.targets=["uploadButton","hiddenField","thumbnail"],o.values={signaturesUrl:String,height:Number,width:Number,cloudName:String,apiKey:String,googleApiKey:String,urlFormat:String,sources:String,searchByRights:Boolean},o.classes=["thumbnailShown"];class c extends e{connect(){this.initPluginInstance(),this.colorOptions=$(this.colorOptionsTarget).find("button").map(function(e,t){return $(t).attr("data-color")}).get()}disconnect(){this.teardownPluginInstance()}pickColor(e){e.preventDefault();const t=e.target,i=t.dataset.color;$(this.colorInputTarget).val(i),$(this.colorPickerValueTarget).val(i),$(this.userSelectedColorTarget).data("color",i),$(".button-color").removeClass("ring-2 ring-offset-2"),this.pickr.setColor(i),t.classList.add("ring-2","ring-offset-2")}pickRandomColor(e){e.preventDefault();const t=Math.floor(256*Math.random()),i=Math.floor(256*Math.random()),s=Math.floor(256*Math.random());this.pickr.setColor("rgb "+t+" "+i+" "+s);const a=this.pickr.getColor().toHEXA().toString();this.pickr.setColor(a),this.showUserSelectedColor(a)}showUserSelectedColor(e){$(this.colorInputTarget).val(e),$(this.colorPickerValueTarget).val(e),$(".button-color").removeClass("ring-2 ring-offset-2"),$(this.userSelectedColorTarget).addClass("ring-2").addClass("ring-offset-2").css("background-color",e).css("--tw-ring-color",e).attr("data-color",e).show()}unpickColor(e){e.preventDefault(),$(this.colorPickerValueTarget).val(""),$(this.colorInputTarget).val(""),$(this.userSelectedColorTarget).hide(),$(".button-color").removeClass("ring-2 ring-offset-2")}togglePickr(e){e.preventDefault()}initPluginInstance(){this.pickr=t.create({el:".btn-pickr",theme:"monolith",useAsButton:!0,default:this.initialColorValue||"#1E90FF",components:{preview:!0,hue:!0,interaction:{input:!0,save:!0}}}),this.pickr.on("save",(e,t)=>{const i=e.toHEXA().toString();this.colorOptions.includes(i)||this.showUserSelectedColor(i),this.pickr.hide()});const e=this;$('input[type="text"].pcr-result').on("keydown",function(t){"Enter"===t.key&&e.pickr.applyColor(!1)})}teardownPluginInstance(){this.pickr.destroy()}}c.targets=["colorPickerValue","colorField","colorInput","userSelectedColor","colorOptions"],c.values={initialColor:String},require("daterangepicker/daterangepicker.css");class d extends e{connect(){this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}clearDate(e){e.preventDefault(),$(this.fieldTarget).val("")}applyDateToField(e,t){const i=this.includeTimeValue?"MM/DD/YYYY h:mm A":"MM/DD/YYYY";$(this.fieldTarget).val(t.startDate.format(i)),this.fieldTarget.dispatchEvent(new CustomEvent("change",{detail:{picker:t}}))}showTimeZoneButtons(e){e.preventDefault(),$(this.currentTimeZoneWrapperTarget).toggleClass("hidden"),$(this.timeZoneButtonsTarget).toggleClass("hidden")}showTimeZoneSelectWrapper(e){e.preventDefault(),$(this.timeZoneButtonsTarget).toggleClass("hidden"),this.hasTimeZoneSelectWrapperTarget&&$(this.timeZoneSelectWrapperTarget).toggleClass("hidden")}resetTimeZoneUI(e){e&&e.preventDefault(),$(this.currentTimeZoneWrapperTarget).removeClass("hidden"),$(this.timeZoneButtonsTarget).addClass("hidden"),this.hasTimeZoneSelectWrapperTarget&&$(this.timeZoneSelectWrapperTarget).addClass("hidden")}setTimeZone(e){e.preventDefault();const t=this.currentTimeZoneWrapperTarget.querySelector("a"),{value:i}=e.target.dataset;$(this.timeZoneFieldTarget).val(i),$(t).text(i),$(".time-zone-button").removeClass("button").addClass("button-alternative"),$(e.target).removeClass("button-alternative").addClass("button"),this.resetTimeZoneUI()}initPluginInstance(){if($(this.fieldTarget).daterangepicker({singleDatePicker:!0,timePicker:this.includeTimeValue,timePickerIncrement:5,autoUpdateInput:!1,locale:{cancelLabel:this.cancelButtonLabelValue,applyLabel:this.applyButtonLabelValue,format:this.includeTimeValue?"MM/DD/YYYY h:mm A":"MM/DD/YYYY"}}),$(this.fieldTarget).on("apply.daterangepicker",this.applyDateToField.bind(this)),$(this.fieldTarget).on("cancel.daterangepicker",this.clearDate.bind(this)),this.pluginMainEl=this.fieldTarget,this.plugin=$(this.pluginMainEl).data("daterangepicker"),this.includeTimeValue&&this.hasTimeZoneSelectWrapperTarget){this.timeZoneSelect=this.timeZoneSelectWrapperTarget.querySelector("select.select2"),$(this.timeZoneSelect).select2({width:"style"});const e=this;$(this.timeZoneSelect).on("change.select2",function(t){const i=e.currentTimeZoneWrapperTarget.querySelector("a"),{value:s}=t.target;$(e.timeZoneFieldTarget).val(s),$(i).text(s);const a=$(".selected-option-time-zone-button");e.defaultTimeZonesValue.includes(s)?($(".time-zone-button").removeClass("button").addClass("button-alternative"),a.addClass("hidden").attr("hidden",!0),$('a[data-value="'+s+'"').removeClass("button-alternative").addClass("button")):($(".time-zone-button").removeClass("button").addClass("button-alternative"),a.text(s),a.attr("data-value",s).removeAttr("hidden"),a.removeClass(["hidden","button-alternative"]).addClass("button")),e.resetTimeZoneUI()})}}teardownPluginInstance(){void 0!==this.plugin&&($(this.pluginMainEl).off("apply.daterangepicker"),$(this.pluginMainEl).off("cancel.daterangepicker"),this.plugin.remove(),this.includeTimeValue&&$(this.timeZoneSelect).select2("destroy"))}}d.targets=["field","clearButton","currentTimeZoneWrapper","timeZoneButtons","timeZoneSelectWrapper","timeZoneField"],d.values={includeTime:Boolean,defaultTimeZones:Array,cancelButtonLabel:{type:String,default:"Cancel"},applyButtonLabel:{type:String,default:"Apply"}};class u extends e{connect(){const e=document.addEventListener("direct-upload:initialize",e=>{this.selectFileButtonTarget.classList.add("hidden"),this.progressBarTarget.innerText="0%",this.progressBarTarget.style.width="0%",this.progressBarTarget.setAttribute("aria-valuenow",0),this.progressBarTarget.parentNode.classList.remove("hidden")}),t=document.addEventListener("direct-upload:progress",e=>{const{progress:t}=e.detail,i=t.toFixed(1)+"%";this.progressBarTarget.innerText=i,this.progressBarTarget.setAttribute("aria-valuenow",t),this.progressBarTarget.style.width=i}),i=document.addEventListener("direct-upload:error",e=>{e.preventDefault();const{error:t}=e.detail;this.progressBarTarget.innerText=t});this.uploadListeners={"direct-upload:initialize":e,"direct-upload:progress":t,"direct-upload:error":i}}disconnect(){for(const e in this.uploadListeners)document.removeEventListener(e,this.uploadListeners[e])}uploadFile(){this.fileFieldTarget.click()}removeFile(){this.hasDownloadFileButtonTarget&&this.downloadFileButtonTarget.classList.add("hidden"),this.removeFileButtonTarget.classList.add("hidden"),this.removeFileFlagTarget.value=!0}handleFileSelected(){const e=this.selectFileButtonTarget.querySelector("span"),t=this.selectFileButtonTarget.querySelector("i");this.hasDownloadFileButtonTarget&&this.downloadFileButtonTarget.remove(),e.innerText="Select Another File",t.classList.remove("ti-upload"),t.classList.add("ti-check")}}u.targets=["fileField","removeFileFlag","downloadFileButton","removeFileButton","selectFileButton","progressBar"];class h extends e{estimateStrength(e){const t=i(e.target.value);t.feedback&&t.feedback.warning.length>0?(this.strengthIndicatorTarget.innerText=t.feedback.warning+".",this.strengthIndicatorTarget.classList.remove("hidden")):this.strengthIndicatorTarget.classList.add("hidden")}}h.targets=["strengthIndicator"],require("intl-tel-input/build/css/intlTelInput.css");class g extends e{connect(){this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}initPluginInstance(){let e={hiddenInput:this.fieldTarget.dataset.method,customContainer:"w-full"};const t=function(e){const t=document.head.querySelector('meta[name="intl_tel_input_utils_path"]');return t&&t.content}();t&&(e.utilsScript=t),this.plugin=s(this.fieldTarget,e)}teardownPluginInstance(){void 0!==this.plugin&&this.plugin.destroy()}}g.targets=["field"],require("select2/dist/css/select2.min.css");class p extends e{initialize(){this.dispatchNativeEvent=this.dispatchNativeEvent.bind(this),this.isSelect2LoadedOnWindowJquery&&a(window.$)}get isSelect2LoadedOnWindowJquery(){return void 0!==window.$&&void 0===window.$.select2}connect(){this.isSelect2LoadedOnWindowJquery&&this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}cleanupBeforeInit(){$(this.element).find(".select2-container--default").remove()}initPluginInstance(){let e={};this.enableSearchValue||(e.minimumResultsForSearch=-1),e.tags=this.acceptsNewValue,this.searchUrlValue&&(e.ajax={url:this.searchUrlValue,dataType:"json",data:function(e){return{search:e.term,page:e.page||1}}}),e.templateResult=this.formatState,e.templateSelection=this.formatState,e.width="style",this.cleanupBeforeInit(),this.pluginMainEl=this.selectTarget,$(this.pluginMainEl).select2(e),this.initReissuePluginEventsAsNativeEvents()}teardownPluginInstance(){void 0!==this.pluginMainEl&&(this.teardownPluginEventsAsNativeEvents(),$(this.pluginMainEl).select2("destroy"))}initReissuePluginEventsAsNativeEvents(){this.constructor.jQueryEventsToReissue.forEach(e=>{$(this.pluginMainEl).on(e,this.dispatchNativeEvent)})}teardownPluginEventsAsNativeEvents(){this.constructor.jQueryEventsToReissue.forEach(e=>{$(this.pluginMainEl).off(e)})}dispatchNativeEvent(e){this.element.dispatchEvent(new CustomEvent("$"+e.type,{detail:{event:e},bubbles:!0,cancelable:!1}))}formatState(e){var t=$(e.element).attr("data-image"),i="";return t&&(i='<img src="'+t+'" /> '),$("<span>"+i+e.text.replace(/[^\w. ]/gi,function(e){return"&#"+e.charCodeAt(0)+";"})+"</span>")}}p.targets=["select"],p.values={acceptsNew:Boolean,enableSearch:Boolean,searchUrl:String},p.jQueryEventsToReissue=["change","select2:closing","select2:close","select2:opening","select2:open","select2:selecting","select2:select","select2:unselecting","select2:unselect","select2:clearing","select2:clear"];const m=[[l,"fields/button_toggle_controller.js"],[o,"fields/cloudinary_image_controller.js"],[c,"fields/color_picker_controller.js"],[d,"fields/date_controller.js"],[u,"fields/file_field_controller.js"],[h,"fields/password_controller.js"],[g,"fields/phone_controller.js"],[p,"fields/super_select_controller.js"]].map(function(e){const t=e[0];return{identifier:r(e[1]),controllerConstructor:t}});function v(){document.addEventListener("trix-initialize",function(){addEventListener("trix-focus",f),addEventListener("trix-blur",f),f(),document.querySelectorAll("trix-editor").forEach((e,t)=>{var i=e.editor,s={trigger:"@",values:JSON.parse(i.element.dataset.mentions),selectTemplate:function(e){return'<a href="'+(e=e.original).protocol+"://"+e.model+"/"+e.id+'">'+e.label+"</a>"},menuItemTemplate:function(e){return'<img src="'+e.original.photo+'" /> '+e.string},requireLeadingSpace:!0,replaceTextSuffix:""},a={trigger:"#",values:JSON.parse(i.element.dataset.topics),selectTemplate:function(e){return'<a href="'+(e=e.original).protocol+"://"+e.model+"/"+e.id+'">'+e.label+"</a>"},menuItemTemplate:function(e){return'<img src="'+e.original.photo+'" /> '+e.string},requireLeadingSpace:!0,replaceTextSuffix:""};new n({collection:[a,s]}).attach(e)})})}function f(){document.querySelectorAll("trix-editor").forEach((e,t)=>{var i=e.toolbarElement;e==document.activeElement?i.classList.add("visible"):i.contains(document.activeElement)||i.classList.remove("visible")})}require("trix/dist/trix.css"),require("trix"),require("@rails/actiontext");export{l as ButtonToggleController,o as CloudinaryImageController,c as ColorPickerController,d as DateController,u as FileFieldController,h as PasswordController,g as PhoneController,p as SuperSelectController,m as controllerDefinitions,v as trixEditor};
2
- //# sourceMappingURL=fields.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fields.esm.js","sources":["../../../node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js","../../javascript/controllers/fields/button_toggle_controller.js","../../javascript/controllers/fields/cloudinary_image_controller.js","../../javascript/controllers/fields/color_picker_controller.js","../../javascript/controllers/fields/date_controller.js","../../javascript/controllers/fields/file_field_controller.js","../../javascript/controllers/fields/password_controller.js","../../javascript/controllers/fields/phone_controller.js","../../javascript/controllers/fields/super_select_controller.js","../../javascript/controllers/index.js","../../javascript/trix_editor.js"],"sourcesContent":["/*\nStimulus Webpack Helpers 1.0.0\nCopyright © 2021 Basecamp, LLC\n */\nfunction definitionsFromContext(context) {\n return context.keys()\n .map((key) => definitionForModuleWithContextAndKey(context, key))\n .filter((value) => value);\n}\nfunction definitionForModuleWithContextAndKey(context, key) {\n const identifier = identifierForContextKey(key);\n if (identifier) {\n return definitionForModuleAndIdentifier(context(key), identifier);\n }\n}\nfunction definitionForModuleAndIdentifier(module, identifier) {\n const controllerConstructor = module.default;\n if (typeof controllerConstructor == \"function\") {\n return { identifier, controllerConstructor };\n }\n}\nfunction identifierForContextKey(key) {\n const logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n if (logicalName) {\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n }\n}\n\nexport { definitionForModuleAndIdentifier, definitionForModuleWithContextAndKey, definitionsFromContext, identifierForContextKey };\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = [ \"shadowField\" ]\n\n clickShadowField(event) {\n // we have to stop safari from doing what we originally expected.\n event.preventDefault();\n\n // then we need to manually click the hidden checkbox or radio button ourselves.\n this.shadowFieldTarget.click()\n }\n}","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = [ \"uploadButton\", \"hiddenField\", \"thumbnail\" ]\n static values = { \n signaturesUrl: String,\n height: Number,\n width: Number,\n cloudName: String,\n apiKey: String,\n googleApiKey: String,\n urlFormat: String,\n sources: String,\n searchByRights: Boolean\n }\n static classes = [ \"thumbnailShown\" ]\n\n pickImageAndUpload(event) {\n // don't submit the form.\n event.preventDefault()\n\n // prepare the list of default sources a user can upload an image from.\n var defaultSources = ['local', 'url', 'camera']\n if (this.hasGoogleApiKeyValue) {\n defaultSources.push('image_search')\n }\n\n // configure cloudinary's uploader's options.\n // many of these are configurable at the point where the `shared/fields/cloudinary_image` partial is included.\n var options = {\n cloud_name: this.cloudNameValue,\n apiKey: this.apiKeyValue,\n upload_preset: this.uploadPresetValue,\n upload_signature: this.getCloudinarySignature.bind(this),\n multiple: false,\n sources: this.hasSourcesValue ? this.sourcesValue.split(',') : defaultSources,\n search_by_rights: this.hasSearchByRightsValue && this.searchByRightsValue === false ? false : true // default to true.\n }\n \n if (this.hasGoogleApiKeyValue) {\n options['google_api_key'] = this.googleApiKeyValue\n }\n \n // open cloudinary's upload widget.\n cloudinary.openUploadWidget(options, this.handleWidgetResponse.bind(this))\n }\n \n clearImage(event) {\n // don't submit the form.\n event.preventDefault()\n\n // clear the cloudinary id.\n this.hiddenFieldTarget.value = null\n \n // remove any existing image from the button.\n this.removeThumbnail()\n }\n \n getCloudinarySignature(callback, paramsToSign) {\n $.ajax({\n url: this.signaturesUrlValue,\n type: \"GET\",\n dataType: \"text\",\n data: {data: paramsToSign},\n complete: function() { console.log(\"complete\") },\n success: function(signature, textStatus, xhr) { callback(signature) },\n error: function(xhr, status, error) { console.log(xhr, status, error) }\n })\n }\n \n handleWidgetResponse(error, response) {\n // after the user has successfully uploaded a single file ..\n if (!error && response && response.event === \"success\") { \n const data = response.info\n \n // update the cloudinary id field in the form.\n this.hiddenFieldTarget.value = data.public_id\n\n // remove any existing image.\n this.removeThumbnail()\n\n // generate a new image preview url.\n this.addThumbnail(this.urlFormatValue.replace('CLOUDINARY_ID', data.public_id))\n }\n }\n \n addThumbnail(url) {\n var $imageElement = $(`<img src=\"${url}\" width=\"${this.widthValue}\" height=\"${this.heightValue}\" data-${this.identifier}-target=\"thumbnail\" />`)\n $(this.uploadButtonTarget).prepend($imageElement)\n\n // mark the image as present.\n this.uploadButtonTarget.classList.add(this.thumbnailShownClass)\n }\n \n removeThumbnail() {\n if (!this.hasThumbnailTarget) { return }\n this.uploadButtonTarget.removeChild(this.thumbnailTarget)\n this.uploadButtonTarget.classList.remove(this.thumbnailShownClass)\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport '@simonwep/pickr/dist/themes/monolith.min.css'\n\nimport Pickr from '@simonwep/pickr';\n\nexport default class extends Controller {\n static targets = [ \"colorPickerValue\", \"colorField\", \"colorInput\", \"userSelectedColor\", \"colorOptions\" ];\n static values = { initialColor: String }\n\n connect() {\n this.initPluginInstance()\n this.colorOptions = $(this.colorOptionsTarget).find('button').map(function (_, button) { return $(button).attr('data-color'); }).get()\n }\n\n disconnect() {\n this.teardownPluginInstance()\n }\n\n pickColor(event) {\n event.preventDefault();\n\n const targetEl = event.target;\n const color = targetEl.dataset.color;\n\n $(this.colorInputTarget).val(color);\n $(this.colorPickerValueTarget).val(color);\n $(this.userSelectedColorTarget).data('color', color);\n $('.button-color').removeClass('ring-2 ring-offset-2');\n\n this.pickr.setColor(color);\n\n targetEl.classList.add('ring-2', 'ring-offset-2');\n }\n\n pickRandomColor(event) {\n event.preventDefault();\n\n const r = Math.floor(Math.random() * 256);\n const g = Math.floor(Math.random() * 256);\n const b = Math.floor(Math.random() * 256);\n\n this.pickr.setColor(`rgb ${r} ${g} ${b}`);\n const hexColor = this.pickr.getColor().toHEXA().toString();\n this.pickr.setColor(hexColor);\n\n this.showUserSelectedColor(hexColor);\n }\n\n showUserSelectedColor(color) {\n $(this.colorInputTarget).val(color);\n $(this.colorPickerValueTarget).val(color);\n\n $('.button-color').removeClass('ring-2 ring-offset-2');\n\n $(this.userSelectedColorTarget)\n .addClass('ring-2')\n .addClass('ring-offset-2')\n .css('background-color', color)\n .css('--tw-ring-color', color)\n .attr('data-color', color)\n .show();\n }\n\n unpickColor(event) {\n event.preventDefault();\n $(this.colorPickerValueTarget).val('');\n $(this.colorInputTarget).val('');\n $(this.userSelectedColorTarget).hide();\n $('.button-color').removeClass('ring-2 ring-offset-2');\n }\n\n togglePickr(event) {\n event.preventDefault();\n }\n\n initPluginInstance() {\n this.pickr = Pickr.create({\n el: '.btn-pickr',\n theme: 'monolith',\n useAsButton: true,\n default: this.initialColorValue || '#1E90FF',\n components: {\n // Main components\n preview: true,\n hue: true,\n\n // Input / output Options\n interaction: {\n input: true,\n save: true,\n },\n }\n });\n\n this.pickr.on('save', (color, _instance) => {\n const hexaColor = color.toHEXA().toString()\n if (!this.colorOptions.includes(hexaColor)) {\n this.showUserSelectedColor(hexaColor);\n }\n this.pickr.hide();\n });\n\n const that = this\n\n $('input[type=\"text\"].pcr-result').on('keydown', function (e) {\n if (e.key === 'Enter') {\n that.pickr.applyColor(false)\n }\n })\n }\n\n teardownPluginInstance() {\n this.pickr.destroy()\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nrequire(\"daterangepicker/daterangepicker.css\");\n\n// requires jQuery, moment, might want to consider a vanilla JS alternative\nimport 'daterangepicker';\n\nexport default class extends Controller {\n static targets = [ \"field\", \"clearButton\", \"currentTimeZoneWrapper\", \"timeZoneButtons\", \"timeZoneSelectWrapper\", \"timeZoneField\" ]\n static values = {\n includeTime: Boolean,\n defaultTimeZones: Array,\n cancelButtonLabel: { type: String, default: \"Cancel\" },\n applyButtonLabel: { type: String, default: \"Apply\" }\n }\n\n connect() {\n this.initPluginInstance()\n }\n\n disconnect() {\n this.teardownPluginInstance()\n }\n\n clearDate(event) {\n // don't submit the form, unless it originated from the cancel/clear button\n event.preventDefault()\n\n $(this.fieldTarget).val('')\n }\n\n applyDateToField(event, picker) {\n const format = this.includeTimeValue ? 'MM/DD/YYYY h:mm A' : 'MM/DD/YYYY'\n $(this.fieldTarget).val(picker.startDate.format(format))\n // bubble up a change event when the input is updated for other listeners\n this.fieldTarget.dispatchEvent(new CustomEvent('change', { detail: { picker: picker }}))\n }\n\n showTimeZoneButtons(event) {\n // don't follow the anchor\n event.preventDefault()\n\n $(this.currentTimeZoneWrapperTarget).toggleClass('hidden')\n $(this.timeZoneButtonsTarget).toggleClass('hidden')\n }\n\n showTimeZoneSelectWrapper(event) {\n // don't follow the anchor\n event.preventDefault()\n\n $(this.timeZoneButtonsTarget).toggleClass('hidden')\n\n if (this.hasTimeZoneSelectWrapperTarget) {\n $(this.timeZoneSelectWrapperTarget).toggleClass('hidden')\n }\n }\n\n resetTimeZoneUI(e) {\n e && e.preventDefault()\n\n $(this.currentTimeZoneWrapperTarget).removeClass('hidden')\n $(this.timeZoneButtonsTarget).addClass('hidden')\n\n if (this.hasTimeZoneSelectWrapperTarget) {\n $(this.timeZoneSelectWrapperTarget).addClass('hidden')\n }\n }\n\n setTimeZone(event) {\n // don't follow the anchor\n event.preventDefault()\n\n const currentTimeZoneEl = this.currentTimeZoneWrapperTarget.querySelector('a')\n const {value} = event.target.dataset\n\n $(this.timeZoneFieldTarget).val(value)\n $(currentTimeZoneEl).text(value)\n\n $('.time-zone-button').removeClass('button').addClass('button-alternative')\n $(event.target).removeClass('button-alternative').addClass('button')\n\n this.resetTimeZoneUI()\n }\n\n initPluginInstance() {\n $(this.fieldTarget).daterangepicker({\n singleDatePicker: true,\n timePicker: this.includeTimeValue,\n timePickerIncrement: 5,\n autoUpdateInput: false,\n locale: {\n cancelLabel: this.cancelButtonLabelValue,\n applyLabel: this.applyButtonLabelValue,\n format: this.includeTimeValue ? 'MM/DD/YYYY h:mm A' : 'MM/DD/YYYY'\n }\n })\n\n $(this.fieldTarget).on('apply.daterangepicker', this.applyDateToField.bind(this))\n $(this.fieldTarget).on('cancel.daterangepicker', this.clearDate.bind(this))\n\n this.pluginMainEl = this.fieldTarget\n this.plugin = $(this.pluginMainEl).data('daterangepicker') // weird\n\n // Init time zone select\n if (this.includeTimeValue && this.hasTimeZoneSelectWrapperTarget) {\n this.timeZoneSelect = this.timeZoneSelectWrapperTarget.querySelector('select.select2')\n\n $(this.timeZoneSelect).select2({\n width: 'style'\n })\n\n const self = this\n\n $(this.timeZoneSelect).on('change.select2', function(event) {\n const currentTimeZoneEl = self.currentTimeZoneWrapperTarget.querySelector('a')\n const {value} = event.target\n\n $(self.timeZoneFieldTarget).val(value)\n $(currentTimeZoneEl).text(value)\n\n const selectedOptionTimeZoneButton = $('.selected-option-time-zone-button')\n\n if (self.defaultTimeZonesValue.includes(value)) {\n $('.time-zone-button').removeClass('button').addClass('button-alternative')\n selectedOptionTimeZoneButton.addClass('hidden').attr('hidden', true)\n $(`a[data-value=\"${value}\"`).removeClass('button-alternative').addClass('button')\n } else {\n // deselect any selected button\n $('.time-zone-button').removeClass('button').addClass('button-alternative')\n\n selectedOptionTimeZoneButton.text(value)\n selectedOptionTimeZoneButton.attr('data-value', value).removeAttr('hidden')\n selectedOptionTimeZoneButton.removeClass(['hidden', 'button-alternative']).addClass('button')\n }\n\n self.resetTimeZoneUI()\n })\n }\n }\n\n teardownPluginInstance() {\n if (this.plugin === undefined) { return }\n\n $(this.pluginMainEl).off('apply.daterangepicker')\n $(this.pluginMainEl).off('cancel.daterangepicker')\n\n // revert to original markup, remove any event listeners\n this.plugin.remove()\n\n if (this.includeTimeValue) {\n $(this.timeZoneSelect).select2('destroy');\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class extends Controller {\n static targets = [\n \"fileField\",\n \"removeFileFlag\",\n \"downloadFileButton\",\n \"removeFileButton\",\n \"selectFileButton\",\n \"progressBar\",\n ];\n\n connect() {\n // Add upload event listeners\n const initializeListener = document.addEventListener(\n \"direct-upload:initialize\",\n (event) => {\n this.selectFileButtonTarget.classList.add(\"hidden\");\n this.progressBarTarget.innerText = \"0%\";\n this.progressBarTarget.style.width = \"0%\";\n this.progressBarTarget.setAttribute(\"aria-valuenow\", 0);\n this.progressBarTarget.parentNode.classList.remove(\"hidden\");\n }\n );\n\n const progressListener = document.addEventListener(\n \"direct-upload:progress\",\n (event) => {\n const { progress } = event.detail;\n const width = `${progress.toFixed(1)}%`;\n\n this.progressBarTarget.innerText = width;\n this.progressBarTarget.setAttribute(\"aria-valuenow\", progress);\n this.progressBarTarget.style.width = width;\n }\n );\n\n const errorListener = document.addEventListener(\n \"direct-upload:error\",\n (event) => {\n event.preventDefault();\n\n const { error } = event.detail;\n this.progressBarTarget.innerText = error;\n }\n );\n\n this.uploadListeners = {\n \"direct-upload:initialize\": initializeListener,\n \"direct-upload:progress\": progressListener,\n \"direct-upload:error\": errorListener,\n };\n }\n\n disconnect() {\n // Teardown event listeners\n for (const event in this.uploadListeners) {\n document.removeEventListener(event, this.uploadListeners[event]);\n }\n }\n\n uploadFile() {\n this.fileFieldTarget.click();\n }\n\n removeFile() {\n if (this.hasDownloadFileButtonTarget) {\n this.downloadFileButtonTarget.classList.add(\"hidden\");\n }\n\n this.removeFileButtonTarget.classList.add(\"hidden\");\n this.removeFileFlagTarget.value = true;\n }\n\n handleFileSelected() {\n const statusText = this.selectFileButtonTarget.querySelector(\"span\");\n const icon = this.selectFileButtonTarget.querySelector(\"i\");\n\n if (this.hasDownloadFileButtonTarget) {\n this.downloadFileButtonTarget.remove();\n }\n\n statusText.innerText = \"Select Another File\";\n icon.classList.remove(\"ti-upload\");\n icon.classList.add(\"ti-check\");\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\nimport zxcvbn from \"zxcvbn\";\n\nexport default class extends Controller {\n static targets = [\"strengthIndicator\"];\n\n estimateStrength(e) {\n const result = zxcvbn(e.target.value);\n\n if (result.feedback && result.feedback.warning.length > 0) {\n this.strengthIndicatorTarget.innerText = `${result.feedback.warning}.`;\n this.strengthIndicatorTarget.classList.remove(\"hidden\");\n } else {\n this.strengthIndicatorTarget.classList.add(\"hidden\");\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nrequire(\"intl-tel-input/build/css/intlTelInput.css\");\nimport intlTelInput from 'intl-tel-input';\n\nexport default class extends Controller {\n static targets = [ \"field\" ]\n\n connect() {\n this.initPluginInstance()\n }\n\n disconnect() {\n this.teardownPluginInstance()\n }\n\n initPluginInstance() {\n let options = {\n hiddenInput: this.fieldTarget.dataset.method,\n customContainer: \"w-full\"\n }\n\n // TODO: add instructions on how to copy this asset into the application's assets path and write the meta tag into the head (via the engine?)\n const utilsScriptPath = metaContent(\"intl_tel_input_utils_path\")\n if (utilsScriptPath) {\n options['utilsScript'] = utilsScriptPath\n }\n\n this.plugin = intlTelInput(this.fieldTarget, options);\n }\n\n teardownPluginInstance() {\n if (this.plugin === undefined) { return }\n\n // revert to original markup, remove any event listeners\n this.plugin.destroy()\n }\n}\n\nfunction metaContent (name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`)\n return element && element.content\n}","import { Controller } from \"@hotwired/stimulus\"\nrequire(\"select2/dist/css/select2.min.css\");\nimport select2 from \"select2\";\n\nexport default class extends Controller {\n static targets = [ \"select\" ]\n static values = {\n acceptsNew: Boolean,\n enableSearch: Boolean,\n searchUrl: String,\n }\n \n // will be reissued as native dom events name prepended with '$' e.g. '$change', '$select2:closing', etc\n static jQueryEventsToReissue = [ \"change\", \"select2:closing\", \"select2:close\", \"select2:opening\", \"select2:open\", \"select2:selecting\", \"select2:select\", \"select2:unselecting\", \"select2:unselect\", \"select2:clearing\", \"select2:clear\" ]\n \n\n initialize() {\n this.dispatchNativeEvent = this.dispatchNativeEvent.bind(this)\n if (this.isSelect2LoadedOnWindowJquery) {\n select2(window.$)\n }\n }\n\n get isSelect2LoadedOnWindowJquery() {\n return (window.$ !== undefined && window.$.select2 === undefined)\n }\n\n connect() {\n if (this.isSelect2LoadedOnWindowJquery) {\n this.initPluginInstance()\n }\n }\n\n disconnect() {\n this.teardownPluginInstance()\n }\n\n cleanupBeforeInit() {\n $(this.element).find('.select2-container--default').remove()\n }\n\n initPluginInstance() {\n let options = {};\n\n if (!this.enableSearchValue) {\n options.minimumResultsForSearch = -1;\n }\n\n options.tags = this.acceptsNewValue\n\n if (this.searchUrlValue) {\n options.ajax = {\n url: this.searchUrlValue,\n dataType: 'json',\n // We enable pagination by default here\n data: function(params) {\n var query = {\n search: params.term,\n page: params.page || 1\n }\n return query\n }\n // Any additional params go here...\n }\n }\n\n options.templateResult = this.formatState;\n options.templateSelection = this.formatState;\n options.width = 'style';\n\n this.cleanupBeforeInit() // in case improperly torn down\n this.pluginMainEl = this.selectTarget // required because this.selectTarget is unavailable on disconnect()\n $(this.pluginMainEl).select2(options);\n\n this.initReissuePluginEventsAsNativeEvents()\n }\n\n teardownPluginInstance() {\n if (this.pluginMainEl === undefined) { return }\n\n // ensure there are no orphaned event handlers\n this.teardownPluginEventsAsNativeEvents()\n \n // revert to original markup, remove any event listeners\n $(this.pluginMainEl).select2('destroy');\n }\n\n initReissuePluginEventsAsNativeEvents() {\n this.constructor.jQueryEventsToReissue.forEach((eventName) => {\n $(this.pluginMainEl).on(eventName, this.dispatchNativeEvent)\n })\n }\n \n teardownPluginEventsAsNativeEvents() {\n this.constructor.jQueryEventsToReissue.forEach((eventName) => {\n $(this.pluginMainEl).off(eventName)\n })\n }\n \n dispatchNativeEvent(event) {\n const nativeEventName = '$' + event.type // e.g. '$change.select2'\n this.element.dispatchEvent(new CustomEvent(nativeEventName, { detail: { event: event }, bubbles: true, cancelable: false }))\n }\n\n // https://stackoverflow.com/questions/29290389/select2-add-image-icon-to-option-dynamically\n formatState(opt) {\n var imageUrl = $(opt.element).attr('data-image');\n var imageHtml = \"\";\n if (imageUrl) {\n imageHtml = '<img src=\"' + imageUrl + '\" /> ';\n }\n return $('<span>' + imageHtml + sanitizeHTML(opt.text) + '</span>');\n }\n}\n\n// https://portswigger.net/web-security/cross-site-scripting/preventing\nfunction sanitizeHTML(str) {\n return str.replace(/[^\\w. ]/gi, function (c) {\n return '&#' + c.charCodeAt(0) + ';';\n });\n};\n","import { identifierForContextKey } from \"@hotwired/stimulus-webpack-helpers\"\n\nimport ButtonToggleController from './fields/button_toggle_controller'\nimport CloudinaryImageController from './fields/cloudinary_image_controller'\nimport ColorPickerController from './fields/color_picker_controller'\nimport DateController from './fields/date_controller'\nimport FileFieldController from './fields/file_field_controller'\nimport PasswordController from './fields/password_controller'\nimport PhoneController from './fields/phone_controller'\nimport SuperSelectController from './fields/super_select_controller'\n\nexport const controllerDefinitions = [\n [ButtonToggleController, 'fields/button_toggle_controller.js'],\n [CloudinaryImageController, 'fields/cloudinary_image_controller.js'],\n [ColorPickerController, 'fields/color_picker_controller.js'],\n [DateController, 'fields/date_controller.js'],\n [FileFieldController, 'fields/file_field_controller.js'],\n [PasswordController, 'fields/password_controller.js'],\n [PhoneController, 'fields/phone_controller.js'],\n [SuperSelectController, 'fields/super_select_controller.js'],\n].map(function(d) {\n const key = d[1]\n const controller = d[0]\n return {\n identifier: identifierForContextKey(key),\n controllerConstructor: controller\n }\n})\n\nexport {\n ButtonToggleController,\n CloudinaryImageController,\n ColorPickerController,\n DateController,\n FileFieldController,\n PasswordController,\n PhoneController,\n SuperSelectController,\n}","import Tribute from 'tributejs'\nrequire(\"trix/dist/trix.css\");\n\nrequire(\"trix\")\nrequire(\"@rails/actiontext\")\n\n// only show the editor tool bar when the user is editing the field.\n// inspired by https://github.com/basecamp/trix/issues/343 and `app/assets/stylesheets/account/fields/trix_editor.scss`\n\nexport function trixEditor() {\n document.addEventListener('trix-initialize', function() {\n addEventListener(\"trix-focus\", updateTrixToolbarVisability);\n addEventListener(\"trix-blur\", updateTrixToolbarVisability);\n updateTrixToolbarVisability();\n initializeTribute();\n })\n}\n\nfunction updateTrixToolbarVisability() {\n document.querySelectorAll(\"trix-editor\").forEach((editorElement, index) => {\n var toolbarElement = editorElement.toolbarElement;\n if (editorElement == document.activeElement) {\n toolbarElement.classList.add('visible');\n } else {\n // don't hide the toolbar if we've unfocused to focus on the link dialog.\n if (!toolbarElement.contains(document.activeElement)) {\n toolbarElement.classList.remove('visible');\n }\n }\n })\n}\n\nfunction initializeTribute() {\n document.querySelectorAll(\"trix-editor\").forEach((el, index) => {\n var editor = el.editor;\n \n var mentionConfig = {\n trigger: '@',\n values: JSON.parse(editor.element.dataset.mentions),\n selectTemplate: function (item) {\n item = item.original;\n return '<a href=\"' + item.protocol + '://' + item.model + '/' + item.id + '\">' + item.label + '</a>';\n },\n menuItemTemplate: function (item) {\n return '<img src=\"' + item.original.photo + '\" /> ' + item.string;\n },\n requireLeadingSpace: true,\n replaceTextSuffix: ''\n }\n \n var topicConfig = {\n trigger: '#',\n values: JSON.parse(editor.element.dataset.topics),\n selectTemplate: function (item) {\n item = item.original;\n return '<a href=\"' + item.protocol + '://' + item.model + '/' + item.id + '\">' + item.label + '</a>';\n },\n menuItemTemplate: function (item) {\n return '<img src=\"' + item.original.photo + '\" /> ' + item.string;\n },\n requireLeadingSpace: true,\n replaceTextSuffix: ''\n }\n \n var tribute = new Tribute({\n collection: [topicConfig, mentionConfig],\n });\n \n tribute.attach(el);\n })\n}\n"],"names":["identifierForContextKey","key","logicalName","match","replace","Controller","clickShadowField","event","preventDefault","this","shadowFieldTarget","click","targets","pickImageAndUpload","defaultSources","hasGoogleApiKeyValue","push","options","cloud_name","cloudNameValue","apiKey","apiKeyValue","upload_preset","uploadPresetValue","upload_signature","getCloudinarySignature","bind","multiple","sources","hasSourcesValue","sourcesValue","split","search_by_rights","hasSearchByRightsValue","searchByRightsValue","googleApiKeyValue","cloudinary","openUploadWidget","handleWidgetResponse","clearImage","hiddenFieldTarget","value","removeThumbnail","callback","paramsToSign","$","ajax","url","signaturesUrlValue","type","dataType","data","complete","console","log","success","signature","textStatus","xhr","error","status","response","info","public_id","addThumbnail","urlFormatValue","$imageElement","widthValue","heightValue","identifier","uploadButtonTarget","prepend","classList","add","thumbnailShownClass","hasThumbnailTarget","removeChild","thumbnailTarget","remove","values","signaturesUrl","String","height","Number","width","cloudName","googleApiKey","urlFormat","searchByRights","Boolean","classes","connect","initPluginInstance","colorOptions","colorOptionsTarget","find","map","_","button","attr","get","disconnect","teardownPluginInstance","pickColor","targetEl","target","color","dataset","colorInputTarget","val","colorPickerValueTarget","userSelectedColorTarget","removeClass","pickr","setColor","pickRandomColor","r","Math","floor","random","g","b","hexColor","getColor","toHEXA","toString","showUserSelectedColor","addClass","css","show","unpickColor","hide","togglePickr","Pickr","create","el","theme","useAsButton","default","initialColorValue","components","preview","hue","interaction","input","save","on","_instance","hexaColor","includes","that","e","applyColor","destroy","initialColor","require","clearDate","fieldTarget","applyDateToField","picker","format","includeTimeValue","startDate","dispatchEvent","CustomEvent","detail","showTimeZoneButtons","currentTimeZoneWrapperTarget","toggleClass","timeZoneButtonsTarget","showTimeZoneSelectWrapper","hasTimeZoneSelectWrapperTarget","timeZoneSelectWrapperTarget","resetTimeZoneUI","setTimeZone","currentTimeZoneEl","querySelector","timeZoneFieldTarget","text","daterangepicker","singleDatePicker","timePicker","timePickerIncrement","autoUpdateInput","locale","cancelLabel","cancelButtonLabelValue","applyLabel","applyButtonLabelValue","pluginMainEl","plugin","timeZoneSelect","select2","self","selectedOptionTimeZoneButton","defaultTimeZonesValue","removeAttr","undefined","off","includeTime","defaultTimeZones","Array","cancelButtonLabel","applyButtonLabel","initializeListener","document","addEventListener","selectFileButtonTarget","progressBarTarget","innerText","style","setAttribute","parentNode","progressListener","progress","toFixed","errorListener","uploadListeners","removeEventListener","uploadFile","fileFieldTarget","removeFile","hasDownloadFileButtonTarget","downloadFileButtonTarget","removeFileButtonTarget","removeFileFlagTarget","handleFileSelected","statusText","icon","estimateStrength","result","zxcvbn","feedback","warning","length","strengthIndicatorTarget","hiddenInput","method","customContainer","utilsScriptPath","name","element","head","content","metaContent","intlTelInput","initialize","dispatchNativeEvent","isSelect2LoadedOnWindowJquery","window","cleanupBeforeInit","enableSearchValue","minimumResultsForSearch","tags","acceptsNewValue","searchUrlValue","params","search","term","page","templateResult","formatState","templateSelection","selectTarget","initReissuePluginEventsAsNativeEvents","teardownPluginEventsAsNativeEvents","constructor","jQueryEventsToReissue","forEach","eventName","bubbles","cancelable","opt","imageUrl","imageHtml","c","charCodeAt","acceptsNew","enableSearch","searchUrl","controllerDefinitions","ButtonToggleController","CloudinaryImageController","ColorPickerController","DateController","FileFieldController","PasswordController","PhoneController","SuperSelectController","d","controller","controllerConstructor","trixEditor","updateTrixToolbarVisability","querySelectorAll","index","editor","mentionConfig","trigger","JSON","parse","mentions","selectTemplate","item","original","protocol","model","id","label","menuItemTemplate","photo","string","requireLeadingSpace","replaceTextSuffix","topicConfig","topics","Tribute","collection","attach","editorElement","toolbarElement","activeElement","contains"],"mappings":"gQAqBA,SAASA,EAAwBC,GAC7B,MAAMC,GAAeD,EAAIE,MAAM,2CAA6C,IAAI,GAChF,GAAID,EACA,OAAOA,EAAYE,QAAQ,KAAM,KAAKA,QAA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AKG,MAAQ,IAAMH,EAAKI,GAAK,KAAOJ,EAAKK,MAAQ,QAEhGC,iBAAkB,SAAUN,GAC1B,MAAO,aAAeA,EAAKC,SAASM,MAAQ,QAAUP,EAAKQ,QAE7DC,qBAAqB,EACrBC,kBAAmB,IAGP,IAAIG,EAAQ,CACxBC,WAAY,CAACH,EAAajB,KAGpBqB,OAAOvL,OAlDnB,SAAS8J,IACPxF,SAASyF,iBAAiB,eAAe1B,QAAQ,CAACmD,EAAexB,KAC/D,IAAIyB,EAAiBD,EAAcC,eAC/BD,GAAiBlH,SAASoH,cAC5BD,EAAexP,UAAUC,IAAI,WAGxBuP,EAAeE,SAASrH,SAASoH,gBACpCD,EAAexP,UAAUM,OAAO,aAzBxC6E,QAAQ,sBAERA,QAAQ,QACRA,QAAQ"}
@@ -1,2 +0,0 @@
1
- var e=require("@hotwired/stimulus");require("@simonwep/pickr/dist/themes/monolith.min.css");var t=require("@simonwep/pickr");require("daterangepicker");var i=require("zxcvbn"),r=require("intl-tel-input"),n=require("select2"),s=require("tributejs");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=a(t),o=a(i),c=a(r),d=a(n),u=a(s);function h(e){const t=(e.match(/^(?:\.\/)?(.+)(?:[_-]controller\..+?)$/)||[])[1];if(t)return t.replace(/_/g,"-").replace(/\//g,"--")}class g extends e.Controller{clickShadowField(e){e.preventDefault(),this.shadowFieldTarget.click()}}g.targets=["shadowField"];class p extends e.Controller{pickImageAndUpload(e){e.preventDefault();var t=["local","url","camera"];this.hasGoogleApiKeyValue&&t.push("image_search");var i={cloud_name:this.cloudNameValue,apiKey:this.apiKeyValue,upload_preset:this.uploadPresetValue,upload_signature:this.getCloudinarySignature.bind(this),multiple:!1,sources:this.hasSourcesValue?this.sourcesValue.split(","):t,search_by_rights:!this.hasSearchByRightsValue||!1!==this.searchByRightsValue};this.hasGoogleApiKeyValue&&(i.google_api_key=this.googleApiKeyValue),cloudinary.openUploadWidget(i,this.handleWidgetResponse.bind(this))}clearImage(e){e.preventDefault(),this.hiddenFieldTarget.value=null,this.removeThumbnail()}getCloudinarySignature(e,t){$.ajax({url:this.signaturesUrlValue,type:"GET",dataType:"text",data:{data:t},complete:function(){console.log("complete")},success:function(t,i,r){e(t)},error:function(e,t,i){console.log(e,t,i)}})}handleWidgetResponse(e,t){if(!e&&t&&"success"===t.event){const e=t.info;this.hiddenFieldTarget.value=e.public_id,this.removeThumbnail(),this.addThumbnail(this.urlFormatValue.replace("CLOUDINARY_ID",e.public_id))}}addThumbnail(e){var t=$('<img src="'+e+'" width="'+this.widthValue+'" height="'+this.heightValue+'" data-'+this.identifier+'-target="thumbnail" />');$(this.uploadButtonTarget).prepend(t),this.uploadButtonTarget.classList.add(this.thumbnailShownClass)}removeThumbnail(){this.hasThumbnailTarget&&(this.uploadButtonTarget.removeChild(this.thumbnailTarget),this.uploadButtonTarget.classList.remove(this.thumbnailShownClass))}}p.targets=["uploadButton","hiddenField","thumbnail"],p.values={signaturesUrl:String,height:Number,width:Number,cloudName:String,apiKey:String,googleApiKey:String,urlFormat:String,sources:String,searchByRights:Boolean},p.classes=["thumbnailShown"];class m extends e.Controller{connect(){this.initPluginInstance(),this.colorOptions=$(this.colorOptionsTarget).find("button").map(function(e,t){return $(t).attr("data-color")}).get()}disconnect(){this.teardownPluginInstance()}pickColor(e){e.preventDefault();const t=e.target,i=t.dataset.color;$(this.colorInputTarget).val(i),$(this.colorPickerValueTarget).val(i),$(this.userSelectedColorTarget).data("color",i),$(".button-color").removeClass("ring-2 ring-offset-2"),this.pickr.setColor(i),t.classList.add("ring-2","ring-offset-2")}pickRandomColor(e){e.preventDefault();const t=Math.floor(256*Math.random()),i=Math.floor(256*Math.random()),r=Math.floor(256*Math.random());this.pickr.setColor("rgb "+t+" "+i+" "+r);const n=this.pickr.getColor().toHEXA().toString();this.pickr.setColor(n),this.showUserSelectedColor(n)}showUserSelectedColor(e){$(this.colorInputTarget).val(e),$(this.colorPickerValueTarget).val(e),$(".button-color").removeClass("ring-2 ring-offset-2"),$(this.userSelectedColorTarget).addClass("ring-2").addClass("ring-offset-2").css("background-color",e).css("--tw-ring-color",e).attr("data-color",e).show()}unpickColor(e){e.preventDefault(),$(this.colorPickerValueTarget).val(""),$(this.colorInputTarget).val(""),$(this.userSelectedColorTarget).hide(),$(".button-color").removeClass("ring-2 ring-offset-2")}togglePickr(e){e.preventDefault()}initPluginInstance(){this.pickr=l.default.create({el:".btn-pickr",theme:"monolith",useAsButton:!0,default:this.initialColorValue||"#1E90FF",components:{preview:!0,hue:!0,interaction:{input:!0,save:!0}}}),this.pickr.on("save",(e,t)=>{const i=e.toHEXA().toString();this.colorOptions.includes(i)||this.showUserSelectedColor(i),this.pickr.hide()});const e=this;$('input[type="text"].pcr-result').on("keydown",function(t){"Enter"===t.key&&e.pickr.applyColor(!1)})}teardownPluginInstance(){this.pickr.destroy()}}m.targets=["colorPickerValue","colorField","colorInput","userSelectedColor","colorOptions"],m.values={initialColor:String},require("daterangepicker/daterangepicker.css");class v extends e.Controller{connect(){this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}clearDate(e){e.preventDefault(),$(this.fieldTarget).val("")}applyDateToField(e,t){const i=this.includeTimeValue?"MM/DD/YYYY h:mm A":"MM/DD/YYYY";$(this.fieldTarget).val(t.startDate.format(i)),this.fieldTarget.dispatchEvent(new CustomEvent("change",{detail:{picker:t}}))}showTimeZoneButtons(e){e.preventDefault(),$(this.currentTimeZoneWrapperTarget).toggleClass("hidden"),$(this.timeZoneButtonsTarget).toggleClass("hidden")}showTimeZoneSelectWrapper(e){e.preventDefault(),$(this.timeZoneButtonsTarget).toggleClass("hidden"),this.hasTimeZoneSelectWrapperTarget&&$(this.timeZoneSelectWrapperTarget).toggleClass("hidden")}resetTimeZoneUI(e){e&&e.preventDefault(),$(this.currentTimeZoneWrapperTarget).removeClass("hidden"),$(this.timeZoneButtonsTarget).addClass("hidden"),this.hasTimeZoneSelectWrapperTarget&&$(this.timeZoneSelectWrapperTarget).addClass("hidden")}setTimeZone(e){e.preventDefault();const t=this.currentTimeZoneWrapperTarget.querySelector("a"),{value:i}=e.target.dataset;$(this.timeZoneFieldTarget).val(i),$(t).text(i),$(".time-zone-button").removeClass("button").addClass("button-alternative"),$(e.target).removeClass("button-alternative").addClass("button"),this.resetTimeZoneUI()}initPluginInstance(){if($(this.fieldTarget).daterangepicker({singleDatePicker:!0,timePicker:this.includeTimeValue,timePickerIncrement:5,autoUpdateInput:!1,locale:{cancelLabel:this.cancelButtonLabelValue,applyLabel:this.applyButtonLabelValue,format:this.includeTimeValue?"MM/DD/YYYY h:mm A":"MM/DD/YYYY"}}),$(this.fieldTarget).on("apply.daterangepicker",this.applyDateToField.bind(this)),$(this.fieldTarget).on("cancel.daterangepicker",this.clearDate.bind(this)),this.pluginMainEl=this.fieldTarget,this.plugin=$(this.pluginMainEl).data("daterangepicker"),this.includeTimeValue&&this.hasTimeZoneSelectWrapperTarget){this.timeZoneSelect=this.timeZoneSelectWrapperTarget.querySelector("select.select2"),$(this.timeZoneSelect).select2({width:"style"});const e=this;$(this.timeZoneSelect).on("change.select2",function(t){const i=e.currentTimeZoneWrapperTarget.querySelector("a"),{value:r}=t.target;$(e.timeZoneFieldTarget).val(r),$(i).text(r);const n=$(".selected-option-time-zone-button");e.defaultTimeZonesValue.includes(r)?($(".time-zone-button").removeClass("button").addClass("button-alternative"),n.addClass("hidden").attr("hidden",!0),$('a[data-value="'+r+'"').removeClass("button-alternative").addClass("button")):($(".time-zone-button").removeClass("button").addClass("button-alternative"),n.text(r),n.attr("data-value",r).removeAttr("hidden"),n.removeClass(["hidden","button-alternative"]).addClass("button")),e.resetTimeZoneUI()})}}teardownPluginInstance(){void 0!==this.plugin&&($(this.pluginMainEl).off("apply.daterangepicker"),$(this.pluginMainEl).off("cancel.daterangepicker"),this.plugin.remove(),this.includeTimeValue&&$(this.timeZoneSelect).select2("destroy"))}}v.targets=["field","clearButton","currentTimeZoneWrapper","timeZoneButtons","timeZoneSelectWrapper","timeZoneField"],v.values={includeTime:Boolean,defaultTimeZones:Array,cancelButtonLabel:{type:String,default:"Cancel"},applyButtonLabel:{type:String,default:"Apply"}};class f extends e.Controller{connect(){const e=document.addEventListener("direct-upload:initialize",e=>{this.selectFileButtonTarget.classList.add("hidden"),this.progressBarTarget.innerText="0%",this.progressBarTarget.style.width="0%",this.progressBarTarget.setAttribute("aria-valuenow",0),this.progressBarTarget.parentNode.classList.remove("hidden")}),t=document.addEventListener("direct-upload:progress",e=>{const{progress:t}=e.detail,i=t.toFixed(1)+"%";this.progressBarTarget.innerText=i,this.progressBarTarget.setAttribute("aria-valuenow",t),this.progressBarTarget.style.width=i}),i=document.addEventListener("direct-upload:error",e=>{e.preventDefault();const{error:t}=e.detail;this.progressBarTarget.innerText=t});this.uploadListeners={"direct-upload:initialize":e,"direct-upload:progress":t,"direct-upload:error":i}}disconnect(){for(const e in this.uploadListeners)document.removeEventListener(e,this.uploadListeners[e])}uploadFile(){this.fileFieldTarget.click()}removeFile(){this.hasDownloadFileButtonTarget&&this.downloadFileButtonTarget.classList.add("hidden"),this.removeFileButtonTarget.classList.add("hidden"),this.removeFileFlagTarget.value=!0}handleFileSelected(){const e=this.selectFileButtonTarget.querySelector("span"),t=this.selectFileButtonTarget.querySelector("i");this.hasDownloadFileButtonTarget&&this.downloadFileButtonTarget.remove(),e.innerText="Select Another File",t.classList.remove("ti-upload"),t.classList.add("ti-check")}}f.targets=["fileField","removeFileFlag","downloadFileButton","removeFileButton","selectFileButton","progressBar"];class T extends e.Controller{estimateStrength(e){const t=o.default(e.target.value);t.feedback&&t.feedback.warning.length>0?(this.strengthIndicatorTarget.innerText=t.feedback.warning+".",this.strengthIndicatorTarget.classList.remove("hidden")):this.strengthIndicatorTarget.classList.add("hidden")}}T.targets=["strengthIndicator"],require("intl-tel-input/build/css/intlTelInput.css");class b extends e.Controller{connect(){this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}initPluginInstance(){let e={hiddenInput:this.fieldTarget.dataset.method,customContainer:"w-full"};const t=function(e){const t=document.head.querySelector('meta[name="intl_tel_input_utils_path"]');return t&&t.content}();t&&(e.utilsScript=t),this.plugin=c.default(this.fieldTarget,e)}teardownPluginInstance(){void 0!==this.plugin&&this.plugin.destroy()}}b.targets=["field"],require("select2/dist/css/select2.min.css");class C extends e.Controller{initialize(){this.dispatchNativeEvent=this.dispatchNativeEvent.bind(this),this.isSelect2LoadedOnWindowJquery&&d.default(window.$)}get isSelect2LoadedOnWindowJquery(){return void 0!==window.$&&void 0===window.$.select2}connect(){this.isSelect2LoadedOnWindowJquery&&this.initPluginInstance()}disconnect(){this.teardownPluginInstance()}cleanupBeforeInit(){$(this.element).find(".select2-container--default").remove()}initPluginInstance(){let e={};this.enableSearchValue||(e.minimumResultsForSearch=-1),e.tags=this.acceptsNewValue,this.searchUrlValue&&(e.ajax={url:this.searchUrlValue,dataType:"json",data:function(e){return{search:e.term,page:e.page||1}}}),e.templateResult=this.formatState,e.templateSelection=this.formatState,e.width="style",this.cleanupBeforeInit(),this.pluginMainEl=this.selectTarget,$(this.pluginMainEl).select2(e),this.initReissuePluginEventsAsNativeEvents()}teardownPluginInstance(){void 0!==this.pluginMainEl&&(this.teardownPluginEventsAsNativeEvents(),$(this.pluginMainEl).select2("destroy"))}initReissuePluginEventsAsNativeEvents(){this.constructor.jQueryEventsToReissue.forEach(e=>{$(this.pluginMainEl).on(e,this.dispatchNativeEvent)})}teardownPluginEventsAsNativeEvents(){this.constructor.jQueryEventsToReissue.forEach(e=>{$(this.pluginMainEl).off(e)})}dispatchNativeEvent(e){this.element.dispatchEvent(new CustomEvent("$"+e.type,{detail:{event:e},bubbles:!0,cancelable:!1}))}formatState(e){var t=$(e.element).attr("data-image"),i="";return t&&(i='<img src="'+t+'" /> '),$("<span>"+i+e.text.replace(/[^\w. ]/gi,function(e){return"&#"+e.charCodeAt(0)+";"})+"</span>")}}C.targets=["select"],C.values={acceptsNew:Boolean,enableSearch:Boolean,searchUrl:String},C.jQueryEventsToReissue=["change","select2:closing","select2:close","select2:opening","select2:open","select2:selecting","select2:select","select2:unselecting","select2:unselect","select2:clearing","select2:clear"];const S=[[g,"fields/button_toggle_controller.js"],[p,"fields/cloudinary_image_controller.js"],[m,"fields/color_picker_controller.js"],[v,"fields/date_controller.js"],[f,"fields/file_field_controller.js"],[T,"fields/password_controller.js"],[b,"fields/phone_controller.js"],[C,"fields/super_select_controller.js"]].map(function(e){const t=e[0];return{identifier:h(e[1]),controllerConstructor:t}});function w(){document.querySelectorAll("trix-editor").forEach((e,t)=>{var i=e.toolbarElement;e==document.activeElement?i.classList.add("visible"):i.contains(document.activeElement)||i.classList.remove("visible")})}require("trix/dist/trix.css"),require("trix"),require("@rails/actiontext"),exports.ButtonToggleController=g,exports.CloudinaryImageController=p,exports.ColorPickerController=m,exports.DateController=v,exports.FileFieldController=f,exports.PasswordController=T,exports.PhoneController=b,exports.SuperSelectController=C,exports.controllerDefinitions=S,exports.trixEditor=function(){document.addEventListener("trix-initialize",function(){addEventListener("trix-focus",w),addEventListener("trix-blur",w),w(),document.querySelectorAll("trix-editor").forEach((e,t)=>{var i=e.editor,r={trigger:"@",values:JSON.parse(i.element.dataset.mentions),selectTemplate:function(e){return'<a href="'+(e=e.original).protocol+"://"+e.model+"/"+e.id+'">'+e.label+"</a>"},menuItemTemplate:function(e){return'<img src="'+e.original.photo+'" /> '+e.string},requireLeadingSpace:!0,replaceTextSuffix:""},n={trigger:"#",values:JSON.parse(i.element.dataset.topics),selectTemplate:function(e){return'<a href="'+(e=e.original).protocol+"://"+e.model+"/"+e.id+'">'+e.label+"</a>"},menuItemTemplate:function(e){return'<img src="'+e.original.photo+'" /> '+e.string},requireLeadingSpace:!0,replaceTextSuffix:""};new u.default({collection:[n,r]}).attach(e)})})};
2
- //# sourceMappingURL=fields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fields.js","sources":["../../../node_modules/@hotwired/stimulus-webpack-helpers/dist/stimulus-webpack-helpers.js","../../javascript/controllers/fields/button_toggle_controller.js","../../javascript/controllers/fields/cloudinary_image_controller.js","../../javascript/controllers/fields/color_picker_controller.js","../../javascript/controllers/fields/date_controller.js","../../javascript/controllers/fields/file_field_controller.js","../../javascript/controllers/fields/password_controller.js","../../javascript/controllers/fields/phone_controller.js","../../javascript/controllers/fields/super_select_controller.js","../../javascript/controllers/index.js","../../javascript/trix_editor.js"],"sourcesContent":["/*\nStimulus Webpack Helpers 1.0.0\nCopyright © 2021 Basecamp, LLC\n */\nfunction definitionsFromContext(context) {\n return context.keys()\n .map((key) => definitionForModuleWithContextAndKey(context, key))\n .filter((value) => value);\n}\nfunction definitionForModuleWithContextAndKey(context, key) {\n const identifier = identifierForContextKey(key);\n if (identifier) {\n return definitionForModuleAndIdentifier(context(key), identifier);\n }\n}\nfunction definitionForModuleAndIdentifier(module, identifier) {\n const controllerConstructor = module.default;\n if (typeof controllerConstructor == \"function\") {\n return { identifier, controllerConstructor };\n }\n}\nfunction identifierForContextKey(key) {\n const logicalName = (key.match(/^(?:\\.\\/)?(.+)(?:[_-]controller\\..+?)$/) || [])[1];\n if (logicalName) {\n return logicalName.replace(/_/g, \"-\").replace(/\\//g, \"--\");\n }\n}\n\nexport { definitionForModuleAndIdentifier, definitionForModuleWithContextAndKey, definitionsFromContext, identifierForContextKey };\n","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = [ \"shadowField\" ]\n\n clickShadowField(event) {\n // we have to stop safari from doing what we originally expected.\n event.preventDefault();\n\n // then we need to manually click the hidden checkbox or radio button ourselves.\n this.shadowFieldTarget.click()\n }\n}","import { Controller } from \"@hotwired/stimulus\"\n\nexport default class extends Controller {\n static targets = [ \"uploadButton\", \"hiddenField\", \"thumbnail\" ]\n static values = { \n signaturesUrl: String,\n height: Number,\n width: Number,\n cloudName: String,\n apiKey: String,\n googleApiKey: String,\n urlFormat: String,\n sources: String,\n searchByRights: Boolean\n }\n static classes = [ \"thumbnailShown\" ]\n\n pickImageAndUpload(event) {\n // don't submit the form.\n event.preventDefault()\n\n // prepare the list of default sources a user can upload an image from.\n var defaultSources = ['local', 'url', 'camera']\n if (this.hasGoogleApiKeyValue) {\n defaultSources.push('image_search')\n }\n\n // configure cloudinary's uploader's options.\n // many of these are configurable at the point where the `shared/fields/cloudinary_image` partial is included.\n var options = {\n cloud_name: this.cloudNameValue,\n apiKey: this.apiKeyValue,\n upload_preset: this.uploadPresetValue,\n upload_signature: this.getCloudinarySignature.bind(this),\n multiple: false,\n sources: this.hasSourcesValue ? this.sourcesValue.split(',') : defaultSources,\n search_by_rights: this.hasSearchByRightsValue && this.searchByRightsValue === false ? false : true // default to true.\n }\n \n if (this.hasGoogleApiKeyValue) {\n options['google_api_key'] = this.googleApiKeyValue\n }\n \n // open cloudinary's upload widget.\n cloudinary.openUploadWidget(options, this.handleWidgetResponse.bind(this))\n }\n \n clearImage(event) {\n // don't submit the form.\n event.preventDefault()\n\n // clear the cloudinary id.\n this.hiddenFieldTarget.value = null\n \n // remove any existing image from the button.\n this.removeThumbnail()\n }\n \n getCloudinarySignature(callback, paramsToSign) {\n $.ajax({\n url: this.signaturesUrlValue,\n type: \"GET\",\n dataType: \"text\",\n data: {data: paramsToSign},\n complete: function() { console.log(\"complete\") },\n success: function(signature, textStatus, xhr) { callback(signature) },\n error: function(xhr, status, error) { console.log(xhr, status, error) }\n })\n }\n \n handleWidgetResponse(error, response) {\n // after the user has successfully uploaded a single file ..\n if (!error && response && response.event === \"success\") { \n const data = response.info\n \n // update the cloudinary id field in the form.\n this.hiddenFieldTarget.value = data.public_id\n\n // remove any existing image.\n this.removeThumbnail()\n\n // generate a new image preview url.\n this.addThumbnail(this.urlFormatValue.replace('CLOUDINARY_ID', data.public_id))\n }\n }\n \n addThumbnail(url) {\n var $imageElement = $(`<img src=\"${url}\" width=\"${this.widthValue}\" height=\"${this.heightValue}\" data-${this.identifier}-target=\"thumbnail\" />`)\n $(this.uploadButtonTarget).prepend($imageElement)\n\n // mark the image as present.\n this.uploadButtonTarget.classList.add(this.thumbnailShownClass)\n }\n \n removeThumbnail() {\n if (!this.hasThumbnailTarget) { return }\n this.uploadButtonTarget.removeChild(this.thumbnailTarget)\n this.uploadButtonTarget.classList.remove(this.thumbnailShownClass)\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nimport '@simonwep/pickr/dist/themes/monolith.min.css'\n\nimport Pickr from '@simonwep/pickr';\n\nexport default class extends Controller {\n static targets = [ \"colorPickerValue\", \"colorField\", \"colorInput\", \"userSelectedColor\", \"colorOptions\" ];\n static values = { initialColor: String }\n\n connect() {\n this.initPluginInstance()\n this.colorOptions = $(this.colorOptionsTarget).find('button').map(function (_, button) { return $(button).attr('data-color'); }).get()\n }\n\n disconnect() {\n this.teardownPluginInstance()\n }\n\n pickColor(event) {\n event.preventDefault();\n\n const targetEl = event.target;\n const color = targetEl.dataset.color;\n\n $(this.colorInputTarget).val(color);\n $(this.colorPickerValueTarget).val(color);\n $(this.userSelectedColorTarget).data('color', color);\n $('.button-color').removeClass('ring-2 ring-offset-2');\n\n this.pickr.setColor(color);\n\n targetEl.classList.add('ring-2', 'ring-offset-2');\n }\n\n pickRandomColor(event) {\n event.preventDefault();\n\n const r = Math.floor(Math.random() * 256);\n const g = Math.floor(Math.random() * 256);\n const b = Math.floor(Math.random() * 256);\n\n this.pickr.setColor(`rgb ${r} ${g} ${b}`);\n const hexColor = this.pickr.getColor().toHEXA().toString();\n this.pickr.setColor(hexColor);\n\n this.showUserSelectedColor(hexColor);\n }\n\n showUserSelectedColor(color) {\n $(this.colorInputTarget).val(color);\n $(this.colorPickerValueTarget).val(color);\n\n $('.button-color').removeClass('ring-2 ring-offset-2');\n\n $(this.userSelectedColorTarget)\n .addClass('ring-2')\n .addClass('ring-offset-2')\n .css('background-color', color)\n .css('--tw-ring-color', color)\n .attr('data-color', color)\n .show();\n }\n\n unpickColor(event) {\n event.preventDefault();\n $(this.colorPickerValueTarget).val('');\n $(this.colorInputTarget).val('');\n $(this.userSelectedColorTarget).hide();\n $('.button-color').removeClass('ring-2 ring-offset-2');\n }\n\n togglePickr(event) {\n event.preventDefault();\n }\n\n initPluginInstance() {\n this.pickr = Pickr.create({\n el: '.btn-pickr',\n theme: 'monolith',\n useAsButton: true,\n default: this.initialColorValue || '#1E90FF',\n components: {\n // Main components\n preview: true,\n hue: true,\n\n // Input / output Options\n interaction: {\n input: true,\n save: true,\n },\n }\n });\n\n this.pickr.on('save', (color, _instance) => {\n const hexaColor = color.toHEXA().toString()\n if (!this.colorOptions.includes(hexaColor)) {\n this.showUserSelectedColor(hexaColor);\n }\n this.pickr.hide();\n });\n\n const that = this\n\n $('input[type=\"text\"].pcr-result').on('keydown', function (e) {\n if (e.key === 'Enter') {\n that.pickr.applyColor(false)\n }\n })\n }\n\n teardownPluginInstance() {\n this.pickr.destroy()\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nrequire(\"daterangepicker/daterangepicker.css\");\n\n// requires jQuery, moment, might want to consider a vanilla JS alternative\nimport 'daterangepicker';\n\nexport default class extends Controller {\n static targets = [ \"field\", \"clearButton\", \"currentTimeZoneWrapper\", \"timeZoneButtons\", \"timeZoneSelectWrapper\", \"timeZoneField\" ]\n static values = {\n includeTime: Boolean,\n defaultTimeZones: Array,\n cancelButtonLabel: { type: String, default: \"Cancel\" },\n applyButtonLabel: { type: String, default: \"Apply\" }\n }\n\n connect() {\n this.initPluginInstance()\n }\n\n disconnect() {\n this.teardownPluginInstance()\n }\n\n clearDate(event) {\n // don't submit the form, unless it originated from the cancel/clear button\n event.preventDefault()\n\n $(this.fieldTarget).val('')\n }\n\n applyDateToField(event, picker) {\n const format = this.includeTimeValue ? 'MM/DD/YYYY h:mm A' : 'MM/DD/YYYY'\n $(this.fieldTarget).val(picker.startDate.format(format))\n // bubble up a change event when the input is updated for other listeners\n this.fieldTarget.dispatchEvent(new CustomEvent('change', { detail: { picker: picker }}))\n }\n\n showTimeZoneButtons(event) {\n // don't follow the anchor\n event.preventDefault()\n\n $(this.currentTimeZoneWrapperTarget).toggleClass('hidden')\n $(this.timeZoneButtonsTarget).toggleClass('hidden')\n }\n\n showTimeZoneSelectWrapper(event) {\n // don't follow the anchor\n event.preventDefault()\n\n $(this.timeZoneButtonsTarget).toggleClass('hidden')\n\n if (this.hasTimeZoneSelectWrapperTarget) {\n $(this.timeZoneSelectWrapperTarget).toggleClass('hidden')\n }\n }\n\n resetTimeZoneUI(e) {\n e && e.preventDefault()\n\n $(this.currentTimeZoneWrapperTarget).removeClass('hidden')\n $(this.timeZoneButtonsTarget).addClass('hidden')\n\n if (this.hasTimeZoneSelectWrapperTarget) {\n $(this.timeZoneSelectWrapperTarget).addClass('hidden')\n }\n }\n\n setTimeZone(event) {\n // don't follow the anchor\n event.preventDefault()\n\n const currentTimeZoneEl = this.currentTimeZoneWrapperTarget.querySelector('a')\n const {value} = event.target.dataset\n\n $(this.timeZoneFieldTarget).val(value)\n $(currentTimeZoneEl).text(value)\n\n $('.time-zone-button').removeClass('button').addClass('button-alternative')\n $(event.target).removeClass('button-alternative').addClass('button')\n\n this.resetTimeZoneUI()\n }\n\n initPluginInstance() {\n $(this.fieldTarget).daterangepicker({\n singleDatePicker: true,\n timePicker: this.includeTimeValue,\n timePickerIncrement: 5,\n autoUpdateInput: false,\n locale: {\n cancelLabel: this.cancelButtonLabelValue,\n applyLabel: this.applyButtonLabelValue,\n format: this.includeTimeValue ? 'MM/DD/YYYY h:mm A' : 'MM/DD/YYYY'\n }\n })\n\n $(this.fieldTarget).on('apply.daterangepicker', this.applyDateToField.bind(this))\n $(this.fieldTarget).on('cancel.daterangepicker', this.clearDate.bind(this))\n\n this.pluginMainEl = this.fieldTarget\n this.plugin = $(this.pluginMainEl).data('daterangepicker') // weird\n\n // Init time zone select\n if (this.includeTimeValue && this.hasTimeZoneSelectWrapperTarget) {\n this.timeZoneSelect = this.timeZoneSelectWrapperTarget.querySelector('select.select2')\n\n $(this.timeZoneSelect).select2({\n width: 'style'\n })\n\n const self = this\n\n $(this.timeZoneSelect).on('change.select2', function(event) {\n const currentTimeZoneEl = self.currentTimeZoneWrapperTarget.querySelector('a')\n const {value} = event.target\n\n $(self.timeZoneFieldTarget).val(value)\n $(currentTimeZoneEl).text(value)\n\n const selectedOptionTimeZoneButton = $('.selected-option-time-zone-button')\n\n if (self.defaultTimeZonesValue.includes(value)) {\n $('.time-zone-button').removeClass('button').addClass('button-alternative')\n selectedOptionTimeZoneButton.addClass('hidden').attr('hidden', true)\n $(`a[data-value=\"${value}\"`).removeClass('button-alternative').addClass('button')\n } else {\n // deselect any selected button\n $('.time-zone-button').removeClass('button').addClass('button-alternative')\n\n selectedOptionTimeZoneButton.text(value)\n selectedOptionTimeZoneButton.attr('data-value', value).removeAttr('hidden')\n selectedOptionTimeZoneButton.removeClass(['hidden', 'button-alternative']).addClass('button')\n }\n\n self.resetTimeZoneUI()\n })\n }\n }\n\n teardownPluginInstance() {\n if (this.plugin === undefined) { return }\n\n $(this.pluginMainEl).off('apply.daterangepicker')\n $(this.pluginMainEl).off('cancel.daterangepicker')\n\n // revert to original markup, remove any event listeners\n this.plugin.remove()\n\n if (this.includeTimeValue) {\n $(this.timeZoneSelect).select2('destroy');\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\n\nexport default class extends Controller {\n static targets = [\n \"fileField\",\n \"removeFileFlag\",\n \"downloadFileButton\",\n \"removeFileButton\",\n \"selectFileButton\",\n \"progressBar\",\n ];\n\n connect() {\n // Add upload event listeners\n const initializeListener = document.addEventListener(\n \"direct-upload:initialize\",\n (event) => {\n this.selectFileButtonTarget.classList.add(\"hidden\");\n this.progressBarTarget.innerText = \"0%\";\n this.progressBarTarget.style.width = \"0%\";\n this.progressBarTarget.setAttribute(\"aria-valuenow\", 0);\n this.progressBarTarget.parentNode.classList.remove(\"hidden\");\n }\n );\n\n const progressListener = document.addEventListener(\n \"direct-upload:progress\",\n (event) => {\n const { progress } = event.detail;\n const width = `${progress.toFixed(1)}%`;\n\n this.progressBarTarget.innerText = width;\n this.progressBarTarget.setAttribute(\"aria-valuenow\", progress);\n this.progressBarTarget.style.width = width;\n }\n );\n\n const errorListener = document.addEventListener(\n \"direct-upload:error\",\n (event) => {\n event.preventDefault();\n\n const { error } = event.detail;\n this.progressBarTarget.innerText = error;\n }\n );\n\n this.uploadListeners = {\n \"direct-upload:initialize\": initializeListener,\n \"direct-upload:progress\": progressListener,\n \"direct-upload:error\": errorListener,\n };\n }\n\n disconnect() {\n // Teardown event listeners\n for (const event in this.uploadListeners) {\n document.removeEventListener(event, this.uploadListeners[event]);\n }\n }\n\n uploadFile() {\n this.fileFieldTarget.click();\n }\n\n removeFile() {\n if (this.hasDownloadFileButtonTarget) {\n this.downloadFileButtonTarget.classList.add(\"hidden\");\n }\n\n this.removeFileButtonTarget.classList.add(\"hidden\");\n this.removeFileFlagTarget.value = true;\n }\n\n handleFileSelected() {\n const statusText = this.selectFileButtonTarget.querySelector(\"span\");\n const icon = this.selectFileButtonTarget.querySelector(\"i\");\n\n if (this.hasDownloadFileButtonTarget) {\n this.downloadFileButtonTarget.remove();\n }\n\n statusText.innerText = \"Select Another File\";\n icon.classList.remove(\"ti-upload\");\n icon.classList.add(\"ti-check\");\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\nimport zxcvbn from \"zxcvbn\";\n\nexport default class extends Controller {\n static targets = [\"strengthIndicator\"];\n\n estimateStrength(e) {\n const result = zxcvbn(e.target.value);\n\n if (result.feedback && result.feedback.warning.length > 0) {\n this.strengthIndicatorTarget.innerText = `${result.feedback.warning}.`;\n this.strengthIndicatorTarget.classList.remove(\"hidden\");\n } else {\n this.strengthIndicatorTarget.classList.add(\"hidden\");\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\"\nrequire(\"intl-tel-input/build/css/intlTelInput.css\");\nimport intlTelInput from 'intl-tel-input';\n\nexport default class extends Controller {\n static targets = [ \"field\" ]\n\n connect() {\n this.initPluginInstance()\n }\n\n disconnect() {\n this.teardownPluginInstance()\n }\n\n initPluginInstance() {\n let options = {\n hiddenInput: this.fieldTarget.dataset.method,\n customContainer: \"w-full\"\n }\n\n // TODO: add instructions on how to copy this asset into the application's assets path and write the meta tag into the head (via the engine?)\n const utilsScriptPath = metaContent(\"intl_tel_input_utils_path\")\n if (utilsScriptPath) {\n options['utilsScript'] = utilsScriptPath\n }\n\n this.plugin = intlTelInput(this.fieldTarget, options);\n }\n\n teardownPluginInstance() {\n if (this.plugin === undefined) { return }\n\n // revert to original markup, remove any event listeners\n this.plugin.destroy()\n }\n}\n\nfunction metaContent (name) {\n const element = document.head.querySelector(`meta[name=\"${name}\"]`)\n return element && element.content\n}","import { Controller } from \"@hotwired/stimulus\"\nrequire(\"select2/dist/css/select2.min.css\");\nimport select2 from \"select2\";\n\nexport default class extends Controller {\n static targets = [ \"select\" ]\n static values = {\n acceptsNew: Boolean,\n enableSearch: Boolean,\n searchUrl: String,\n }\n \n // will be reissued as native dom events name prepended with '$' e.g. '$change', '$select2:closing', etc\n static jQueryEventsToReissue = [ \"change\", \"select2:closing\", \"select2:close\", \"select2:opening\", \"select2:open\", \"select2:selecting\", \"select2:select\", \"select2:unselecting\", \"select2:unselect\", \"select2:clearing\", \"select2:clear\" ]\n \n\n initialize() {\n this.dispatchNativeEvent = this.dispatchNativeEvent.bind(this)\n if (this.isSelect2LoadedOnWindowJquery) {\n select2(window.$)\n }\n }\n\n get isSelect2LoadedOnWindowJquery() {\n return (window.$ !== undefined && window.$.select2 === undefined)\n }\n\n connect() {\n if (this.isSelect2LoadedOnWindowJquery) {\n this.initPluginInstance()\n }\n }\n\n disconnect() {\n this.teardownPluginInstance()\n }\n\n cleanupBeforeInit() {\n $(this.element).find('.select2-container--default').remove()\n }\n\n initPluginInstance() {\n let options = {};\n\n if (!this.enableSearchValue) {\n options.minimumResultsForSearch = -1;\n }\n\n options.tags = this.acceptsNewValue\n\n if (this.searchUrlValue) {\n options.ajax = {\n url: this.searchUrlValue,\n dataType: 'json',\n // We enable pagination by default here\n data: function(params) {\n var query = {\n search: params.term,\n page: params.page || 1\n }\n return query\n }\n // Any additional params go here...\n }\n }\n\n options.templateResult = this.formatState;\n options.templateSelection = this.formatState;\n options.width = 'style';\n\n this.cleanupBeforeInit() // in case improperly torn down\n this.pluginMainEl = this.selectTarget // required because this.selectTarget is unavailable on disconnect()\n $(this.pluginMainEl).select2(options);\n\n this.initReissuePluginEventsAsNativeEvents()\n }\n\n teardownPluginInstance() {\n if (this.pluginMainEl === undefined) { return }\n\n // ensure there are no orphaned event handlers\n this.teardownPluginEventsAsNativeEvents()\n \n // revert to original markup, remove any event listeners\n $(this.pluginMainEl).select2('destroy');\n }\n\n initReissuePluginEventsAsNativeEvents() {\n this.constructor.jQueryEventsToReissue.forEach((eventName) => {\n $(this.pluginMainEl).on(eventName, this.dispatchNativeEvent)\n })\n }\n \n teardownPluginEventsAsNativeEvents() {\n this.constructor.jQueryEventsToReissue.forEach((eventName) => {\n $(this.pluginMainEl).off(eventName)\n })\n }\n \n dispatchNativeEvent(event) {\n const nativeEventName = '$' + event.type // e.g. '$change.select2'\n this.element.dispatchEvent(new CustomEvent(nativeEventName, { detail: { event: event }, bubbles: true, cancelable: false }))\n }\n\n // https://stackoverflow.com/questions/29290389/select2-add-image-icon-to-option-dynamically\n formatState(opt) {\n var imageUrl = $(opt.element).attr('data-image');\n var imageHtml = \"\";\n if (imageUrl) {\n imageHtml = '<img src=\"' + imageUrl + '\" /> ';\n }\n return $('<span>' + imageHtml + sanitizeHTML(opt.text) + '</span>');\n }\n}\n\n// https://portswigger.net/web-security/cross-site-scripting/preventing\nfunction sanitizeHTML(str) {\n return str.replace(/[^\\w. ]/gi, function (c) {\n return '&#' + c.charCodeAt(0) + ';';\n });\n};\n","import { identifierForContextKey } from \"@hotwired/stimulus-webpack-helpers\"\n\nimport ButtonToggleController from './fields/button_toggle_controller'\nimport CloudinaryImageController from './fields/cloudinary_image_controller'\nimport ColorPickerController from './fields/color_picker_controller'\nimport DateController from './fields/date_controller'\nimport FileFieldController from './fields/file_field_controller'\nimport PasswordController from './fields/password_controller'\nimport PhoneController from './fields/phone_controller'\nimport SuperSelectController from './fields/super_select_controller'\n\nexport const controllerDefinitions = [\n [ButtonToggleController, 'fields/button_toggle_controller.js'],\n [CloudinaryImageController, 'fields/cloudinary_image_controller.js'],\n [ColorPickerController, 'fields/color_picker_controller.js'],\n [DateController, 'fields/date_controller.js'],\n [FileFieldController, 'fields/file_field_controller.js'],\n [PasswordController, 'fields/password_controller.js'],\n [PhoneController, 'fields/phone_controller.js'],\n [SuperSelectController, 'fields/super_select_controller.js'],\n].map(function(d) {\n const key = d[1]\n const controller = d[0]\n return {\n identifier: identifierForContextKey(key),\n controllerConstructor: controller\n }\n})\n\nexport {\n ButtonToggleController,\n CloudinaryImageController,\n ColorPickerController,\n DateController,\n FileFieldController,\n PasswordController,\n PhoneController,\n SuperSelectController,\n}","import Tribute from 'tributejs'\nrequire(\"trix/dist/trix.css\");\n\nrequire(\"trix\")\nrequire(\"@rails/actiontext\")\n\n// only show the editor tool bar when the user is editing the field.\n// inspired by https://github.com/basecamp/trix/issues/343 and `app/assets/stylesheets/account/fields/trix_editor.scss`\n\nexport function trixEditor() {\n document.addEventListener('trix-initialize', function() {\n addEventListener(\"trix-focus\", updateTrixToolbarVisability);\n addEventListener(\"trix-blur\", updateTrixToolbarVisability);\n updateTrixToolbarVisability();\n initializeTribute();\n })\n}\n\nfunction updateTrixToolbarVisability() {\n document.querySelectorAll(\"trix-editor\").forEach((editorElement, index) => {\n var toolbarElement = editorElement.toolbarElement;\n if (editorElement == document.activeElement) {\n toolbarElement.classList.add('visible');\n } else {\n // don't hide the toolbar if we've unfocused to focus on the link dialog.\n if (!toolbarElement.contains(document.activeElement)) {\n toolbarElement.classList.remove('visible');\n }\n }\n })\n}\n\nfunction initializeTribute() {\n document.querySelectorAll(\"trix-editor\").forEach((el, index) => {\n var editor = el.editor;\n \n var mentionConfig = {\n trigger: '@',\n values: JSON.parse(editor.element.dataset.mentions),\n selectTemplate: function (item) {\n item = item.original;\n return '<a href=\"' + item.protocol + '://' + item.model + '/' + item.id + '\">' + item.label + '</a>';\n },\n menuItemTemplate: function (item) {\n return '<img src=\"' + item.original.photo + '\" /> ' + item.string;\n },\n requireLeadingSpace: true,\n replaceTextSuffix: ''\n }\n \n var topicConfig = {\n trigger: '#',\n values: JSON.parse(editor.element.dataset.topics),\n selectTemplate: function (item) {\n item = item.original;\n return '<a href=\"' + item.protocol + '://' + item.model + '/' + item.id + '\">' + item.label + '</a>';\n },\n menuItemTemplate: function (item) {\n return '<img src=\"' + item.original.photo + '\" /> ' + item.string;\n },\n requireLeadingSpace: true,\n replaceTextSuffix: ''\n }\n \n var tribute = new Tribute({\n collection: [topicConfig, mentionConfig],\n });\n \n tribute.attach(el);\n })\n}\n"],"names":["identifierForContextKey","key","logicalName","match","replace","Controller","clickShadowField","event","preventDefault","this","shadowFieldTarget","click","targets","pickImageAndUpload","defaultSources","hasGoogleApiKeyValue","push","options","cloud_name","cloudNameValue","apiKey","apiKeyValue","upload_preset","uploadPresetValue","upload_signature","getCloudinarySignature","bind","multiple","sources","hasSourcesValue","sourcesValue","split","search_by_rights","hasSearchByRightsValue","searchByRightsValue","googleApiKeyValue","cloudinary","openUploadWidget","handleWidgetResponse","clearImage","hiddenFieldTarget","value","removeThumbnail","callback","paramsToSign","$","ajax","url","signaturesUrlValue","type","dataType","data","complete","console","log","success","signature","textStatus","xhr","error","status","response","info","public_id","addThumbnail","urlFormatValue","$imageElement","widthValue","heightValue","identifier","uploadButtonTarget","prepend","classList","add","thumbnailShownClass","hasThumbnailTarget","removeChild","thumbnailTarget","remove","values","signaturesUrl","String","height","Number","width","cloudName","googleApiKey","urlFormat","searchByRights","Boolean","classes","connect","initPluginInstance","colorOptions","colorOptionsTarget","find","map","_","button","attr","get","disconnect","teardownPluginInstance","pickColor","targetEl","target","color","dataset","colorInputTarget","val","colorPickerValueTarget","userSelectedColorTarget","removeClass","pickr","setColor","pickRandomColor","r","Math","floor","random","g","b","hexColor","getColor","toHEXA","toString","showUserSelectedColor","addClass","css","show","unpickColor","hide","togglePickr","Pickr","create","el","theme","useAsButton","default","initialColorValue","components","preview","hue","interaction","input","save","on","_instance","hexaColor","includes","that","e","applyColor","destroy","initialColor","require","clearDate","fieldTarget","applyDateToField","picker","format","includeTimeValue","startDate","dispatchEvent","CustomEvent","detail","showTimeZoneButtons","currentTimeZoneWrapperTarget","toggleClass","timeZoneButtonsTarget","showTimeZoneSelectWrapper","hasTimeZoneSelectWrapperTarget","timeZoneSelectWrapperTarget","resetTimeZoneUI","setTimeZone","currentTimeZoneEl","querySelector","timeZoneFieldTarget","text","daterangepicker","singleDatePicker","timePicker","timePickerIncrement","autoUpdateInput","locale","cancelLabel","cancelButtonLabelValue","applyLabel","applyButtonLabelValue","pluginMainEl","plugin","timeZoneSelect","select2","self","selectedOptionTimeZoneButton","defaultTimeZonesValue","removeAttr","undefined","off","includeTime","defaultTimeZones","Array","cancelButtonLabel","applyButtonLabel","initializeListener","document","addEventListener","selectFileButtonTarget","progressBarTarget","innerText","style","setAttribute","parentNode","progressListener","progress","toFixed","errorListener","uploadListeners","removeEventListener","uploadFile","fileFieldTarget","removeFile","hasDownloadFileButtonTarget","downloadFileButtonTarget","removeFileButtonTarget","removeFileFlagTarget","handleFileSelected","statusText","icon","estimateStrength","result","zxcvbn","feedback","warning","length","strengthIndicatorTarget","hiddenInput","method","customContainer","utilsScriptPath","name","element","head","content","metaContent","intlTelInput","initialize","dispatchNativeEvent","isSelect2LoadedOnWindowJquery","window","cleanupBeforeInit","enableSearchValue","minimumResultsForSearch","tags","acceptsNewValue","searchUrlValue","params","search","term","page","templateResult","formatState","templateSelection","selectTarget","initReissuePluginEventsAsNativeEvents","teardownPluginEventsAsNativeEvents","constructor","jQueryEventsToReissue","forEach","eventName","bubbles","cancelable","opt","imageUrl","imageHtml","c","charCodeAt","acceptsNew","enableSearch","searchUrl","controllerDefinitions","ButtonToggleController","CloudinaryImageController","ColorPickerController","DateController","FileFieldController","PasswordController","PhoneController","SuperSelectController","d","controller","controllerConstructor","updateTrixToolbarVisability","querySelectorAll","editorElement","index","toolbarElement","activeElement","contains","editor","mentionConfig","trigger","JSON","parse","mentions","selectTemplate","item","original","protocol","model","id","label","menuItemTemplate","photo","string","requireLeadingSpace","replaceTextSuffix","topicConfig","topics","Tribute","collection","attach"],"mappings":"uWAqBA,SAASA,EAAwBC,GAC7B,MAAMC,GAAeD,EAAIE,MAAM,2CAA6C,IAAI,GAChF,GAAID,EACA,OAAOA,EAAYE,QAAQ,KAAM,KAAKA,QAAQ,MAAO,sBCtBhCC,aAG3BC,iBAAiBC,GAEfA,EAAMC,iBAGNC,KAAKC,kBAAkBC,WAPlBC,QAAU,CAAE,+BCDQP,aAe3BQ,mBAAmBN,GAEjBA,EAAMC,iBAGN,IAAIM,EAAiB,CAAC,QAAS,MAAO,UAClCL,KAAKM,sBACPD,EAAeE,KAAK,gBAKtB,IAAIC,EAAU,CACZC,WAAYT,KAAKU,eACjBC,OAAQX,KAAKY,YACbC,cAAeb,KAAKc,kBACpBC,iBAAkBf,KAAKgB,uBAAuBC,KAAKjB,MACnDkB,UAAU,EACVC,QAASnB,KAAKoB,gBAAkBpB,KAAKqB,aAAaC,MAAM,KAAOjB,EAC/DkB,kBAAkBvB,KAAKwB,yBAAuD,IAA7BxB,KAAKyB,qBAGpDzB,KAAKM,uBACPE,EAAO,eAAqBR,KAAK0B,mBAInCC,WAAWC,iBAAiBpB,EAASR,KAAK6B,qBAAqBZ,KAAKjB,OAGtE8B,WAAWhC,GAETA,EAAMC,iBAGNC,KAAK+B,kBAAkBC,MAAQ,KAG/BhC,KAAKiC,kBAGPjB,uBAAuBkB,EAAUC,GAC/BC,EAAEC,KAAK,CACLC,IAAKtC,KAAKuC,mBACVC,KAAM,MACNC,SAAU,OACVC,KAAM,CAACA,KAAMP,GACbQ,SAAU,WAAaC,QAAQC,IAAI,aACnCC,QAAS,SAASC,EAAWC,EAAYC,GAAOf,EAASa,IACzDG,MAAO,SAASD,EAAKE,EAAQD,GAASN,QAAQC,IAAII,EAAKE,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