@plaidev/karte-action-sdk 1.1.119-27929222.4cbf467a → 1.1.119-27929495.c92443f3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { writable, get } from 'svelte/store';
2
2
  import { linear, elasticOut, cubicOut } from 'svelte/easing';
3
- import { SvelteComponent, init, safe_not_equal, append_styles, create_slot, create_component, space, mount_component, insert, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, destroy_component, detach, empty, group_outros, check_outros, component_subscribe, element, attr, noop, listen, is_function, append, add_render_callback, create_in_transition, svg_element, binding_callbacks, destroy_each, text, set_data, null_to_empty, src_url_equal, set_style } from 'svelte/internal';
3
+ import { SvelteComponent, init, safe_not_equal, append_styles, create_slot, create_component, space, mount_component, insert, update_slot_base, get_all_dirty_from_scope, get_slot_changes, transition_in, transition_out, destroy_component, detach, empty, group_outros, check_outros, component_subscribe, element, attr, noop, listen, is_function, append, add_render_callback, create_in_transition, svg_element, binding_callbacks, destroy_each, text, set_data, null_to_empty, src_url_equal } from 'svelte/internal';
4
4
  import { setContext, getContext, createEventDispatcher, onMount, onDestroy as onDestroy$1 } from 'svelte';
5
5
 
6
6
  /** @internal */
@@ -590,6 +590,99 @@ function updateCustomVariables(variables) {
590
590
  */
591
591
  const formData = writable({});
592
592
 
593
+ function isEmpty(value) {
594
+ if (Array.isArray(value)) {
595
+ return value.length === 0;
596
+ }
597
+ else {
598
+ return !value;
599
+ }
600
+ }
601
+ /** @internal */
602
+ function registerInput({ name, statePath, validator = () => true, initialValue, }) {
603
+ const writableValue = {
604
+ subscribe(run) {
605
+ return formData.subscribe(formData => {
606
+ run(formData[name]?.value);
607
+ });
608
+ },
609
+ set(value) {
610
+ formData.update(prev => ({
611
+ ...prev,
612
+ [name]: {
613
+ statePath,
614
+ value,
615
+ isValid: validator(value),
616
+ },
617
+ }));
618
+ },
619
+ update(updater) {
620
+ formData.update(prev => {
621
+ const prevValue = prev[name]?.value;
622
+ return {
623
+ ...prev,
624
+ [name]: {
625
+ statePath,
626
+ value: updater(prevValue),
627
+ isValid: validator(prevValue),
628
+ },
629
+ };
630
+ });
631
+ },
632
+ };
633
+ if (isEmpty(get(writableValue))) {
634
+ writableValue.set(initialValue);
635
+ }
636
+ return writableValue;
637
+ }
638
+ /** @internal */
639
+ const getValuesAreValidReader = statePath => ({
640
+ subscribe(callback) {
641
+ return formData.subscribe(formData => {
642
+ const valuesAreValid = Object.entries(formData)
643
+ .filter(([_, { statePath: s }]) => s === statePath) // eslint-disable-line @typescript-eslint/no-unused-vars
644
+ .every(([_, { isValid }]) => isValid); // eslint-disable-line @typescript-eslint/no-unused-vars
645
+ callback(valuesAreValid);
646
+ });
647
+ },
648
+ });
649
+ function formDataToEventValues(campaignId, formData) {
650
+ const questions = [];
651
+ const answersMap = {};
652
+ Object.entries(formData).forEach(([name, dataItem]) => {
653
+ questions.push(name);
654
+ const value = dataItem.value;
655
+ const answerKey = `question_${name}`;
656
+ if (Array.isArray(value)) {
657
+ answersMap[answerKey] = {
658
+ choices: value,
659
+ };
660
+ }
661
+ else if (typeof value === 'string') {
662
+ answersMap[answerKey] = {
663
+ free_answer: value,
664
+ };
665
+ }
666
+ });
667
+ return {
668
+ [campaignId]: {
669
+ questions,
670
+ ...answersMap,
671
+ },
672
+ };
673
+ }
674
+ /** @internal */
675
+ function submit() {
676
+ const systemConfig = getSystem();
677
+ const campaignId = systemConfig.campaignId;
678
+ if (campaignId) {
679
+ const formData$1 = get(formData);
680
+ const values = formDataToEventValues(campaignId, formData$1);
681
+ return values;
682
+ }
683
+ return {};
684
+ }
685
+
593
686
  /** @internal */
594
687
  const ALL_ACTION_ID = 'KARTE_ALL_ACTION_ID';
595
688
  /** @internal */
@@ -636,10 +729,13 @@ const send_event = (event_name, values) => {
636
729
  const setting = getActionSetting();
637
730
  setting?.send?.(event_name, values);
638
731
  };
639
- /** @internal */
640
- const moveTo = (to) => () => {
732
+ function _moveTo(to) {
641
733
  send_event('_message_state_changed', { state: to });
642
734
  window.dispatchEvent(new CustomEvent(ACTION_CHANGE_STATE_EVENT, { detail: { to, actionId } }));
735
+ }
736
+ /** @internal */
737
+ const moveTo = (to) => () => {
738
+ _moveTo(to);
643
739
  };
644
740
  /** @internal */
645
741
  const linkTo = (to, targetBlank = true) => () => {
@@ -669,6 +765,21 @@ const runScript = (handlerName) => () => {
669
765
  }
670
766
  };
671
767
  /** @internal */
768
+ const submitForm = (to) => () => {
769
+ const values = submit();
770
+ send_event('_answer_question', values);
771
+ _moveTo(to);
772
+ };
773
+ /** @internal */
774
+ const nextForm = (to) => () => {
775
+ _moveTo(to);
776
+ };
777
+ /** @internal */
778
+ const prevForm = (to) => () => {
779
+ // deleteValues(stateId);
780
+ _moveTo(to);
781
+ };
782
+ /** @internal */
672
783
  const execOnClickOperation = (onClickOperation) => {
673
784
  if (onClickOperation.operation === 'linkTo') {
674
785
  linkTo(...onClickOperation.args)();
@@ -682,6 +793,15 @@ const execOnClickOperation = (onClickOperation) => {
682
793
  else if (onClickOperation.operation === 'runScript') {
683
794
  runScript(onClickOperation.args[0])();
684
795
  }
796
+ else if (onClickOperation.operation === 'submitForm') {
797
+ submitForm(onClickOperation.args[0])();
798
+ }
799
+ else if (onClickOperation.operation === 'nextForm') {
800
+ nextForm(onClickOperation.args[0])();
801
+ }
802
+ else if (onClickOperation.operation === 'prevForm') {
803
+ prevForm(onClickOperation.args[0])();
804
+ }
685
805
  };
686
806
  /** @internal */
687
807
  const haveFunction = (onClickOperation) => {
@@ -1101,11 +1221,8 @@ const OnClickOperationOptions = [
1101
1221
  },
1102
1222
  ],
1103
1223
  },
1104
- ];
1105
- /** @internal */
1106
- const FormOperationOptions = [
1107
1224
  {
1108
- operation: 'submit',
1225
+ operation: 'submitForm',
1109
1226
  args: [
1110
1227
  {
1111
1228
  type: 'TransitState',
@@ -1114,7 +1231,7 @@ const FormOperationOptions = [
1114
1231
  ],
1115
1232
  },
1116
1233
  {
1117
- operation: 'next',
1234
+ operation: 'nextForm',
1118
1235
  args: [
1119
1236
  {
1120
1237
  type: 'TransitState',
@@ -1123,7 +1240,7 @@ const FormOperationOptions = [
1123
1240
  ],
1124
1241
  },
1125
1242
  {
1126
- operation: 'prev',
1243
+ operation: 'prevForm',
1127
1244
  args: [
1128
1245
  {
1129
1246
  type: 'TransitState',
@@ -2063,7 +2180,7 @@ class Normalize extends SvelteComponent {
2063
2180
 
2064
2181
  /* src/components/State.svelte generated by Svelte v3.53.1 */
2065
2182
 
2066
- function create_fragment$r(ctx) {
2183
+ function create_fragment$q(ctx) {
2067
2184
  let normalize;
2068
2185
  let t;
2069
2186
  let current;
@@ -2122,7 +2239,7 @@ function create_fragment$r(ctx) {
2122
2239
  };
2123
2240
  }
2124
2241
 
2125
- function instance$r($$self, $$props, $$invalidate) {
2242
+ function instance$q($$self, $$props, $$invalidate) {
2126
2243
  let { $$slots: slots = {}, $$scope } = $$props;
2127
2244
 
2128
2245
  $$self.$$set = $$props => {
@@ -2135,7 +2252,7 @@ function instance$r($$self, $$props, $$invalidate) {
2135
2252
  class State extends SvelteComponent {
2136
2253
  constructor(options) {
2137
2254
  super();
2138
- init(this, options, instance$r, create_fragment$r, safe_not_equal, {});
2255
+ init(this, options, instance$q, create_fragment$q, safe_not_equal, {});
2139
2256
  }
2140
2257
  }
2141
2258
 
@@ -2208,7 +2325,7 @@ function create_if_block$5(ctx) {
2208
2325
  };
2209
2326
  }
2210
2327
 
2211
- function create_fragment$q(ctx) {
2328
+ function create_fragment$p(ctx) {
2212
2329
  let if_block_anchor;
2213
2330
  let current;
2214
2331
  let if_block = /*$state*/ ctx[1] === /*path*/ ctx[0] && create_if_block$5(ctx);
@@ -2269,7 +2386,7 @@ function getStateItemContext() {
2269
2386
  return getContext(STATE_ITEM_CONTEXT_KEY);
2270
2387
  }
2271
2388
 
2272
- function instance$q($$self, $$props, $$invalidate) {
2389
+ function instance$p($$self, $$props, $$invalidate) {
2273
2390
  let $state;
2274
2391
  component_subscribe($$self, state, $$value => $$invalidate(1, $state = $$value));
2275
2392
  let { $$slots: slots = {}, $$scope } = $$props;
@@ -2295,7 +2412,7 @@ function instance$q($$self, $$props, $$invalidate) {
2295
2412
  class StateItem extends SvelteComponent {
2296
2413
  constructor(options) {
2297
2414
  super();
2298
- init(this, options, instance$q, create_fragment$q, safe_not_equal, { path: 0 }, add_css$m);
2415
+ init(this, options, instance$p, create_fragment$p, safe_not_equal, { path: 0 }, add_css$m);
2299
2416
  }
2300
2417
  }
2301
2418
 
@@ -2333,7 +2450,7 @@ function create_if_block$4(ctx) {
2333
2450
  };
2334
2451
  }
2335
2452
 
2336
- function create_fragment$p(ctx) {
2453
+ function create_fragment$o(ctx) {
2337
2454
  let if_block_anchor;
2338
2455
  let if_block = /*backgroundOverray*/ ctx[0] && create_if_block$4(ctx);
2339
2456
 
@@ -2369,7 +2486,7 @@ function create_fragment$p(ctx) {
2369
2486
  };
2370
2487
  }
2371
2488
 
2372
- function instance$p($$self, $$props, $$invalidate) {
2489
+ function instance$o($$self, $$props, $$invalidate) {
2373
2490
  let { backgroundOverray = false } = $$props;
2374
2491
  const dispatch = createEventDispatcher();
2375
2492
  const click_handler = () => dispatch('click');
@@ -2384,7 +2501,7 @@ function instance$p($$self, $$props, $$invalidate) {
2384
2501
  class BackgroundOverray extends SvelteComponent {
2385
2502
  constructor(options) {
2386
2503
  super();
2387
- init(this, options, instance$p, create_fragment$p, safe_not_equal, { backgroundOverray: 0 }, add_css$l);
2504
+ init(this, options, instance$o, create_fragment$o, safe_not_equal, { backgroundOverray: 0 }, add_css$l);
2388
2505
  }
2389
2506
  }
2390
2507
 
@@ -2571,7 +2688,7 @@ function create_if_block_1$1(ctx) {
2571
2688
  };
2572
2689
  }
2573
2690
 
2574
- function create_fragment$o(ctx) {
2691
+ function create_fragment$n(ctx) {
2575
2692
  let backgroundoverray;
2576
2693
  let t;
2577
2694
  let if_block_anchor;
@@ -2664,7 +2781,7 @@ function create_fragment$o(ctx) {
2664
2781
  };
2665
2782
  }
2666
2783
 
2667
- function instance$o($$self, $$props, $$invalidate) {
2784
+ function instance$n($$self, $$props, $$invalidate) {
2668
2785
  let click;
2669
2786
  let close;
2670
2787
  let closable;
@@ -2852,8 +2969,8 @@ class Modal extends SvelteComponent {
2852
2969
  init(
2853
2970
  this,
2854
2971
  options,
2855
- instance$o,
2856
- create_fragment$o,
2972
+ instance$n,
2973
+ create_fragment$n,
2857
2974
  safe_not_equal,
2858
2975
  {
2859
2976
  onClick: 17,
@@ -2876,7 +2993,7 @@ class Modal extends SvelteComponent {
2876
2993
 
2877
2994
  /* src/components/Grid.svelte generated by Svelte v3.53.1 */
2878
2995
 
2879
- function create_fragment$n(ctx) {
2996
+ function create_fragment$m(ctx) {
2880
2997
  let div;
2881
2998
  let current;
2882
2999
  const default_slot_template = /*#slots*/ ctx[8].default;
@@ -2934,7 +3051,7 @@ function create_fragment$n(ctx) {
2934
3051
  };
2935
3052
  }
2936
3053
 
2937
- function instance$n($$self, $$props, $$invalidate) {
3054
+ function instance$m($$self, $$props, $$invalidate) {
2938
3055
  let _style;
2939
3056
  let { $$slots: slots = {}, $$scope } = $$props;
2940
3057
  let { width = '512px' } = $$props;
@@ -2979,7 +3096,7 @@ class Grid extends SvelteComponent {
2979
3096
  constructor(options) {
2980
3097
  super();
2981
3098
 
2982
- init(this, options, instance$n, create_fragment$n, safe_not_equal, {
3099
+ init(this, options, instance$m, create_fragment$m, safe_not_equal, {
2983
3100
  width: 1,
2984
3101
  height: 2,
2985
3102
  rows: 3,
@@ -3161,7 +3278,7 @@ function create_default_slot(ctx) {
3161
3278
  };
3162
3279
  }
3163
3280
 
3164
- function create_fragment$m(ctx) {
3281
+ function create_fragment$l(ctx) {
3165
3282
  let stateitem;
3166
3283
  let current;
3167
3284
 
@@ -3206,7 +3323,7 @@ function create_fragment$m(ctx) {
3206
3323
  };
3207
3324
  }
3208
3325
 
3209
- function instance$m($$self, $$props, $$invalidate) {
3326
+ function instance$l($$self, $$props, $$invalidate) {
3210
3327
  let { $$slots: slots = {}, $$scope } = $$props;
3211
3328
  let { path } = $$props;
3212
3329
  let { onClick = { operation: 'none', args: [] } } = $$props;
@@ -3277,7 +3394,7 @@ class GridModalState extends SvelteComponent {
3277
3394
  constructor(options) {
3278
3395
  super();
3279
3396
 
3280
- init(this, options, instance$m, create_fragment$m, safe_not_equal, {
3397
+ init(this, options, instance$l, create_fragment$l, safe_not_equal, {
3281
3398
  path: 0,
3282
3399
  onClick: 1,
3283
3400
  clickEventName: 2,
@@ -3306,7 +3423,7 @@ function add_css$j(target) {
3306
3423
  append_styles(target, "svelte-n7kdl3", ".grid-item.svelte-n7kdl3{word-break:break-all;position:relative}.grid-item-inner.svelte-n7kdl3{position:absolute;inset:0}");
3307
3424
  }
3308
3425
 
3309
- function create_fragment$l(ctx) {
3426
+ function create_fragment$k(ctx) {
3310
3427
  let div1;
3311
3428
  let div0;
3312
3429
  let current;
@@ -3369,7 +3486,7 @@ function create_fragment$l(ctx) {
3369
3486
  };
3370
3487
  }
3371
3488
 
3372
- function instance$l($$self, $$props, $$invalidate) {
3489
+ function instance$k($$self, $$props, $$invalidate) {
3373
3490
  let _style;
3374
3491
  let { $$slots: slots = {}, $$scope } = $$props;
3375
3492
  let { x1 } = $$props;
@@ -3422,8 +3539,8 @@ class GridItem extends SvelteComponent {
3422
3539
  init(
3423
3540
  this,
3424
3541
  options,
3425
- instance$l,
3426
- create_fragment$l,
3542
+ instance$k,
3543
+ create_fragment$k,
3427
3544
  safe_not_equal,
3428
3545
  {
3429
3546
  x1: 2,
@@ -3444,7 +3561,7 @@ function add_css$i(target) {
3444
3561
  append_styles(target, "svelte-1e71ejc", ".flex.svelte-1e71ejc{display:flex}");
3445
3562
  }
3446
3563
 
3447
- function create_fragment$k(ctx) {
3564
+ function create_fragment$j(ctx) {
3448
3565
  let div;
3449
3566
  let div_style_value;
3450
3567
  let current;
@@ -3509,7 +3626,7 @@ function getFlexContext() {
3509
3626
  return getContext(FlexContextKey);
3510
3627
  }
3511
3628
 
3512
- function instance$k($$self, $$props, $$invalidate) {
3629
+ function instance$j($$self, $$props, $$invalidate) {
3513
3630
  let { $$slots: slots = {}, $$scope } = $$props;
3514
3631
  let { direction = 'row' } = $$props;
3515
3632
  let { width = '100%' } = $$props;
@@ -3535,8 +3652,8 @@ class Flex extends SvelteComponent {
3535
3652
  init(
3536
3653
  this,
3537
3654
  options,
3538
- instance$k,
3539
- create_fragment$k,
3655
+ instance$j,
3656
+ create_fragment$j,
3540
3657
  safe_not_equal,
3541
3658
  {
3542
3659
  direction: 0,
@@ -3555,7 +3672,7 @@ function add_css$h(target) {
3555
3672
  append_styles(target, "svelte-1p0bk1x", ".flex-item.svelte-1p0bk1x{max-width:100%;max-height:100%;position:relative;isolation:isolate}");
3556
3673
  }
3557
3674
 
3558
- function create_fragment$j(ctx) {
3675
+ function create_fragment$i(ctx) {
3559
3676
  let div;
3560
3677
  let current;
3561
3678
  const default_slot_template = /*#slots*/ ctx[4].default;
@@ -3613,7 +3730,7 @@ function create_fragment$j(ctx) {
3613
3730
  };
3614
3731
  }
3615
3732
 
3616
- function instance$j($$self, $$props, $$invalidate) {
3733
+ function instance$i($$self, $$props, $$invalidate) {
3617
3734
  let { $$slots: slots = {}, $$scope } = $$props;
3618
3735
  let { length } = $$props;
3619
3736
  let { _style = '' } = $$props;
@@ -3656,7 +3773,7 @@ function instance$j($$self, $$props, $$invalidate) {
3656
3773
  class FlexItem extends SvelteComponent {
3657
3774
  constructor(options) {
3658
3775
  super();
3659
- init(this, options, instance$j, create_fragment$j, safe_not_equal, { length: 1, _style: 2 }, add_css$h);
3776
+ init(this, options, instance$i, create_fragment$i, safe_not_equal, { length: 1, _style: 2 }, add_css$h);
3660
3777
  }
3661
3778
  }
3662
3779
 
@@ -3751,7 +3868,7 @@ function create_each_block$4(ctx) {
3751
3868
  };
3752
3869
  }
3753
3870
 
3754
- function create_fragment$i(ctx) {
3871
+ function create_fragment$h(ctx) {
3755
3872
  let each_1_anchor;
3756
3873
  let each_value = /*items*/ ctx[0];
3757
3874
  let each_blocks = [];
@@ -3810,7 +3927,7 @@ function create_fragment$i(ctx) {
3810
3927
 
3811
3928
  const regexp = /(\r?\n)/;
3812
3929
 
3813
- function instance$i($$self, $$props, $$invalidate) {
3930
+ function instance$h($$self, $$props, $$invalidate) {
3814
3931
  let items;
3815
3932
  let { text = 'サンプルSample' } = $$props;
3816
3933
 
@@ -3830,7 +3947,7 @@ function instance$i($$self, $$props, $$invalidate) {
3830
3947
  class RenderText extends SvelteComponent {
3831
3948
  constructor(options) {
3832
3949
  super();
3833
- init(this, options, instance$i, create_fragment$i, safe_not_equal, { text: 1 });
3950
+ init(this, options, instance$h, create_fragment$h, safe_not_equal, { text: 1 });
3834
3951
  }
3835
3952
  }
3836
3953
 
@@ -3840,7 +3957,7 @@ function add_css$g(target) {
3840
3957
  append_styles(target, "svelte-9en2jg", ".text-element.svelte-9en2jg.svelte-9en2jg{display:flex;position:relative;width:100%;height:100%;box-sizing:border-box;white-space:pre-wrap;overflow:auto}.text-element-inner.svelte-9en2jg.svelte-9en2jg{width:100%;height:auto}.text-direction-vertical.svelte-9en2jg.svelte-9en2jg{writing-mode:vertical-rl}.text-direction-vertical.svelte-9en2jg .text-element-inner.svelte-9en2jg{width:auto;height:100%}");
3841
3958
  }
3842
3959
 
3843
- function create_fragment$h(ctx) {
3960
+ function create_fragment$g(ctx) {
3844
3961
  let div1;
3845
3962
  let div0;
3846
3963
  let rendertext;
@@ -3892,7 +4009,7 @@ function create_fragment$h(ctx) {
3892
4009
  };
3893
4010
  }
3894
4011
 
3895
- function instance$h($$self, $$props, $$invalidate) {
4012
+ function instance$g($$self, $$props, $$invalidate) {
3896
4013
  let style;
3897
4014
  let { text = 'サンプルSample' } = $$props;
3898
4015
  let { _textStyle = 'font-size:12px;' } = $$props;
@@ -3922,8 +4039,8 @@ class TextElement extends SvelteComponent {
3922
4039
  init(
3923
4040
  this,
3924
4041
  options,
3925
- instance$h,
3926
- create_fragment$h,
4042
+ instance$g,
4043
+ create_fragment$g,
3927
4044
  safe_not_equal,
3928
4045
  {
3929
4046
  text: 0,
@@ -3939,13 +4056,15 @@ class TextElement extends SvelteComponent {
3939
4056
  /* src/components/TextButtonElement.svelte generated by Svelte v3.53.1 */
3940
4057
 
3941
4058
  function add_css$f(target) {
3942
- append_styles(target, "svelte-tx5xf5", ".text-button-element.svelte-tx5xf5{width:100%;height:100%}.text-button.svelte-tx5xf5{display:flex;justify-content:center;align-items:center;width:100%;height:100%;background-color:transparent;border:none;box-shadow:transparent;box-sizing:border-box;cursor:pointer;transition:box-shadow 0.2s;white-space:pre-wrap;overflow:hidden}.text-button.svelte-tx5xf5:active{box-shadow:inset 0 0 100px 100px rgba(0, 0, 0, 0.3)}.text-button.svelte-tx5xf5:hover{box-shadow:inset 0 0 100px 100px rgba(255, 255, 255, 0.3)}");
4059
+ append_styles(target, "svelte-1igv5yx", ".text-button-element.svelte-1igv5yx{width:100%;height:100%}.text-button-element._disabled.svelte-1igv5yx{opacity:0.2}.text-button.svelte-1igv5yx{display:flex;justify-content:center;align-items:center;width:100%;height:100%;background-color:transparent;border:none;box-shadow:transparent;box-sizing:border-box;cursor:pointer;transition:box-shadow 0.2s;white-space:pre-wrap;overflow:hidden}.text-button._disabled.svelte-1igv5yx{cursor:not-allowed}.text-button.svelte-1igv5yx:active{box-shadow:inset 0 0 100px 100px rgba(0, 0, 0, 0.3)}.text-button.svelte-1igv5yx:hover{box-shadow:inset 0 0 100px 100px rgba(255, 255, 255, 0.3)}");
3943
4060
  }
3944
4061
 
3945
- function create_fragment$g(ctx) {
4062
+ function create_fragment$f(ctx) {
3946
4063
  let div;
3947
4064
  let button;
3948
4065
  let rendertext;
4066
+ let button_class_value;
4067
+ let div_class_value;
3949
4068
  let current;
3950
4069
  let mounted;
3951
4070
  let dispose;
@@ -3956,9 +4075,10 @@ function create_fragment$g(ctx) {
3956
4075
  div = element("div");
3957
4076
  button = element("button");
3958
4077
  create_component(rendertext.$$.fragment);
3959
- attr(button, "class", "text-button svelte-tx5xf5");
4078
+ attr(button, "class", button_class_value = "" + (null_to_empty(`text-button${/*disabled*/ ctx[3] ? ' _disabled' : ''}`) + " svelte-1igv5yx"));
3960
4079
  attr(button, "style", /*_buttonStyle*/ ctx[1]);
3961
- attr(div, "class", "text-button-element svelte-tx5xf5");
4080
+ button.disabled = /*disabled*/ ctx[3];
4081
+ attr(div, "class", div_class_value = "" + (null_to_empty(`text-button-element${/*disabled*/ ctx[3] ? ' _disabled' : ''}`) + " svelte-1igv5yx"));
3962
4082
  attr(div, "style", /*_style*/ ctx[2]);
3963
4083
  },
3964
4084
  m(target, anchor) {
@@ -3968,7 +4088,7 @@ function create_fragment$g(ctx) {
3968
4088
  current = true;
3969
4089
 
3970
4090
  if (!mounted) {
3971
- dispose = listen(button, "click", /*click*/ ctx[3]);
4091
+ dispose = listen(button, "click", /*click*/ ctx[4]);
3972
4092
  mounted = true;
3973
4093
  }
3974
4094
  },
@@ -3977,10 +4097,22 @@ function create_fragment$g(ctx) {
3977
4097
  if (dirty & /*text*/ 1) rendertext_changes.text = /*text*/ ctx[0];
3978
4098
  rendertext.$set(rendertext_changes);
3979
4099
 
4100
+ if (!current || dirty & /*disabled*/ 8 && button_class_value !== (button_class_value = "" + (null_to_empty(`text-button${/*disabled*/ ctx[3] ? ' _disabled' : ''}`) + " svelte-1igv5yx"))) {
4101
+ attr(button, "class", button_class_value);
4102
+ }
4103
+
3980
4104
  if (!current || dirty & /*_buttonStyle*/ 2) {
3981
4105
  attr(button, "style", /*_buttonStyle*/ ctx[1]);
3982
4106
  }
3983
4107
 
4108
+ if (!current || dirty & /*disabled*/ 8) {
4109
+ button.disabled = /*disabled*/ ctx[3];
4110
+ }
4111
+
4112
+ if (!current || dirty & /*disabled*/ 8 && div_class_value !== (div_class_value = "" + (null_to_empty(`text-button-element${/*disabled*/ ctx[3] ? ' _disabled' : ''}`) + " svelte-1igv5yx"))) {
4113
+ attr(div, "class", div_class_value);
4114
+ }
4115
+
3984
4116
  if (!current || dirty & /*_style*/ 4) {
3985
4117
  attr(div, "style", /*_style*/ ctx[2]);
3986
4118
  }
@@ -4003,7 +4135,9 @@ function create_fragment$g(ctx) {
4003
4135
  };
4004
4136
  }
4005
4137
 
4006
- function instance$g($$self, $$props, $$invalidate) {
4138
+ function instance$f($$self, $$props, $$invalidate) {
4139
+ let disabled;
4140
+ let $valuesAreValid;
4007
4141
  let { text = 'ボタンラベル' } = $$props;
4008
4142
  let { onClick = { operation: 'none', args: [] } } = $$props;
4009
4143
 
@@ -4018,16 +4152,45 @@ function instance$g($$self, $$props, $$invalidate) {
4018
4152
  let { eventName = '' } = $$props;
4019
4153
  let { _buttonStyle = 'color:#ffffff; font-size:14px; font-weight:bold; justify-content:center; align-items:center; padding:1px 6px 1px 6px;' } = $$props;
4020
4154
  let { _style = 'background-color: #000000; border-radius:4px;' } = $$props;
4155
+ const { path: statePath } = getStateItemContext() ?? { path: '/' };
4156
+ const valuesAreValid = getValuesAreValidReader(statePath);
4157
+ component_subscribe($$self, valuesAreValid, value => $$invalidate(8, $valuesAreValid = value));
4021
4158
 
4022
4159
  $$self.$$set = $$props => {
4023
4160
  if ('text' in $$props) $$invalidate(0, text = $$props.text);
4024
- if ('onClick' in $$props) $$invalidate(4, onClick = $$props.onClick);
4025
- if ('eventName' in $$props) $$invalidate(5, eventName = $$props.eventName);
4161
+ if ('onClick' in $$props) $$invalidate(6, onClick = $$props.onClick);
4162
+ if ('eventName' in $$props) $$invalidate(7, eventName = $$props.eventName);
4026
4163
  if ('_buttonStyle' in $$props) $$invalidate(1, _buttonStyle = $$props._buttonStyle);
4027
4164
  if ('_style' in $$props) $$invalidate(2, _style = $$props._style);
4028
4165
  };
4029
4166
 
4030
- return [text, _buttonStyle, _style, click, onClick, eventName];
4167
+ $$self.$$.update = () => {
4168
+ if ($$self.$$.dirty & /*onClick, $valuesAreValid*/ 320) {
4169
+ $$invalidate(3, disabled = (() => {
4170
+ let isEnabled = true;
4171
+
4172
+ if (onClick.operation === 'submitForm') {
4173
+ isEnabled = $valuesAreValid;
4174
+ } else if (onClick.operation === 'nextForm') {
4175
+ isEnabled = $valuesAreValid;
4176
+ }
4177
+
4178
+ return !isEnabled;
4179
+ })());
4180
+ }
4181
+ };
4182
+
4183
+ return [
4184
+ text,
4185
+ _buttonStyle,
4186
+ _style,
4187
+ disabled,
4188
+ click,
4189
+ valuesAreValid,
4190
+ onClick,
4191
+ eventName,
4192
+ $valuesAreValid
4193
+ ];
4031
4194
  }
4032
4195
 
4033
4196
  class TextButtonElement extends SvelteComponent {
@@ -4037,13 +4200,13 @@ class TextButtonElement extends SvelteComponent {
4037
4200
  init(
4038
4201
  this,
4039
4202
  options,
4040
- instance$g,
4041
- create_fragment$g,
4203
+ instance$f,
4204
+ create_fragment$f,
4042
4205
  safe_not_equal,
4043
4206
  {
4044
4207
  text: 0,
4045
- onClick: 4,
4046
- eventName: 5,
4208
+ onClick: 6,
4209
+ eventName: 7,
4047
4210
  _buttonStyle: 1,
4048
4211
  _style: 2
4049
4212
  },
@@ -4058,7 +4221,7 @@ function add_css$e(target) {
4058
4221
  append_styles(target, "svelte-t8kpqw", ".image-element.svelte-t8kpqw{display:flex;position:relative;width:100%;height:100%;max-width:100%;max-height:100%;justify-content:center;align-items:center;white-space:nowrap;box-sizing:border-box;overflow:hidden}.image.svelte-t8kpqw{width:100%;height:100%}.transport.svelte-t8kpqw:hover,.transport.svelte-t8kpqw:focus{opacity:0.75;box-shadow:0 5px 16px rgba(0, 0, 0, 0.1), 0 8px 28px rgba(0, 0, 0, 0.16)}");
4059
4222
  }
4060
4223
 
4061
- function create_fragment$f(ctx) {
4224
+ function create_fragment$e(ctx) {
4062
4225
  let div;
4063
4226
  let img;
4064
4227
  let img_src_value;
@@ -4120,7 +4283,7 @@ function create_fragment$f(ctx) {
4120
4283
  };
4121
4284
  }
4122
4285
 
4123
- function instance$f($$self, $$props, $$invalidate) {
4286
+ function instance$e($$self, $$props, $$invalidate) {
4124
4287
  let { src = 'https://admin.karte.io/action-editor2/public/images/no_image_en.svg' } = $$props;
4125
4288
  let { alt = 'No Image' } = $$props;
4126
4289
  let { transport = false } = $$props;
@@ -4158,8 +4321,8 @@ class ImageElement extends SvelteComponent {
4158
4321
  init(
4159
4322
  this,
4160
4323
  options,
4161
- instance$f,
4162
- create_fragment$f,
4324
+ instance$e,
4325
+ create_fragment$e,
4163
4326
  safe_not_equal,
4164
4327
  {
4165
4328
  src: 0,
@@ -4181,7 +4344,7 @@ function add_css$d(target) {
4181
4344
  append_styles(target, "svelte-dfqtyx", ".list.svelte-dfqtyx{display:flex;width:100%;height:100%;overflow:hidden}");
4182
4345
  }
4183
4346
 
4184
- function create_fragment$e(ctx) {
4347
+ function create_fragment$d(ctx) {
4185
4348
  let div;
4186
4349
  let current;
4187
4350
  const default_slot_template = /*#slots*/ ctx[6].default;
@@ -4241,7 +4404,7 @@ function create_fragment$e(ctx) {
4241
4404
 
4242
4405
  const LIST_CONTEXT_KEY = Symbol();
4243
4406
 
4244
- function instance$e($$self, $$props, $$invalidate) {
4407
+ function instance$d($$self, $$props, $$invalidate) {
4245
4408
  let style;
4246
4409
  let { $$slots: slots = {}, $$scope } = $$props;
4247
4410
  let { direction = 'vertical' } = $$props;
@@ -4308,8 +4471,8 @@ class List extends SvelteComponent {
4308
4471
  init(
4309
4472
  this,
4310
4473
  options,
4311
- instance$e,
4312
- create_fragment$e,
4474
+ instance$d,
4475
+ create_fragment$d,
4313
4476
  safe_not_equal,
4314
4477
  {
4315
4478
  direction: 1,
@@ -4328,7 +4491,7 @@ function add_css$c(target) {
4328
4491
  append_styles(target, "svelte-h5j4xe", ".list-item.svelte-h5j4xe{flex:auto;box-sizing:border-box;min-width:0;min-height:0;position:relative}.list-item-inner.svelte-h5j4xe{position:absolute;inset:0}");
4329
4492
  }
4330
4493
 
4331
- function create_fragment$d(ctx) {
4494
+ function create_fragment$c(ctx) {
4332
4495
  let div1;
4333
4496
  let div0;
4334
4497
  let current;
@@ -4409,7 +4572,7 @@ function create_fragment$d(ctx) {
4409
4572
  };
4410
4573
  }
4411
4574
 
4412
- function instance$d($$self, $$props, $$invalidate) {
4575
+ function instance$c($$self, $$props, $$invalidate) {
4413
4576
  let click;
4414
4577
  let listItemStyle;
4415
4578
  let { $$slots: slots = {}, $$scope } = $$props;
@@ -4499,7 +4662,7 @@ function instance$d($$self, $$props, $$invalidate) {
4499
4662
  class ListItem extends SvelteComponent {
4500
4663
  constructor(options) {
4501
4664
  super();
4502
- init(this, options, instance$d, create_fragment$d, safe_not_equal, { onClick: 3, clickEventName: 4, _style: 0 }, add_css$c);
4665
+ init(this, options, instance$c, create_fragment$c, safe_not_equal, { onClick: 3, clickEventName: 4, _style: 0 }, add_css$c);
4503
4666
  }
4504
4667
  }
4505
4668
 
@@ -4509,7 +4672,7 @@ function add_css$b(target) {
4509
4672
  append_styles(target, "svelte-17rkg8u", ".embed.svelte-17rkg8u{box-shadow:0 1px rgba(0, 0, 0, 0.06);overflow:hidden;width:100%;height:100%}.embed.svelte-17rkg8u iframe{position:absolute;top:0;left:0;width:100%;height:100%}");
4510
4673
  }
4511
4674
 
4512
- function create_fragment$c(ctx) {
4675
+ function create_fragment$b(ctx) {
4513
4676
  let div;
4514
4677
 
4515
4678
  return {
@@ -4536,7 +4699,7 @@ function create_fragment$c(ctx) {
4536
4699
  };
4537
4700
  }
4538
4701
 
4539
- function instance$c($$self, $$props, $$invalidate) {
4702
+ function instance$b($$self, $$props, $$invalidate) {
4540
4703
  let { code } = $$props;
4541
4704
  let { _style = "" } = $$props;
4542
4705
 
@@ -4551,7 +4714,7 @@ function instance$c($$self, $$props, $$invalidate) {
4551
4714
  class EmbedElement extends SvelteComponent {
4552
4715
  constructor(options) {
4553
4716
  super();
4554
- init(this, options, instance$c, create_fragment$c, safe_not_equal, { code: 0, _style: 1 }, add_css$b);
4717
+ init(this, options, instance$b, create_fragment$b, safe_not_equal, { code: 0, _style: 1 }, add_css$b);
4555
4718
  }
4556
4719
  }
4557
4720
 
@@ -4561,7 +4724,7 @@ function add_css$a(target) {
4561
4724
  append_styles(target, "svelte-17rkg8u", ".embed.svelte-17rkg8u{box-shadow:0 1px rgba(0, 0, 0, 0.06);overflow:hidden;width:100%;height:100%}.embed.svelte-17rkg8u iframe{position:absolute;top:0;left:0;width:100%;height:100%}");
4562
4725
  }
4563
4726
 
4564
- function create_fragment$b(ctx) {
4727
+ function create_fragment$a(ctx) {
4565
4728
  let div1;
4566
4729
  let div0;
4567
4730
 
@@ -4592,7 +4755,7 @@ function create_fragment$b(ctx) {
4592
4755
  };
4593
4756
  }
4594
4757
 
4595
- function instance$b($$self, $$props, $$invalidate) {
4758
+ function instance$a($$self, $$props, $$invalidate) {
4596
4759
  let $system;
4597
4760
  component_subscribe($$self, system, $$value => $$invalidate(12, $system = $$value));
4598
4761
  let { videoId = "sSgN-L4DU0c" } = $$props;
@@ -4771,8 +4934,8 @@ class MovieYouTubeElement extends SvelteComponent {
4771
4934
  init(
4772
4935
  this,
4773
4936
  options,
4774
- instance$b,
4775
- create_fragment$b,
4937
+ instance$a,
4938
+ create_fragment$a,
4776
4939
  safe_not_equal,
4777
4940
  {
4778
4941
  videoId: 2,
@@ -4793,7 +4956,7 @@ function add_css$9(target) {
4793
4956
  append_styles(target, "svelte-17rkg8u", ".embed.svelte-17rkg8u{box-shadow:0 1px rgba(0, 0, 0, 0.06);overflow:hidden;width:100%;height:100%}.embed.svelte-17rkg8u iframe{position:absolute;top:0;left:0;width:100%;height:100%}");
4794
4957
  }
4795
4958
 
4796
- function create_fragment$a(ctx) {
4959
+ function create_fragment$9(ctx) {
4797
4960
  let div1;
4798
4961
  let div0;
4799
4962
 
@@ -4824,7 +4987,7 @@ function create_fragment$a(ctx) {
4824
4987
  };
4825
4988
  }
4826
4989
 
4827
- function instance$a($$self, $$props, $$invalidate) {
4990
+ function instance$9($$self, $$props, $$invalidate) {
4828
4991
  let $system;
4829
4992
  component_subscribe($$self, system, $$value => $$invalidate(12, $system = $$value));
4830
4993
  let { videoId = "201239468" } = $$props;
@@ -4967,8 +5130,8 @@ class MovieVimeoElement extends SvelteComponent {
4967
5130
  init(
4968
5131
  this,
4969
5132
  options,
4970
- instance$a,
4971
- create_fragment$a,
5133
+ instance$9,
5134
+ create_fragment$9,
4972
5135
  safe_not_equal,
4973
5136
  {
4974
5137
  videoId: 2,
@@ -4983,107 +5146,13 @@ class MovieVimeoElement extends SvelteComponent {
4983
5146
  }
4984
5147
  }
4985
5148
 
4986
- /** @internal */
4987
- function registerInput({ name, statePath, validator = () => true, initialValue, }) {
4988
- const writableValue = {
4989
- subscribe(run) {
4990
- return formData.subscribe(formData => {
4991
- run(formData[name]?.value);
4992
- });
4993
- },
4994
- set(value) {
4995
- formData.update(prev => ({
4996
- ...prev,
4997
- [name]: {
4998
- statePath,
4999
- value,
5000
- isValid: validator(value),
5001
- },
5002
- }));
5003
- },
5004
- update(updater) {
5005
- formData.update(prev => {
5006
- const prevValue = prev[name]?.value;
5007
- return {
5008
- ...prev,
5009
- [name]: {
5010
- statePath,
5011
- value: updater(prevValue),
5012
- isValid: validator(prevValue),
5013
- },
5014
- };
5015
- });
5016
- },
5017
- };
5018
- writableValue.set(initialValue);
5019
- return writableValue;
5020
- }
5021
- /** @internal */
5022
- function deleteValues(statePath) {
5023
- formData.update(prev => {
5024
- const targetNames = Object.entries(prev)
5025
- .filter(([_, { statePath: s }]) => s === statePath) // eslint-disable-line @typescript-eslint/no-unused-vars
5026
- .map(([name]) => name);
5027
- targetNames.forEach(name => {
5028
- delete prev[name];
5029
- });
5030
- return { ...prev };
5031
- });
5032
- }
5033
- /** @internal */
5034
- const getValuesAreValidReader = statePath => ({
5035
- subscribe(callback) {
5036
- return formData.subscribe(formData => {
5037
- const valuesAreValid = Object.entries(formData)
5038
- .filter(([_, { statePath: s }]) => s === statePath) // eslint-disable-line @typescript-eslint/no-unused-vars
5039
- .every(([_, { isValid }]) => isValid); // eslint-disable-line @typescript-eslint/no-unused-vars
5040
- callback(valuesAreValid);
5041
- });
5042
- },
5043
- });
5044
- function formDataToEventValues(campaignId, formData) {
5045
- const questions = [];
5046
- const answersMap = {};
5047
- Object.entries(formData).forEach(([name, dataItem]) => {
5048
- questions.push(name);
5049
- const value = dataItem.value;
5050
- const answerKey = `question_${name}`;
5051
- if (Array.isArray(value)) {
5052
- answersMap[answerKey] = {
5053
- choices: value,
5054
- };
5055
- }
5056
- else if (typeof value === 'string') {
5057
- answersMap[answerKey] = {
5058
- free_answer: value,
5059
- };
5060
- }
5061
- });
5062
- return {
5063
- [campaignId]: {
5064
- questions,
5065
- ...answersMap,
5066
- },
5067
- };
5068
- }
5069
- /** @internal */
5070
- function submit() {
5071
- const systemConfig = getSystem();
5072
- const campaignId = systemConfig.campaignId;
5073
- if (campaignId) {
5074
- const formData$1 = get(formData);
5075
- const values = formDataToEventValues(campaignId, formData$1);
5076
- send_event('_answer_question', values);
5077
- }
5078
- }
5079
-
5080
5149
  /* src/components/FormTextarea.svelte generated by Svelte v3.53.1 */
5081
5150
 
5082
5151
  function add_css$8(target) {
5083
5152
  append_styles(target, "svelte-kyay3k", ".textarea-wrapper.svelte-kyay3k{display:flex;align-items:center;width:100%;height:100%}.textarea.svelte-kyay3k{width:100%;resize:none}");
5084
5153
  }
5085
5154
 
5086
- function create_fragment$9(ctx) {
5155
+ function create_fragment$8(ctx) {
5087
5156
  let div;
5088
5157
  let textarea;
5089
5158
  let mounted;
@@ -5136,7 +5205,7 @@ function create_fragment$9(ctx) {
5136
5205
  };
5137
5206
  }
5138
5207
 
5139
- function instance$9($$self, $$props, $$invalidate) {
5208
+ function instance$8($$self, $$props, $$invalidate) {
5140
5209
  let $value;
5141
5210
  let { name = '' } = $$props;
5142
5211
  let { required = true } = $$props;
@@ -5177,8 +5246,8 @@ class FormTextarea extends SvelteComponent {
5177
5246
  init(
5178
5247
  this,
5179
5248
  options,
5180
- instance$9,
5181
- create_fragment$9,
5249
+ instance$8,
5250
+ create_fragment$8,
5182
5251
  safe_not_equal,
5183
5252
  {
5184
5253
  name: 6,
@@ -5191,114 +5260,6 @@ class FormTextarea extends SvelteComponent {
5191
5260
  }
5192
5261
  }
5193
5262
 
5194
- /* src/components/FormButton.svelte generated by Svelte v3.53.1 */
5195
-
5196
- function create_fragment$8(ctx) {
5197
- let input;
5198
- let mounted;
5199
- let dispose;
5200
-
5201
- return {
5202
- c() {
5203
- input = element("input");
5204
- attr(input, "type", "button");
5205
- set_style(input, "width", "100%");
5206
- set_style(input, "height", "100%");
5207
- input.value = /*text*/ ctx[0];
5208
- input.disabled = /*disabled*/ ctx[1];
5209
- },
5210
- m(target, anchor) {
5211
- insert(target, input, anchor);
5212
-
5213
- if (!mounted) {
5214
- dispose = listen(input, "click", /*handleClick*/ ctx[2]);
5215
- mounted = true;
5216
- }
5217
- },
5218
- p(ctx, [dirty]) {
5219
- if (dirty & /*text*/ 1) {
5220
- input.value = /*text*/ ctx[0];
5221
- }
5222
-
5223
- if (dirty & /*disabled*/ 2) {
5224
- input.disabled = /*disabled*/ ctx[1];
5225
- }
5226
- },
5227
- i: noop,
5228
- o: noop,
5229
- d(detaching) {
5230
- if (detaching) detach(input);
5231
- mounted = false;
5232
- dispose();
5233
- }
5234
- };
5235
- }
5236
-
5237
- function instance$8($$self, $$props, $$invalidate) {
5238
- let disabled;
5239
- let $valuesAreValid;
5240
- let { text = '' } = $$props;
5241
- let { onClick = { operation: 'submit', args: ['/'] } } = $$props;
5242
- const { path: statePath } = getStateItemContext();
5243
-
5244
- function handleClick() {
5245
- switch (onClick.operation) {
5246
- case 'submit':
5247
- {
5248
- if ($valuesAreValid) {
5249
- submit();
5250
- const stateId = onClick.args[0];
5251
- setState$1(stateId);
5252
- }
5253
-
5254
- break;
5255
- }
5256
- case 'next':
5257
- {
5258
- if ($valuesAreValid) {
5259
- const stateId = onClick.args[0];
5260
- setState$1(stateId);
5261
- }
5262
-
5263
- break;
5264
- }
5265
- case 'prev':
5266
- {
5267
- deleteValues(statePath);
5268
- const stateId = onClick.args[0];
5269
- setState$1(stateId);
5270
- break;
5271
- }
5272
- }
5273
- }
5274
-
5275
- const valuesAreValid = getValuesAreValidReader(statePath);
5276
- component_subscribe($$self, valuesAreValid, value => $$invalidate(5, $valuesAreValid = value));
5277
-
5278
- $$self.$$set = $$props => {
5279
- if ('text' in $$props) $$invalidate(0, text = $$props.text);
5280
- if ('onClick' in $$props) $$invalidate(4, onClick = $$props.onClick);
5281
- };
5282
-
5283
- $$self.$$.update = () => {
5284
- if ($$self.$$.dirty & /*onClick, $valuesAreValid*/ 48) {
5285
- $$invalidate(1, disabled = (() => {
5286
- const enabled = onClick.operation === 'prev' || $valuesAreValid;
5287
- return !enabled;
5288
- })());
5289
- }
5290
- };
5291
-
5292
- return [text, disabled, handleClick, valuesAreValid, onClick, $valuesAreValid];
5293
- }
5294
-
5295
- class FormButton extends SvelteComponent {
5296
- constructor(options) {
5297
- super();
5298
- init(this, options, instance$8, create_fragment$8, safe_not_equal, { text: 0, onClick: 4 });
5299
- }
5300
- }
5301
-
5302
5263
  /* src/components/FormRadioButtons.svelte generated by Svelte v3.53.1 */
5303
5264
 
5304
5265
  function add_css$7(target) {
@@ -5307,17 +5268,19 @@ function add_css$7(target) {
5307
5268
 
5308
5269
  function get_each_context$3(ctx, list, i) {
5309
5270
  const child_ctx = ctx.slice();
5310
- child_ctx[7] = list[i];
5311
- child_ctx[9] = i;
5271
+ child_ctx[8] = list[i];
5272
+ child_ctx[10] = i;
5312
5273
  return child_ctx;
5313
5274
  }
5314
5275
 
5315
- // (23:2) {#each _options as option, i}
5276
+ // (24:2) {#each _options as option, i}
5316
5277
  function create_each_block$3(ctx) {
5317
5278
  let label;
5318
5279
  let input;
5280
+ let input_value_value;
5281
+ let input_checked_value;
5319
5282
  let t0;
5320
- let t1_value = /*option*/ ctx[7] + "";
5283
+ let t1_value = /*option*/ ctx[8] + "";
5321
5284
  let t1;
5322
5285
  let t2;
5323
5286
  let mounted;
@@ -5332,7 +5295,8 @@ function create_each_block$3(ctx) {
5332
5295
  t2 = space();
5333
5296
  attr(input, "type", "radio");
5334
5297
  attr(input, "name", /*name*/ ctx[0]);
5335
- input.value = /*$value*/ ctx[2];
5298
+ input.value = input_value_value = /*option*/ ctx[8];
5299
+ input.checked = input_checked_value = /*option*/ ctx[8] === /*_value*/ ctx[1];
5336
5300
  },
5337
5301
  m(target, anchor) {
5338
5302
  insert(target, label, anchor);
@@ -5342,7 +5306,7 @@ function create_each_block$3(ctx) {
5342
5306
  append(label, t2);
5343
5307
 
5344
5308
  if (!mounted) {
5345
- dispose = listen(input, "change", /*handleChange*/ ctx[4](/*i*/ ctx[9]));
5309
+ dispose = listen(input, "change", /*handleChange*/ ctx[4](/*i*/ ctx[10]));
5346
5310
  mounted = true;
5347
5311
  }
5348
5312
  },
@@ -5353,11 +5317,15 @@ function create_each_block$3(ctx) {
5353
5317
  attr(input, "name", /*name*/ ctx[0]);
5354
5318
  }
5355
5319
 
5356
- if (dirty & /*$value*/ 4) {
5357
- input.value = /*$value*/ ctx[2];
5320
+ if (dirty & /*_options*/ 4 && input_value_value !== (input_value_value = /*option*/ ctx[8])) {
5321
+ input.value = input_value_value;
5322
+ }
5323
+
5324
+ if (dirty & /*_options, _value*/ 6 && input_checked_value !== (input_checked_value = /*option*/ ctx[8] === /*_value*/ ctx[1])) {
5325
+ input.checked = input_checked_value;
5358
5326
  }
5359
5327
 
5360
- if (dirty & /*_options*/ 2 && t1_value !== (t1_value = /*option*/ ctx[7] + "")) set_data(t1, t1_value);
5328
+ if (dirty & /*_options*/ 4 && t1_value !== (t1_value = /*option*/ ctx[8] + "")) set_data(t1, t1_value);
5361
5329
  },
5362
5330
  d(detaching) {
5363
5331
  if (detaching) detach(label);
@@ -5369,7 +5337,7 @@ function create_each_block$3(ctx) {
5369
5337
 
5370
5338
  function create_fragment$7(ctx) {
5371
5339
  let div;
5372
- let each_value = /*_options*/ ctx[1];
5340
+ let each_value = /*_options*/ ctx[2];
5373
5341
  let each_blocks = [];
5374
5342
 
5375
5343
  for (let i = 0; i < each_value.length; i += 1) {
@@ -5394,8 +5362,8 @@ function create_fragment$7(ctx) {
5394
5362
  }
5395
5363
  },
5396
5364
  p(ctx, [dirty]) {
5397
- if (dirty & /*_options, name, $value, handleChange*/ 23) {
5398
- each_value = /*_options*/ ctx[1];
5365
+ if (dirty & /*_options, name, _value, handleChange*/ 23) {
5366
+ each_value = /*_options*/ ctx[2];
5399
5367
  let i;
5400
5368
 
5401
5369
  for (i = 0; i < each_value.length; i += 1) {
@@ -5428,6 +5396,7 @@ function create_fragment$7(ctx) {
5428
5396
 
5429
5397
  function instance$7($$self, $$props, $$invalidate) {
5430
5398
  let _options;
5399
+ let _value;
5431
5400
  let $value;
5432
5401
  let { name = '' } = $$props;
5433
5402
  let { options = 'ラジオボタン1,ラジオボタン2,ラジオボタン3' } = $$props;
@@ -5442,7 +5411,7 @@ function instance$7($$self, $$props, $$invalidate) {
5442
5411
  }
5443
5412
  });
5444
5413
 
5445
- component_subscribe($$self, value, value => $$invalidate(2, $value = value));
5414
+ component_subscribe($$self, value, value => $$invalidate(6, $value = value));
5446
5415
 
5447
5416
  const handleChange = index => event => {
5448
5417
  if (event.target.checked) {
@@ -5457,11 +5426,15 @@ function instance$7($$self, $$props, $$invalidate) {
5457
5426
 
5458
5427
  $$self.$$.update = () => {
5459
5428
  if ($$self.$$.dirty & /*options*/ 32) {
5460
- $$invalidate(1, _options = options.split(','));
5429
+ $$invalidate(2, _options = options.split(','));
5430
+ }
5431
+
5432
+ if ($$self.$$.dirty & /*$value*/ 64) {
5433
+ $$invalidate(1, _value = $value[0]);
5461
5434
  }
5462
5435
  };
5463
5436
 
5464
- return [name, _options, $value, value, handleChange, options];
5437
+ return [name, _value, _options, value, handleChange, options, $value];
5465
5438
  }
5466
5439
 
5467
5440
  class FormRadioButtons extends SvelteComponent {
@@ -5704,6 +5677,7 @@ function get_each_context$1(ctx, list, i) {
5704
5677
  function create_each_block$1(ctx) {
5705
5678
  let label;
5706
5679
  let input;
5680
+ let input_checked_value;
5707
5681
  let t0;
5708
5682
  let t1_value = /*option*/ ctx[8] + "";
5709
5683
  let t1;
@@ -5720,7 +5694,7 @@ function create_each_block$1(ctx) {
5720
5694
  t2 = space();
5721
5695
  attr(input, "type", "checkbox");
5722
5696
  attr(input, "name", /*name*/ ctx[0]);
5723
- input.value = /*$value*/ ctx[2];
5697
+ input.checked = input_checked_value = /*isCheckedArray*/ ctx[2][/*i*/ ctx[10]];
5724
5698
  },
5725
5699
  m(target, anchor) {
5726
5700
  insert(target, label, anchor);
@@ -5741,8 +5715,8 @@ function create_each_block$1(ctx) {
5741
5715
  attr(input, "name", /*name*/ ctx[0]);
5742
5716
  }
5743
5717
 
5744
- if (dirty & /*$value*/ 4) {
5745
- input.value = /*$value*/ ctx[2];
5718
+ if (dirty & /*isCheckedArray*/ 4 && input_checked_value !== (input_checked_value = /*isCheckedArray*/ ctx[2][/*i*/ ctx[10]])) {
5719
+ input.checked = input_checked_value;
5746
5720
  }
5747
5721
 
5748
5722
  if (dirty & /*_options*/ 2 && t1_value !== (t1_value = /*option*/ ctx[8] + "")) set_data(t1, t1_value);
@@ -5782,7 +5756,7 @@ function create_fragment$5(ctx) {
5782
5756
  }
5783
5757
  },
5784
5758
  p(ctx, [dirty]) {
5785
- if (dirty & /*_options, name, $value, handleChange*/ 23) {
5759
+ if (dirty & /*_options, name, isCheckedArray, handleChange*/ 23) {
5786
5760
  each_value = /*_options*/ ctx[1];
5787
5761
  let i;
5788
5762
 
@@ -5831,12 +5805,12 @@ function instance$5($$self, $$props, $$invalidate) {
5831
5805
  }
5832
5806
  });
5833
5807
 
5834
- component_subscribe($$self, value, value => $$invalidate(2, $value = value));
5808
+ component_subscribe($$self, value, value => $$invalidate(6, $value = value));
5835
5809
 
5836
5810
  const handleChange = index => event => {
5837
5811
  if (isCheckedArray[index] !== event.target.checked) {
5838
- isCheckedArray[index] = event.target.checked;
5839
- isCheckedArray = [...isCheckedArray];
5812
+ $$invalidate(2, isCheckedArray[index] = event.target.checked, isCheckedArray);
5813
+ $$invalidate(2, isCheckedArray = [...isCheckedArray]);
5840
5814
  const updated = _options.filter((option, i) => isCheckedArray[i]);
5841
5815
  value.set(updated);
5842
5816
  }
@@ -5852,15 +5826,15 @@ function instance$5($$self, $$props, $$invalidate) {
5852
5826
  $$invalidate(1, _options = options.split(','));
5853
5827
  }
5854
5828
 
5855
- if ($$self.$$.dirty & /*$value, _options*/ 6) {
5856
- isCheckedArray = (() => {
5829
+ if ($$self.$$.dirty & /*$value, _options*/ 66) {
5830
+ $$invalidate(2, isCheckedArray = (() => {
5857
5831
  const checkedSet = new Set($value);
5858
5832
  return _options.map(option => checkedSet.has(option));
5859
- })();
5833
+ })());
5860
5834
  }
5861
5835
  };
5862
5836
 
5863
- return [name, _options, $value, value, handleChange, options];
5837
+ return [name, _options, isCheckedArray, value, handleChange, options, $value];
5864
5838
  }
5865
5839
 
5866
5840
  class FormCheckBoxes extends SvelteComponent {
@@ -7096,4 +7070,4 @@ class ImageBlock extends SvelteComponent {
7096
7070
  }
7097
7071
  }
7098
7072
 
7099
- export { Alignments, AnimationStyles, BackgroundSizes, ClipPaths, Cursors, DefaultListBackground, DefaultListBackgroundNone, DefaultListBackgroundStripe, DefaultListSeparator, DefaultListSeparatorBorder, DefaultListSeparatorGap, DefaultListSeparatorNone, DefaultModalPlacement, DefaultSlideButton, DefaultSlideNavigationButton, Directions, Elasticities, ElasticityStyle, EmbedElement, Flex, FlexItem, FormButton, FormCheckBoxes, FormOperationOptions, FormRadioButtons, FormSelect, FormTextarea, Grid, GridItem, GridModalState, ImageBlock, ImageElement, Justifies, KARTE_MODAL_ROOT, LengthUnits, List, ListBackgroundTypes, ListDirections, ListItem, ListSeparatorTypes, MediaQueries, Modal, ModalPositions, MovieVimeoElement, MovieYouTubeElement, ObjectFits, OnClickOperationOptions, Overflows, PropTypes, Repeats, Slide, SlideItem, State, StateItem, TextBlock, TextButtonBlock, TextButtonElement, TextDirections, TextElement, WritingModes, applyCss, applyGlobalCss, close, closeAction, closed, collection$1 as collection, create, createApp, createFog, customHandlers, customVariables, destroy, destroyed, ensureModalRoot, finalize, formData, getActionShadowRoot, getCustomHandlers, getCustomVariables, getState$1 as getState, getStates, getStoreState, getSystem, hideOnScroll, hideOnTime, initialize, isClosed, isOpened, loadGlobalScript, loadGlobalStyle, loadStyle, onChangeState, onClose, onCreate, onDestroy, onScroll, onShow, onTime, opened, setActionSetting, setAutoStart, setClosed, setCustomHandlers, setCustomVariables, setState$1 as setState, show, showAction, showModal, showOnScroll, showOnTime, state, stopped, updateCustomHandlers, updateCustomVariables, widget };
7073
+ export { Alignments, AnimationStyles, BackgroundSizes, ClipPaths, Cursors, DefaultListBackground, DefaultListBackgroundNone, DefaultListBackgroundStripe, DefaultListSeparator, DefaultListSeparatorBorder, DefaultListSeparatorGap, DefaultListSeparatorNone, DefaultModalPlacement, DefaultSlideButton, DefaultSlideNavigationButton, Directions, Elasticities, ElasticityStyle, EmbedElement, Flex, FlexItem, FormCheckBoxes, FormRadioButtons, FormSelect, FormTextarea, Grid, GridItem, GridModalState, ImageBlock, ImageElement, Justifies, KARTE_MODAL_ROOT, LengthUnits, List, ListBackgroundTypes, ListDirections, ListItem, ListSeparatorTypes, MediaQueries, Modal, ModalPositions, MovieVimeoElement, MovieYouTubeElement, ObjectFits, OnClickOperationOptions, Overflows, PropTypes, Repeats, Slide, SlideItem, State, StateItem, TextBlock, TextButtonBlock, TextButtonElement, TextDirections, TextElement, WritingModes, applyCss, applyGlobalCss, close, closeAction, closed, collection$1 as collection, create, createApp, createFog, customHandlers, customVariables, destroy, destroyed, ensureModalRoot, finalize, formData, getActionShadowRoot, getCustomHandlers, getCustomVariables, getState$1 as getState, getStates, getStoreState, getSystem, hideOnScroll, hideOnTime, initialize, isClosed, isOpened, loadGlobalScript, loadGlobalStyle, loadStyle, onChangeState, onClose, onCreate, onDestroy, onScroll, onShow, onTime, opened, setActionSetting, setAutoStart, setClosed, setCustomHandlers, setCustomVariables, setState$1 as setState, show, showAction, showModal, showOnScroll, showOnTime, state, stopped, updateCustomHandlers, updateCustomVariables, widget };