@plaidev/karte-action-sdk 1.1.119 → 1.1.120-27930660.06640d93

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.es.js CHANGED
@@ -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',
@@ -2050,14 +2167,14 @@ var widget = /*#__PURE__*/Object.freeze({
2050
2167
 
2051
2168
  /* src/components/Normalize.svelte generated by Svelte v3.53.1 */
2052
2169
 
2053
- function add_css$n(target) {
2170
+ function add_css$o(target) {
2054
2171
  append_styles(target, "svelte-tr4qnr", "@import 'https://esm.sh/normalize.css';");
2055
2172
  }
2056
2173
 
2057
2174
  class Normalize extends SvelteComponent {
2058
2175
  constructor(options) {
2059
2176
  super();
2060
- init(this, options, null, null, safe_not_equal, {}, add_css$n);
2177
+ init(this, options, null, null, safe_not_equal, {}, add_css$o);
2061
2178
  }
2062
2179
  }
2063
2180
 
@@ -2141,12 +2258,12 @@ class State extends SvelteComponent {
2141
2258
 
2142
2259
  /* src/components/StateItem.svelte generated by Svelte v3.53.1 */
2143
2260
 
2144
- function add_css$m(target) {
2261
+ function add_css$n(target) {
2145
2262
  append_styles(target, "svelte-2qb6dm", ".state-item.svelte-2qb6dm{position:absolute;display:none}");
2146
2263
  }
2147
2264
 
2148
2265
  // (23:0) {#if $state === path}
2149
- function create_if_block$5(ctx) {
2266
+ function create_if_block$7(ctx) {
2150
2267
  let div;
2151
2268
  let t;
2152
2269
  let current;
@@ -2211,7 +2328,7 @@ function create_if_block$5(ctx) {
2211
2328
  function create_fragment$q(ctx) {
2212
2329
  let if_block_anchor;
2213
2330
  let current;
2214
- let if_block = /*$state*/ ctx[1] === /*path*/ ctx[0] && create_if_block$5(ctx);
2331
+ let if_block = /*$state*/ ctx[1] === /*path*/ ctx[0] && create_if_block$7(ctx);
2215
2332
 
2216
2333
  return {
2217
2334
  c() {
@@ -2232,7 +2349,7 @@ function create_fragment$q(ctx) {
2232
2349
  transition_in(if_block, 1);
2233
2350
  }
2234
2351
  } else {
2235
- if_block = create_if_block$5(ctx);
2352
+ if_block = create_if_block$7(ctx);
2236
2353
  if_block.c();
2237
2354
  transition_in(if_block, 1);
2238
2355
  if_block.m(if_block_anchor.parentNode, if_block_anchor);
@@ -2295,18 +2412,18 @@ 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$q, create_fragment$q, safe_not_equal, { path: 0 }, add_css$n);
2299
2416
  }
2300
2417
  }
2301
2418
 
2302
2419
  /* src/components/BackgroundOverray.svelte generated by Svelte v3.53.1 */
2303
2420
 
2304
- function add_css$l(target) {
2421
+ function add_css$m(target) {
2305
2422
  append_styles(target, "svelte-1d4fta", ".background.svelte-1d4fta{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.3);z-index:2147483646}");
2306
2423
  }
2307
2424
 
2308
2425
  // (9:0) {#if backgroundOverray}
2309
- function create_if_block$4(ctx) {
2426
+ function create_if_block$6(ctx) {
2310
2427
  let div;
2311
2428
  let mounted;
2312
2429
  let dispose;
@@ -2335,7 +2452,7 @@ function create_if_block$4(ctx) {
2335
2452
 
2336
2453
  function create_fragment$p(ctx) {
2337
2454
  let if_block_anchor;
2338
- let if_block = /*backgroundOverray*/ ctx[0] && create_if_block$4(ctx);
2455
+ let if_block = /*backgroundOverray*/ ctx[0] && create_if_block$6(ctx);
2339
2456
 
2340
2457
  return {
2341
2458
  c() {
@@ -2351,7 +2468,7 @@ function create_fragment$p(ctx) {
2351
2468
  if (if_block) {
2352
2469
  if_block.p(ctx, dirty);
2353
2470
  } else {
2354
- if_block = create_if_block$4(ctx);
2471
+ if_block = create_if_block$6(ctx);
2355
2472
  if_block.c();
2356
2473
  if_block.m(if_block_anchor.parentNode, if_block_anchor);
2357
2474
  }
@@ -2384,18 +2501,18 @@ 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$p, create_fragment$p, safe_not_equal, { backgroundOverray: 0 }, add_css$m);
2388
2505
  }
2389
2506
  }
2390
2507
 
2391
2508
  /* src/components/Modal.svelte generated by Svelte v3.53.1 */
2392
2509
 
2393
- function add_css$k(target) {
2510
+ function add_css$l(target) {
2394
2511
  append_styles(target, "svelte-12dkw0q", ".modal.svelte-12dkw0q{position:fixed;box-sizing:border-box;z-index:2147483647}.close.svelte-12dkw0q{position:absolute;display:flex;justify-content:center;align-items:center;background-color:transparent;border:none;cursor:pointer;padding:0;transition:all 0.25s}.close.svelte-12dkw0q:hover{transform:rotate(90deg)}.modal-content.svelte-12dkw0q{display:flex;justify-content:center;align-items:center}");
2395
2512
  }
2396
2513
 
2397
2514
  // (142:0) {#if visible}
2398
- function create_if_block$3(ctx) {
2515
+ function create_if_block$5(ctx) {
2399
2516
  let div1;
2400
2517
  let t;
2401
2518
  let div0;
@@ -2404,7 +2521,7 @@ function create_if_block$3(ctx) {
2404
2521
  let current;
2405
2522
  let mounted;
2406
2523
  let dispose;
2407
- let if_block = /*closable*/ ctx[14] && create_if_block_1$1(ctx);
2524
+ let if_block = /*closable*/ ctx[14] && create_if_block_1$2(ctx);
2408
2525
  const default_slot_template = /*#slots*/ ctx[29].default;
2409
2526
  const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[28], null);
2410
2527
 
@@ -2450,7 +2567,7 @@ function create_if_block$3(ctx) {
2450
2567
  if (if_block) {
2451
2568
  if_block.p(ctx, dirty);
2452
2569
  } else {
2453
- if_block = create_if_block_1$1(ctx);
2570
+ if_block = create_if_block_1$2(ctx);
2454
2571
  if_block.c();
2455
2572
  if_block.m(div1, t);
2456
2573
  }
@@ -2515,7 +2632,7 @@ function create_if_block$3(ctx) {
2515
2632
  }
2516
2633
 
2517
2634
  // (159:4) {#if closable}
2518
- function create_if_block_1$1(ctx) {
2635
+ function create_if_block_1$2(ctx) {
2519
2636
  let button;
2520
2637
  let svg;
2521
2638
  let path;
@@ -2589,7 +2706,7 @@ function create_fragment$o(ctx) {
2589
2706
  if (is_function(/*backgroundClick*/ ctx[12])) /*backgroundClick*/ ctx[12].apply(this, arguments);
2590
2707
  });
2591
2708
 
2592
- let if_block = /*visible*/ ctx[6] && create_if_block$3(ctx);
2709
+ let if_block = /*visible*/ ctx[6] && create_if_block$5(ctx);
2593
2710
 
2594
2711
  return {
2595
2712
  c() {
@@ -2627,7 +2744,7 @@ function create_fragment$o(ctx) {
2627
2744
  transition_in(if_block, 1);
2628
2745
  }
2629
2746
  } else {
2630
- if_block = create_if_block$3(ctx);
2747
+ if_block = create_if_block$5(ctx);
2631
2748
  if_block.c();
2632
2749
  transition_in(if_block, 1);
2633
2750
  if_block.m(if_block_anchor.parentNode, if_block_anchor);
@@ -2869,7 +2986,7 @@ class Modal extends SvelteComponent {
2869
2986
  closeButtonColor: 2,
2870
2987
  _closeStyle: 3
2871
2988
  },
2872
- add_css$k
2989
+ add_css$l
2873
2990
  );
2874
2991
  }
2875
2992
  }
@@ -3302,7 +3419,7 @@ class GridModalState extends SvelteComponent {
3302
3419
 
3303
3420
  /* src/components/GridItem.svelte generated by Svelte v3.53.1 */
3304
3421
 
3305
- function add_css$j(target) {
3422
+ function add_css$k(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
 
@@ -3433,14 +3550,14 @@ class GridItem extends SvelteComponent {
3433
3550
  z: 6,
3434
3551
  background: 7
3435
3552
  },
3436
- add_css$j
3553
+ add_css$k
3437
3554
  );
3438
3555
  }
3439
3556
  }
3440
3557
 
3441
3558
  /* src/components/Flex.svelte generated by Svelte v3.53.1 */
3442
3559
 
3443
- function add_css$i(target) {
3560
+ function add_css$j(target) {
3444
3561
  append_styles(target, "svelte-1e71ejc", ".flex.svelte-1e71ejc{display:flex}");
3445
3562
  }
3446
3563
 
@@ -3544,14 +3661,14 @@ class Flex extends SvelteComponent {
3544
3661
  height: 2,
3545
3662
  _style: 3
3546
3663
  },
3547
- add_css$i
3664
+ add_css$j
3548
3665
  );
3549
3666
  }
3550
3667
  }
3551
3668
 
3552
3669
  /* src/components/FlexItem.svelte generated by Svelte v3.53.1 */
3553
3670
 
3554
- function add_css$h(target) {
3671
+ function add_css$i(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
 
@@ -3656,13 +3773,13 @@ 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$j, create_fragment$j, safe_not_equal, { length: 1, _style: 2 }, add_css$i);
3660
3777
  }
3661
3778
  }
3662
3779
 
3663
3780
  /* src/components/RenderText.svelte generated by Svelte v3.53.1 */
3664
3781
 
3665
- function get_each_context$4(ctx, list, i) {
3782
+ function get_each_context$5(ctx, list, i) {
3666
3783
  const child_ctx = ctx.slice();
3667
3784
  child_ctx[2] = list[i];
3668
3785
  return child_ctx;
@@ -3690,7 +3807,7 @@ function create_else_block$1(ctx) {
3690
3807
  }
3691
3808
 
3692
3809
  // (10:2) {#if item.match(regexp)}
3693
- function create_if_block$2(ctx) {
3810
+ function create_if_block$4(ctx) {
3694
3811
  let br;
3695
3812
 
3696
3813
  return {
@@ -3708,14 +3825,14 @@ function create_if_block$2(ctx) {
3708
3825
  }
3709
3826
 
3710
3827
  // (9:0) {#each items as item}
3711
- function create_each_block$4(ctx) {
3828
+ function create_each_block$5(ctx) {
3712
3829
  let show_if;
3713
3830
  let if_block_anchor;
3714
3831
 
3715
3832
  function select_block_type(ctx, dirty) {
3716
3833
  if (dirty & /*items*/ 1) show_if = null;
3717
3834
  if (show_if == null) show_if = !!/*item*/ ctx[2].match(regexp);
3718
- if (show_if) return create_if_block$2;
3835
+ if (show_if) return create_if_block$4;
3719
3836
  return create_else_block$1;
3720
3837
  }
3721
3838
 
@@ -3757,7 +3874,7 @@ function create_fragment$i(ctx) {
3757
3874
  let each_blocks = [];
3758
3875
 
3759
3876
  for (let i = 0; i < each_value.length; i += 1) {
3760
- each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
3877
+ each_blocks[i] = create_each_block$5(get_each_context$5(ctx, each_value, i));
3761
3878
  }
3762
3879
 
3763
3880
  return {
@@ -3781,12 +3898,12 @@ function create_fragment$i(ctx) {
3781
3898
  let i;
3782
3899
 
3783
3900
  for (i = 0; i < each_value.length; i += 1) {
3784
- const child_ctx = get_each_context$4(ctx, each_value, i);
3901
+ const child_ctx = get_each_context$5(ctx, each_value, i);
3785
3902
 
3786
3903
  if (each_blocks[i]) {
3787
3904
  each_blocks[i].p(child_ctx, dirty);
3788
3905
  } else {
3789
- each_blocks[i] = create_each_block$4(child_ctx);
3906
+ each_blocks[i] = create_each_block$5(child_ctx);
3790
3907
  each_blocks[i].c();
3791
3908
  each_blocks[i].m(each_1_anchor.parentNode, each_1_anchor);
3792
3909
  }
@@ -3836,7 +3953,7 @@ class RenderText extends SvelteComponent {
3836
3953
 
3837
3954
  /* src/components/TextElement.svelte generated by Svelte v3.53.1 */
3838
3955
 
3839
- function add_css$g(target) {
3956
+ function add_css$h(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
 
@@ -3931,21 +4048,23 @@ class TextElement extends SvelteComponent {
3931
4048
  textDirection: 1,
3932
4049
  _style: 4
3933
4050
  },
3934
- add_css$g
4051
+ add_css$h
3935
4052
  );
3936
4053
  }
3937
4054
  }
3938
4055
 
3939
4056
  /* src/components/TextButtonElement.svelte generated by Svelte v3.53.1 */
3940
4057
 
3941
- 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)}");
4058
+ function add_css$g(target) {
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
4062
  function create_fragment$g(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
  }
@@ -4004,6 +4136,8 @@ function create_fragment$g(ctx) {
4004
4136
  }
4005
4137
 
4006
4138
  function instance$g($$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 {
@@ -4042,19 +4205,19 @@ class TextButtonElement extends SvelteComponent {
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
  },
4050
- add_css$f
4213
+ add_css$g
4051
4214
  );
4052
4215
  }
4053
4216
  }
4054
4217
 
4055
4218
  /* src/components/ImageElement.svelte generated by Svelte v3.53.1 */
4056
4219
 
4057
- function add_css$e(target) {
4220
+ function add_css$f(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
 
@@ -4170,14 +4333,14 @@ class ImageElement extends SvelteComponent {
4170
4333
  _imageStyle: 3,
4171
4334
  _style: 4
4172
4335
  },
4173
- add_css$e
4336
+ add_css$f
4174
4337
  );
4175
4338
  }
4176
4339
  }
4177
4340
 
4178
4341
  /* src/components/List.svelte generated by Svelte v3.53.1 */
4179
4342
 
4180
- function add_css$d(target) {
4343
+ function add_css$e(target) {
4181
4344
  append_styles(target, "svelte-dfqtyx", ".list.svelte-dfqtyx{display:flex;width:100%;height:100%;overflow:hidden}");
4182
4345
  }
4183
4346
 
@@ -4317,14 +4480,14 @@ class List extends SvelteComponent {
4317
4480
  background: 3,
4318
4481
  _style: 4
4319
4482
  },
4320
- add_css$d
4483
+ add_css$e
4321
4484
  );
4322
4485
  }
4323
4486
  }
4324
4487
 
4325
4488
  /* src/components/ListItem.svelte generated by Svelte v3.53.1 */
4326
4489
 
4327
- function add_css$c(target) {
4490
+ function add_css$d(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
 
@@ -4499,13 +4662,13 @@ 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$d, create_fragment$d, safe_not_equal, { onClick: 3, clickEventName: 4, _style: 0 }, add_css$d);
4503
4666
  }
4504
4667
  }
4505
4668
 
4506
4669
  /* src/components/EmbedElement.svelte generated by Svelte v3.53.1 */
4507
4670
 
4508
- function add_css$b(target) {
4671
+ function add_css$c(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
 
@@ -4551,13 +4714,13 @@ 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$c, create_fragment$c, safe_not_equal, { code: 0, _style: 1 }, add_css$c);
4555
4718
  }
4556
4719
  }
4557
4720
 
4558
4721
  /* src/components/MovieYouTubeElement.svelte generated by Svelte v3.53.1 */
4559
4722
 
4560
- function add_css$a(target) {
4723
+ function add_css$b(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
 
@@ -4782,14 +4945,14 @@ class MovieYouTubeElement extends SvelteComponent {
4782
4945
  mute: 6,
4783
4946
  _style: 0
4784
4947
  },
4785
- add_css$a
4948
+ add_css$b
4786
4949
  );
4787
4950
  }
4788
4951
  }
4789
4952
 
4790
4953
  /* src/components/MovieVimeoElement.svelte generated by Svelte v3.53.1 */
4791
4954
 
4792
- function add_css$9(target) {
4955
+ function add_css$a(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
 
@@ -4978,109 +5141,15 @@ class MovieVimeoElement extends SvelteComponent {
4978
5141
  mute: 6,
4979
5142
  _style: 0
4980
5143
  },
4981
- add_css$9
5144
+ add_css$a
4982
5145
  );
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
- /* src/components/FormTextarea.svelte generated by Svelte v3.53.1 */
5081
-
5082
- function add_css$8(target) {
5083
- 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}");
5149
+ /* src/components/FormTextarea.svelte generated by Svelte v3.53.1 */
5150
+
5151
+ function add_css$9(target) {
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
5155
  function create_fragment$9(ctx) {
@@ -5186,138 +5255,33 @@ class FormTextarea extends SvelteComponent {
5186
5255
  rows: 1,
5187
5256
  placeholder: 2
5188
5257
  },
5189
- add_css$8
5258
+ add_css$9
5190
5259
  );
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
- function add_css$7(target) {
5305
- append_styles(target, "svelte-1ajmbw1", ".radio-buttons.svelte-1ajmbw1{display:flex;justify-content:center;flex-direction:column;width:100%;height:100%}");
5265
+ function add_css$8(target) {
5266
+ append_styles(target, "svelte-1574x6a", ".radio-buttons.svelte-1574x6a{display:flex;justify-content:space-evenly;flex-direction:column;width:100%;height:100%}.radio-button.svelte-1574x6a{font-size:12px;cursor:pointer;display:flex;align-items:center}.radio-button-input.svelte-1574x6a{appearance:none;margin:0;width:1.3em;height:1.3em;box-sizing:border-box;border-radius:0.7em;position:relative;background-color:rgba(0, 16, 14, 0.06);;;cursor:pointer}.radio-button-input.svelte-1574x6a:checked{border:solid 0.4em #2aab9f;background-color:#fff;box-shadow:0px 1px 8px 2px rgba(18,160,160,.08),0px 1px 4px -1px rgba(18,160,160,.24)}.radio-button-text.svelte-1574x6a{margin-left:0.4em}");
5306
5267
  }
5307
5268
 
5308
- function get_each_context$3(ctx, list, i) {
5269
+ function get_each_context$4(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}
5316
- function create_each_block$3(ctx) {
5276
+ // (24:2) {#each _options as option, i}
5277
+ function create_each_block$4(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 span;
5284
+ let t1_value = /*option*/ ctx[8] + "";
5321
5285
  let t1;
5322
5286
  let t2;
5323
5287
  let mounted;
@@ -5328,21 +5292,27 @@ function create_each_block$3(ctx) {
5328
5292
  label = element("label");
5329
5293
  input = element("input");
5330
5294
  t0 = space();
5295
+ span = element("span");
5331
5296
  t1 = text(t1_value);
5332
5297
  t2 = space();
5333
5298
  attr(input, "type", "radio");
5299
+ attr(input, "class", "radio-button-input svelte-1574x6a");
5334
5300
  attr(input, "name", /*name*/ ctx[0]);
5335
- input.value = /*$value*/ ctx[2];
5301
+ input.value = input_value_value = /*option*/ ctx[8];
5302
+ input.checked = input_checked_value = /*option*/ ctx[8] === /*_value*/ ctx[1];
5303
+ attr(span, "class", "radio-button-text svelte-1574x6a");
5304
+ attr(label, "class", "radio-button svelte-1574x6a");
5336
5305
  },
5337
5306
  m(target, anchor) {
5338
5307
  insert(target, label, anchor);
5339
5308
  append(label, input);
5340
5309
  append(label, t0);
5341
- append(label, t1);
5310
+ append(label, span);
5311
+ append(span, t1);
5342
5312
  append(label, t2);
5343
5313
 
5344
5314
  if (!mounted) {
5345
- dispose = listen(input, "change", /*handleChange*/ ctx[4](/*i*/ ctx[9]));
5315
+ dispose = listen(input, "change", /*handleChange*/ ctx[4](/*i*/ ctx[10]));
5346
5316
  mounted = true;
5347
5317
  }
5348
5318
  },
@@ -5353,11 +5323,15 @@ function create_each_block$3(ctx) {
5353
5323
  attr(input, "name", /*name*/ ctx[0]);
5354
5324
  }
5355
5325
 
5356
- if (dirty & /*$value*/ 4) {
5357
- input.value = /*$value*/ ctx[2];
5326
+ if (dirty & /*_options*/ 4 && input_value_value !== (input_value_value = /*option*/ ctx[8])) {
5327
+ input.value = input_value_value;
5358
5328
  }
5359
5329
 
5360
- if (dirty & /*_options*/ 2 && t1_value !== (t1_value = /*option*/ ctx[7] + "")) set_data(t1, t1_value);
5330
+ if (dirty & /*_options, _value*/ 6 && input_checked_value !== (input_checked_value = /*option*/ ctx[8] === /*_value*/ ctx[1])) {
5331
+ input.checked = input_checked_value;
5332
+ }
5333
+
5334
+ if (dirty & /*_options*/ 4 && t1_value !== (t1_value = /*option*/ ctx[8] + "")) set_data(t1, t1_value);
5361
5335
  },
5362
5336
  d(detaching) {
5363
5337
  if (detaching) detach(label);
@@ -5367,13 +5341,13 @@ function create_each_block$3(ctx) {
5367
5341
  };
5368
5342
  }
5369
5343
 
5370
- function create_fragment$7(ctx) {
5344
+ function create_fragment$8(ctx) {
5371
5345
  let div;
5372
- let each_value = /*_options*/ ctx[1];
5346
+ let each_value = /*_options*/ ctx[2];
5373
5347
  let each_blocks = [];
5374
5348
 
5375
5349
  for (let i = 0; i < each_value.length; i += 1) {
5376
- each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
5350
+ each_blocks[i] = create_each_block$4(get_each_context$4(ctx, each_value, i));
5377
5351
  }
5378
5352
 
5379
5353
  return {
@@ -5384,7 +5358,7 @@ function create_fragment$7(ctx) {
5384
5358
  each_blocks[i].c();
5385
5359
  }
5386
5360
 
5387
- attr(div, "class", "radio-buttons svelte-1ajmbw1");
5361
+ attr(div, "class", "radio-buttons svelte-1574x6a");
5388
5362
  },
5389
5363
  m(target, anchor) {
5390
5364
  insert(target, div, anchor);
@@ -5394,17 +5368,17 @@ function create_fragment$7(ctx) {
5394
5368
  }
5395
5369
  },
5396
5370
  p(ctx, [dirty]) {
5397
- if (dirty & /*_options, name, $value, handleChange*/ 23) {
5398
- each_value = /*_options*/ ctx[1];
5371
+ if (dirty & /*_options, name, _value, handleChange*/ 23) {
5372
+ each_value = /*_options*/ ctx[2];
5399
5373
  let i;
5400
5374
 
5401
5375
  for (i = 0; i < each_value.length; i += 1) {
5402
- const child_ctx = get_each_context$3(ctx, each_value, i);
5376
+ const child_ctx = get_each_context$4(ctx, each_value, i);
5403
5377
 
5404
5378
  if (each_blocks[i]) {
5405
5379
  each_blocks[i].p(child_ctx, dirty);
5406
5380
  } else {
5407
- each_blocks[i] = create_each_block$3(child_ctx);
5381
+ each_blocks[i] = create_each_block$4(child_ctx);
5408
5382
  each_blocks[i].c();
5409
5383
  each_blocks[i].m(div, null);
5410
5384
  }
@@ -5426,8 +5400,9 @@ function create_fragment$7(ctx) {
5426
5400
  };
5427
5401
  }
5428
5402
 
5429
- function instance$7($$self, $$props, $$invalidate) {
5403
+ function instance$8($$self, $$props, $$invalidate) {
5430
5404
  let _options;
5405
+ let _value;
5431
5406
  let $value;
5432
5407
  let { name = '' } = $$props;
5433
5408
  let { options = 'ラジオボタン1,ラジオボタン2,ラジオボタン3' } = $$props;
@@ -5442,7 +5417,7 @@ function instance$7($$self, $$props, $$invalidate) {
5442
5417
  }
5443
5418
  });
5444
5419
 
5445
- component_subscribe($$self, value, value => $$invalidate(2, $value = value));
5420
+ component_subscribe($$self, value, value => $$invalidate(6, $value = value));
5446
5421
 
5447
5422
  const handleChange = index => event => {
5448
5423
  if (event.target.checked) {
@@ -5457,34 +5432,38 @@ function instance$7($$self, $$props, $$invalidate) {
5457
5432
 
5458
5433
  $$self.$$.update = () => {
5459
5434
  if ($$self.$$.dirty & /*options*/ 32) {
5460
- $$invalidate(1, _options = options.split(','));
5435
+ $$invalidate(2, _options = options.split(','));
5436
+ }
5437
+
5438
+ if ($$self.$$.dirty & /*$value*/ 64) {
5439
+ $$invalidate(1, _value = $value[0]);
5461
5440
  }
5462
5441
  };
5463
5442
 
5464
- return [name, _options, $value, value, handleChange, options];
5443
+ return [name, _value, _options, value, handleChange, options, $value];
5465
5444
  }
5466
5445
 
5467
5446
  class FormRadioButtons extends SvelteComponent {
5468
5447
  constructor(options) {
5469
5448
  super();
5470
- init(this, options, instance$7, create_fragment$7, safe_not_equal, { name: 0, options: 5 }, add_css$7);
5449
+ init(this, options, instance$8, create_fragment$8, safe_not_equal, { name: 0, options: 5 }, add_css$8);
5471
5450
  }
5472
5451
  }
5473
5452
 
5474
5453
  /* src/components/FormSelect.svelte generated by Svelte v3.53.1 */
5475
5454
 
5476
- function add_css$6(target) {
5477
- append_styles(target, "svelte-1ajmbw1", ".radio-buttons.svelte-1ajmbw1{display:flex;justify-content:center;flex-direction:column;width:100%;height:100%}");
5455
+ function add_css$7(target) {
5456
+ append_styles(target, "svelte-1esvjlb", ".select-wrapper.svelte-1esvjlb{display:flex;justify-content:center;flex-direction:column;width:100%;height:100%;position:relative\n}.select-select.svelte-1esvjlb{position:relative;font-size:12px;appearance:none;border:solid 2px #ccc;border-radius:6px;padding:0.8em 1.6em 0.8em 0.8em;width:100%}.select-select.svelte-1esvjlb:focus{outline:none;border-color:#2aab9f}.select-icon.svelte-1esvjlb{position:absolute;width:0.5em;height:0.5em;top:calc(50% - 0.2em);right:0.8em;box-sizing:border-box;border-right:solid 2px #666;border-top:solid 2px #666;transform:translateY(-35.4%) rotate(135deg);pointer-events:none}");
5478
5457
  }
5479
5458
 
5480
- function get_each_context$2(ctx, list, i) {
5459
+ function get_each_context$3(ctx, list, i) {
5481
5460
  const child_ctx = ctx.slice();
5482
5461
  child_ctx[6] = list[i];
5483
5462
  child_ctx[8] = i;
5484
5463
  return child_ctx;
5485
5464
  }
5486
5465
 
5487
- // (28:8) {:else}
5466
+ // (29:10) {:else}
5488
5467
  function create_else_block(ctx) {
5489
5468
  let t;
5490
5469
 
@@ -5502,8 +5481,8 @@ function create_else_block(ctx) {
5502
5481
  };
5503
5482
  }
5504
5483
 
5505
- // (26:8) {#if option}
5506
- function create_if_block$1(ctx) {
5484
+ // (27:10) {#if option}
5485
+ function create_if_block$3(ctx) {
5507
5486
  let t_value = /*option*/ ctx[6] + "";
5508
5487
  let t;
5509
5488
 
@@ -5523,14 +5502,14 @@ function create_if_block$1(ctx) {
5523
5502
  };
5524
5503
  }
5525
5504
 
5526
- // (24:4) {#each _options as option, i}
5527
- function create_each_block$2(ctx) {
5505
+ // (25:6) {#each _options as option, i}
5506
+ function create_each_block$3(ctx) {
5528
5507
  let option;
5529
5508
  let t;
5530
5509
  let option_value_value;
5531
5510
 
5532
5511
  function select_block_type(ctx, dirty) {
5533
- if (/*option*/ ctx[6]) return create_if_block$1;
5512
+ if (/*option*/ ctx[6]) return create_if_block$3;
5534
5513
  return create_else_block;
5535
5514
  }
5536
5515
 
@@ -5575,37 +5554,50 @@ function create_each_block$2(ctx) {
5575
5554
  };
5576
5555
  }
5577
5556
 
5578
- function create_fragment$6(ctx) {
5579
- let div;
5557
+ function create_fragment$7(ctx) {
5558
+ let div2;
5559
+ let div1;
5580
5560
  let select;
5561
+ let t;
5562
+ let div0;
5581
5563
  let mounted;
5582
5564
  let dispose;
5583
5565
  let each_value = /*_options*/ ctx[0];
5584
5566
  let each_blocks = [];
5585
5567
 
5586
5568
  for (let i = 0; i < each_value.length; i += 1) {
5587
- each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
5569
+ each_blocks[i] = create_each_block$3(get_each_context$3(ctx, each_value, i));
5588
5570
  }
5589
5571
 
5590
5572
  return {
5591
5573
  c() {
5592
- div = element("div");
5574
+ div2 = element("div");
5575
+ div1 = element("div");
5593
5576
  select = element("select");
5594
5577
 
5595
5578
  for (let i = 0; i < each_blocks.length; i += 1) {
5596
5579
  each_blocks[i].c();
5597
5580
  }
5598
5581
 
5599
- attr(div, "class", "radio-buttons svelte-1ajmbw1");
5582
+ t = space();
5583
+ div0 = element("div");
5584
+ attr(select, "class", "select-select svelte-1esvjlb");
5585
+ attr(div0, "class", "select-icon svelte-1esvjlb");
5586
+ attr(div1, "class", "select");
5587
+ attr(div2, "class", "select-wrapper svelte-1esvjlb");
5600
5588
  },
5601
5589
  m(target, anchor) {
5602
- insert(target, div, anchor);
5603
- append(div, select);
5590
+ insert(target, div2, anchor);
5591
+ append(div2, div1);
5592
+ append(div1, select);
5604
5593
 
5605
5594
  for (let i = 0; i < each_blocks.length; i += 1) {
5606
5595
  each_blocks[i].m(select, null);
5607
5596
  }
5608
5597
 
5598
+ append(div1, t);
5599
+ append(div1, div0);
5600
+
5609
5601
  if (!mounted) {
5610
5602
  dispose = listen(select, "change", /*handleChange*/ ctx[1]);
5611
5603
  mounted = true;
@@ -5617,12 +5609,12 @@ function create_fragment$6(ctx) {
5617
5609
  let i;
5618
5610
 
5619
5611
  for (i = 0; i < each_value.length; i += 1) {
5620
- const child_ctx = get_each_context$2(ctx, each_value, i);
5612
+ const child_ctx = get_each_context$3(ctx, each_value, i);
5621
5613
 
5622
5614
  if (each_blocks[i]) {
5623
5615
  each_blocks[i].p(child_ctx, dirty);
5624
5616
  } else {
5625
- each_blocks[i] = create_each_block$2(child_ctx);
5617
+ each_blocks[i] = create_each_block$3(child_ctx);
5626
5618
  each_blocks[i].c();
5627
5619
  each_blocks[i].m(select, null);
5628
5620
  }
@@ -5638,7 +5630,7 @@ function create_fragment$6(ctx) {
5638
5630
  i: noop,
5639
5631
  o: noop,
5640
5632
  d(detaching) {
5641
- if (detaching) detach(div);
5633
+ if (detaching) detach(div2);
5642
5634
  destroy_each(each_blocks, detaching);
5643
5635
  mounted = false;
5644
5636
  dispose();
@@ -5646,7 +5638,7 @@ function create_fragment$6(ctx) {
5646
5638
  };
5647
5639
  }
5648
5640
 
5649
- function instance$6($$self, $$props, $$invalidate) {
5641
+ function instance$7($$self, $$props, $$invalidate) {
5650
5642
  let _options;
5651
5643
  let { name = '' } = $$props;
5652
5644
  let { options = 'プルダウン1,プルダウン2,プルダウン3' } = $$props;
@@ -5683,51 +5675,99 @@ function instance$6($$self, $$props, $$invalidate) {
5683
5675
  class FormSelect extends SvelteComponent {
5684
5676
  constructor(options) {
5685
5677
  super();
5686
- init(this, options, instance$6, create_fragment$6, safe_not_equal, { name: 2, options: 3 }, add_css$6);
5678
+ init(this, options, instance$7, create_fragment$7, safe_not_equal, { name: 2, options: 3 }, add_css$7);
5687
5679
  }
5688
5680
  }
5689
5681
 
5690
5682
  /* src/components/FormCheckBoxes.svelte generated by Svelte v3.53.1 */
5691
5683
 
5692
- function add_css$5(target) {
5693
- append_styles(target, "svelte-3uhiw4", ".check-boxes.svelte-3uhiw4{display:flex;justify-content:center;flex-direction:column;width:100%;height:100%}");
5684
+ function add_css$6(target) {
5685
+ append_styles(target, "svelte-1g004f9", ".check-boxes.svelte-1g004f9{display:flex;justify-content:space-evenly;flex-direction:column;width:100%;height:100%}.check-box.svelte-1g004f9{display:flex;align-items:center;font-size:12px;height:1.7em;position:relative;cursor:pointer}.check-box-input.svelte-1g004f9{width:0;height:0;margin:0}.check-box-check.svelte-1g004f9{display:inline-flex;background-color:rgba(0, 16, 14, 0.06);width:1.3em;height:1.3em;border-radius:0.3em;justify-content:center;align-items:center}.check-box-check._checked.svelte-1g004f9{box-shadow:0 4px 8px -2px rgb(0 16 14 / 31%)}.check-box-text.svelte-1g004f9{margin-left:0.5em}.check-box-icon.svelte-1g004f9{display:inline-block;width:12px;height:12px}.check-box-icon-inner.svelte-1g004f9{content:'';display:block;box-sizing:border-box;width:45%;height:91%;transform:translate(60%, -8%) rotate(45deg);border-style:none solid solid none;border-width:2px;border-color:#000}");
5694
5686
  }
5695
5687
 
5696
- function get_each_context$1(ctx, list, i) {
5688
+ function get_each_context$2(ctx, list, i) {
5697
5689
  const child_ctx = ctx.slice();
5698
5690
  child_ctx[8] = list[i];
5699
5691
  child_ctx[10] = i;
5700
5692
  return child_ctx;
5701
5693
  }
5702
5694
 
5695
+ // (34:8) {#if isCheckedArray[i]}
5696
+ function create_if_block$2(ctx) {
5697
+ let span1;
5698
+
5699
+ return {
5700
+ c() {
5701
+ span1 = element("span");
5702
+ span1.innerHTML = `<span class="check-box-icon-inner svelte-1g004f9" style="border-color: #fff"></span>`;
5703
+ attr(span1, "class", "check-box-icon svelte-1g004f9");
5704
+ set_style(span1, "width", "0.9em");
5705
+ set_style(span1, "height", "0.9em");
5706
+ },
5707
+ m(target, anchor) {
5708
+ insert(target, span1, anchor);
5709
+ },
5710
+ d(detaching) {
5711
+ if (detaching) detach(span1);
5712
+ }
5713
+ };
5714
+ }
5715
+
5703
5716
  // (30:2) {#each _options as option, i}
5704
- function create_each_block$1(ctx) {
5717
+ function create_each_block$2(ctx) {
5705
5718
  let label;
5706
5719
  let input;
5720
+ let input_checked_value;
5707
5721
  let t0;
5708
- let t1_value = /*option*/ ctx[8] + "";
5722
+ let span0;
5723
+ let span0_class_value;
5724
+ let span0_style_value;
5709
5725
  let t1;
5726
+ let span1;
5727
+ let t2_value = /*option*/ ctx[8] + "";
5710
5728
  let t2;
5729
+ let t3;
5711
5730
  let mounted;
5712
5731
  let dispose;
5732
+ let if_block = /*isCheckedArray*/ ctx[2][/*i*/ ctx[10]] && create_if_block$2();
5713
5733
 
5714
5734
  return {
5715
5735
  c() {
5716
5736
  label = element("label");
5717
5737
  input = element("input");
5718
5738
  t0 = space();
5719
- t1 = text(t1_value);
5720
- t2 = space();
5739
+ span0 = element("span");
5740
+ if (if_block) if_block.c();
5741
+ t1 = space();
5742
+ span1 = element("span");
5743
+ t2 = text(t2_value);
5744
+ t3 = space();
5745
+ attr(input, "class", "check-box-input svelte-1g004f9");
5721
5746
  attr(input, "type", "checkbox");
5722
5747
  attr(input, "name", /*name*/ ctx[0]);
5723
- input.value = /*$value*/ ctx[2];
5748
+ input.checked = input_checked_value = /*isCheckedArray*/ ctx[2][/*i*/ ctx[10]];
5749
+
5750
+ attr(span0, "class", span0_class_value = "" + (null_to_empty(`check-box-check${/*isCheckedArray*/ ctx[2][/*i*/ ctx[10]]
5751
+ ? ' _checked'
5752
+ : ''}`) + " svelte-1g004f9"));
5753
+
5754
+ attr(span0, "style", span0_style_value = `${/*isCheckedArray*/ ctx[2][/*i*/ ctx[10]]
5755
+ ? 'background-color: #2aab9f;'
5756
+ : ''}`);
5757
+
5758
+ attr(span1, "class", "check-box-text svelte-1g004f9");
5759
+ attr(label, "class", "check-box svelte-1g004f9");
5724
5760
  },
5725
5761
  m(target, anchor) {
5726
5762
  insert(target, label, anchor);
5727
5763
  append(label, input);
5728
5764
  append(label, t0);
5765
+ append(label, span0);
5766
+ if (if_block) if_block.m(span0, null);
5729
5767
  append(label, t1);
5730
- append(label, t2);
5768
+ append(label, span1);
5769
+ append(span1, t2);
5770
+ append(label, t3);
5731
5771
 
5732
5772
  if (!mounted) {
5733
5773
  dispose = listen(input, "change", /*handleChange*/ ctx[4](/*i*/ ctx[10]));
@@ -5741,27 +5781,51 @@ function create_each_block$1(ctx) {
5741
5781
  attr(input, "name", /*name*/ ctx[0]);
5742
5782
  }
5743
5783
 
5744
- if (dirty & /*$value*/ 4) {
5745
- input.value = /*$value*/ ctx[2];
5784
+ if (dirty & /*isCheckedArray*/ 4 && input_checked_value !== (input_checked_value = /*isCheckedArray*/ ctx[2][/*i*/ ctx[10]])) {
5785
+ input.checked = input_checked_value;
5786
+ }
5787
+
5788
+ if (/*isCheckedArray*/ ctx[2][/*i*/ ctx[10]]) {
5789
+ if (if_block) ; else {
5790
+ if_block = create_if_block$2();
5791
+ if_block.c();
5792
+ if_block.m(span0, null);
5793
+ }
5794
+ } else if (if_block) {
5795
+ if_block.d(1);
5796
+ if_block = null;
5797
+ }
5798
+
5799
+ if (dirty & /*isCheckedArray*/ 4 && span0_class_value !== (span0_class_value = "" + (null_to_empty(`check-box-check${/*isCheckedArray*/ ctx[2][/*i*/ ctx[10]]
5800
+ ? ' _checked'
5801
+ : ''}`) + " svelte-1g004f9"))) {
5802
+ attr(span0, "class", span0_class_value);
5746
5803
  }
5747
5804
 
5748
- if (dirty & /*_options*/ 2 && t1_value !== (t1_value = /*option*/ ctx[8] + "")) set_data(t1, t1_value);
5805
+ if (dirty & /*isCheckedArray*/ 4 && span0_style_value !== (span0_style_value = `${/*isCheckedArray*/ ctx[2][/*i*/ ctx[10]]
5806
+ ? 'background-color: #2aab9f;'
5807
+ : ''}`)) {
5808
+ attr(span0, "style", span0_style_value);
5809
+ }
5810
+
5811
+ if (dirty & /*_options*/ 2 && t2_value !== (t2_value = /*option*/ ctx[8] + "")) set_data(t2, t2_value);
5749
5812
  },
5750
5813
  d(detaching) {
5751
5814
  if (detaching) detach(label);
5815
+ if (if_block) if_block.d();
5752
5816
  mounted = false;
5753
5817
  dispose();
5754
5818
  }
5755
5819
  };
5756
5820
  }
5757
5821
 
5758
- function create_fragment$5(ctx) {
5822
+ function create_fragment$6(ctx) {
5759
5823
  let div;
5760
5824
  let each_value = /*_options*/ ctx[1];
5761
5825
  let each_blocks = [];
5762
5826
 
5763
5827
  for (let i = 0; i < each_value.length; i += 1) {
5764
- each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
5828
+ each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i));
5765
5829
  }
5766
5830
 
5767
5831
  return {
@@ -5772,7 +5836,7 @@ function create_fragment$5(ctx) {
5772
5836
  each_blocks[i].c();
5773
5837
  }
5774
5838
 
5775
- attr(div, "class", "check-boxes svelte-3uhiw4");
5839
+ attr(div, "class", "check-boxes svelte-1g004f9");
5776
5840
  },
5777
5841
  m(target, anchor) {
5778
5842
  insert(target, div, anchor);
@@ -5782,17 +5846,17 @@ function create_fragment$5(ctx) {
5782
5846
  }
5783
5847
  },
5784
5848
  p(ctx, [dirty]) {
5785
- if (dirty & /*_options, name, $value, handleChange*/ 23) {
5849
+ if (dirty & /*_options, isCheckedArray, name, handleChange*/ 23) {
5786
5850
  each_value = /*_options*/ ctx[1];
5787
5851
  let i;
5788
5852
 
5789
5853
  for (i = 0; i < each_value.length; i += 1) {
5790
- const child_ctx = get_each_context$1(ctx, each_value, i);
5854
+ const child_ctx = get_each_context$2(ctx, each_value, i);
5791
5855
 
5792
5856
  if (each_blocks[i]) {
5793
5857
  each_blocks[i].p(child_ctx, dirty);
5794
5858
  } else {
5795
- each_blocks[i] = create_each_block$1(child_ctx);
5859
+ each_blocks[i] = create_each_block$2(child_ctx);
5796
5860
  each_blocks[i].c();
5797
5861
  each_blocks[i].m(div, null);
5798
5862
  }
@@ -5814,7 +5878,7 @@ function create_fragment$5(ctx) {
5814
5878
  };
5815
5879
  }
5816
5880
 
5817
- function instance$5($$self, $$props, $$invalidate) {
5881
+ function instance$6($$self, $$props, $$invalidate) {
5818
5882
  let _options;
5819
5883
  let isCheckedArray;
5820
5884
  let $value;
@@ -5831,12 +5895,12 @@ function instance$5($$self, $$props, $$invalidate) {
5831
5895
  }
5832
5896
  });
5833
5897
 
5834
- component_subscribe($$self, value, value => $$invalidate(2, $value = value));
5898
+ component_subscribe($$self, value, value => $$invalidate(6, $value = value));
5835
5899
 
5836
5900
  const handleChange = index => event => {
5837
5901
  if (isCheckedArray[index] !== event.target.checked) {
5838
- isCheckedArray[index] = event.target.checked;
5839
- isCheckedArray = [...isCheckedArray];
5902
+ $$invalidate(2, isCheckedArray[index] = event.target.checked, isCheckedArray);
5903
+ $$invalidate(2, isCheckedArray = [...isCheckedArray]);
5840
5904
  const updated = _options.filter((option, i) => isCheckedArray[i]);
5841
5905
  value.set(updated);
5842
5906
  }
@@ -5852,21 +5916,292 @@ function instance$5($$self, $$props, $$invalidate) {
5852
5916
  $$invalidate(1, _options = options.split(','));
5853
5917
  }
5854
5918
 
5855
- if ($$self.$$.dirty & /*$value, _options*/ 6) {
5856
- isCheckedArray = (() => {
5919
+ if ($$self.$$.dirty & /*$value, _options*/ 66) {
5920
+ $$invalidate(2, isCheckedArray = (() => {
5857
5921
  const checkedSet = new Set($value);
5858
5922
  return _options.map(option => checkedSet.has(option));
5859
- })();
5923
+ })());
5860
5924
  }
5861
5925
  };
5862
5926
 
5863
- return [name, _options, $value, value, handleChange, options];
5927
+ return [name, _options, isCheckedArray, value, handleChange, options, $value];
5864
5928
  }
5865
5929
 
5866
5930
  class FormCheckBoxes extends SvelteComponent {
5867
5931
  constructor(options) {
5868
5932
  super();
5869
- init(this, options, instance$5, create_fragment$5, safe_not_equal, { name: 0, options: 5 }, add_css$5);
5933
+ init(this, options, instance$6, create_fragment$6, safe_not_equal, { name: 0, options: 5 }, add_css$6);
5934
+ }
5935
+ }
5936
+
5937
+ /* src/components/FormRatingButtons.svelte generated by Svelte v3.53.1 */
5938
+
5939
+ function add_css$5(target) {
5940
+ append_styles(target, "svelte-14cxkfs", ".rating-buttons.svelte-14cxkfs.svelte-14cxkfs{display:flex;justify-content:space-evenly;align-items:center;width:100%;height:100%}.rating-button.svelte-14cxkfs.svelte-14cxkfs{cursor:pointer;display:flex}.rating-button.svelte-14cxkfs svg.svelte-14cxkfs{fill:#ccc}.rating-button._selected.svelte-14cxkfs svg.svelte-14cxkfs{fill:#2aab9f}");
5941
+ }
5942
+
5943
+ function get_each_context$1(ctx, list, i) {
5944
+ const child_ctx = ctx.slice();
5945
+ child_ctx[8] = list[i];
5946
+ return child_ctx;
5947
+ }
5948
+
5949
+ // (36:30)
5950
+ function create_if_block_1$1(ctx) {
5951
+ let div;
5952
+ let svg;
5953
+ let path;
5954
+ let t;
5955
+ let div_class_value;
5956
+ let mounted;
5957
+ let dispose;
5958
+
5959
+ return {
5960
+ c() {
5961
+ div = element("div");
5962
+ svg = svg_element("svg");
5963
+ path = svg_element("path");
5964
+ t = space();
5965
+ attr(path, "d", /*LIKERT_FACE_SVG_DATA*/ ctx[4][/*i*/ ctx[8]]);
5966
+ attr(svg, "width", "24");
5967
+ attr(svg, "height", "24");
5968
+ attr(svg, "viewBox", "0 0 24 24");
5969
+ attr(svg, "fill", "none");
5970
+ attr(svg, "xmlns", "http://www.w3.org/2000/svg");
5971
+ attr(svg, "class", "svelte-14cxkfs");
5972
+ attr(div, "class", div_class_value = "rating-button" + (/*i*/ ctx[8] === /*_value*/ ctx[1] ? ' _selected' : '') + " svelte-14cxkfs");
5973
+ },
5974
+ m(target, anchor) {
5975
+ insert(target, div, anchor);
5976
+ append(div, svg);
5977
+ append(svg, path);
5978
+ append(div, t);
5979
+
5980
+ if (!mounted) {
5981
+ dispose = listen(div, "click", /*handleClick*/ ctx[3](/*i*/ ctx[8]));
5982
+ mounted = true;
5983
+ }
5984
+ },
5985
+ p(new_ctx, dirty) {
5986
+ ctx = new_ctx;
5987
+
5988
+ if (dirty & /*_value*/ 2 && div_class_value !== (div_class_value = "rating-button" + (/*i*/ ctx[8] === /*_value*/ ctx[1] ? ' _selected' : '') + " svelte-14cxkfs")) {
5989
+ attr(div, "class", div_class_value);
5990
+ }
5991
+ },
5992
+ d(detaching) {
5993
+ if (detaching) detach(div);
5994
+ mounted = false;
5995
+ dispose();
5996
+ }
5997
+ };
5998
+ }
5999
+
6000
+ // (30:4) {#if type === 'star'}
6001
+ function create_if_block$1(ctx) {
6002
+ let div;
6003
+ let svg;
6004
+ let path;
6005
+ let t;
6006
+ let div_class_value;
6007
+ let mounted;
6008
+ let dispose;
6009
+
6010
+ return {
6011
+ c() {
6012
+ div = element("div");
6013
+ svg = svg_element("svg");
6014
+ path = svg_element("path");
6015
+ t = space();
6016
+ attr(path, "d", "M11.2184 0.80902L8.42249 6.78134L2.09938 7.72433C0.981006 7.90395 0.550862 9.3409 1.36814 10.1941L5.88464 14.8193L4.80928 21.3304C4.63723 22.498 5.84163 23.396 6.83096 22.8572L12.4658 19.7588L18.0577 22.8572C19.047 23.396 20.2514 22.498 20.0794 21.3304L19.004 14.8193L23.5205 10.1941C24.3378 9.3409 23.9077 7.90395 22.7893 7.72433L16.5092 6.78134L13.6702 0.80902C13.1971 -0.223786 11.7346 -0.268691 11.2184 0.80902Z");
6017
+ attr(svg, "width", "24");
6018
+ attr(svg, "height", "24");
6019
+ attr(svg, "viewBox", "0 0 24 24");
6020
+ attr(svg, "fill", "none");
6021
+ attr(svg, "xmlns", "http://www.w3.org/2000/svg");
6022
+ attr(svg, "class", "svelte-14cxkfs");
6023
+ attr(div, "class", div_class_value = "rating-button" + (/*i*/ ctx[8] <= /*_value*/ ctx[1] ? ' _selected' : '') + " svelte-14cxkfs");
6024
+ },
6025
+ m(target, anchor) {
6026
+ insert(target, div, anchor);
6027
+ append(div, svg);
6028
+ append(svg, path);
6029
+ append(div, t);
6030
+
6031
+ if (!mounted) {
6032
+ dispose = listen(div, "click", /*handleClick*/ ctx[3](/*i*/ ctx[8]));
6033
+ mounted = true;
6034
+ }
6035
+ },
6036
+ p(new_ctx, dirty) {
6037
+ ctx = new_ctx;
6038
+
6039
+ if (dirty & /*_value*/ 2 && div_class_value !== (div_class_value = "rating-button" + (/*i*/ ctx[8] <= /*_value*/ ctx[1] ? ' _selected' : '') + " svelte-14cxkfs")) {
6040
+ attr(div, "class", div_class_value);
6041
+ }
6042
+ },
6043
+ d(detaching) {
6044
+ if (detaching) detach(div);
6045
+ mounted = false;
6046
+ dispose();
6047
+ }
6048
+ };
6049
+ }
6050
+
6051
+ // (29:2) {#each [...Array(5).keys()].map(i => i + 1) as i}
6052
+ function create_each_block$1(ctx) {
6053
+ let if_block_anchor;
6054
+
6055
+ function select_block_type(ctx, dirty) {
6056
+ if (/*type*/ ctx[0] === 'star') return create_if_block$1;
6057
+ if (/*type*/ ctx[0] === 'face') return create_if_block_1$1;
6058
+ }
6059
+
6060
+ let current_block_type = select_block_type(ctx);
6061
+ let if_block = current_block_type && current_block_type(ctx);
6062
+
6063
+ return {
6064
+ c() {
6065
+ if (if_block) if_block.c();
6066
+ if_block_anchor = empty();
6067
+ },
6068
+ m(target, anchor) {
6069
+ if (if_block) if_block.m(target, anchor);
6070
+ insert(target, if_block_anchor, anchor);
6071
+ },
6072
+ p(ctx, dirty) {
6073
+ if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
6074
+ if_block.p(ctx, dirty);
6075
+ } else {
6076
+ if (if_block) if_block.d(1);
6077
+ if_block = current_block_type && current_block_type(ctx);
6078
+
6079
+ if (if_block) {
6080
+ if_block.c();
6081
+ if_block.m(if_block_anchor.parentNode, if_block_anchor);
6082
+ }
6083
+ }
6084
+ },
6085
+ d(detaching) {
6086
+ if (if_block) {
6087
+ if_block.d(detaching);
6088
+ }
6089
+
6090
+ if (detaching) detach(if_block_anchor);
6091
+ }
6092
+ };
6093
+ }
6094
+
6095
+ function create_fragment$5(ctx) {
6096
+ let div;
6097
+ let each_value = [...Array(5).keys()].map(func);
6098
+ let each_blocks = [];
6099
+
6100
+ for (let i = 0; i < each_value.length; i += 1) {
6101
+ each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i));
6102
+ }
6103
+
6104
+ return {
6105
+ c() {
6106
+ div = element("div");
6107
+
6108
+ for (let i = 0; i < each_blocks.length; i += 1) {
6109
+ each_blocks[i].c();
6110
+ }
6111
+
6112
+ attr(div, "class", "rating-buttons svelte-14cxkfs");
6113
+ },
6114
+ m(target, anchor) {
6115
+ insert(target, div, anchor);
6116
+
6117
+ for (let i = 0; i < each_blocks.length; i += 1) {
6118
+ each_blocks[i].m(div, null);
6119
+ }
6120
+ },
6121
+ p(ctx, [dirty]) {
6122
+ if (dirty & /*Array, _value, handleClick, type, LIKERT_FACE_SVG_DATA*/ 27) {
6123
+ each_value = [...Array(5).keys()].map(func);
6124
+ let i;
6125
+
6126
+ for (i = 0; i < each_value.length; i += 1) {
6127
+ const child_ctx = get_each_context$1(ctx, each_value, i);
6128
+
6129
+ if (each_blocks[i]) {
6130
+ each_blocks[i].p(child_ctx, dirty);
6131
+ } else {
6132
+ each_blocks[i] = create_each_block$1(child_ctx);
6133
+ each_blocks[i].c();
6134
+ each_blocks[i].m(div, null);
6135
+ }
6136
+ }
6137
+
6138
+ for (; i < each_blocks.length; i += 1) {
6139
+ each_blocks[i].d(1);
6140
+ }
6141
+
6142
+ each_blocks.length = each_value.length;
6143
+ }
6144
+ },
6145
+ i: noop,
6146
+ o: noop,
6147
+ d(detaching) {
6148
+ if (detaching) detach(div);
6149
+ destroy_each(each_blocks, detaching);
6150
+ }
6151
+ };
6152
+ }
6153
+
6154
+ const func = i => i + 1;
6155
+
6156
+ function instance$5($$self, $$props, $$invalidate) {
6157
+ let _value;
6158
+ let $value;
6159
+ let { name = '' } = $$props;
6160
+ let { type = 'face' } = $$props;
6161
+ const { path: statePath } = getStateItemContext();
6162
+
6163
+ const value = registerInput({
6164
+ name,
6165
+ statePath,
6166
+ initialValue: [],
6167
+ validator(value) {
6168
+ return value.length > 0;
6169
+ }
6170
+ });
6171
+
6172
+ component_subscribe($$self, value, value => $$invalidate(6, $value = value));
6173
+
6174
+ const handleClick = index => event => {
6175
+ value.set([String(index)]);
6176
+ };
6177
+
6178
+ // 5段階スケールで使用する顔絵文字のsvgデータ
6179
+ const LIKERT_FACE_SVG_DATA = {
6180
+ 1: 'M12 0.375C5.57812 0.375 0.375 5.57812 0.375 12C0.375 18.4219 5.57812 23.625 12 23.625C18.4219 23.625 23.625 18.4219 23.625 12C23.625 5.57812 18.4219 0.375 12 0.375ZM12 21.375C6.79688 21.375 2.625 17.2031 2.625 12C2.625 6.84375 6.79688 2.625 12 2.625C17.1562 2.625 21.375 6.84375 21.375 12C21.375 17.2031 17.1562 21.375 12 21.375ZM18.0469 7.17188C17.8594 6.9375 17.5312 6.89062 17.2969 7.03125L13.5469 9.28125C13.4062 9.375 13.3125 9.5625 13.3125 9.75C13.3125 9.98438 13.4062 10.1719 13.5469 10.2656L17.2969 12.5156C17.5781 12.6562 17.8594 12.5625 18.0469 12.375C18.1875 12.1875 18.2344 11.8594 18.0469 11.6719L16.4531 9.75L18.0469 7.875C18.2344 7.6875 18.1875 7.35938 18.0469 7.17188ZM10.6875 9.75C10.6875 9.5625 10.5469 9.375 10.4062 9.28125L6.65625 7.03125C6.42188 6.89062 6.09375 6.9375 5.90625 7.17188C5.76562 7.35938 5.76562 7.6875 5.90625 7.875L7.5 9.75L5.90625 11.6719C5.76562 11.8594 5.76562 12.1875 5.90625 12.375C6.09375 12.5625 6.375 12.6562 6.65625 12.5156L10.4062 10.2656C10.5469 10.1719 10.6875 9.98438 10.6875 9.75ZM12 12.75C9.84375 12.75 7.26562 14.5781 6.9375 17.1562C6.84375 17.7188 7.26562 18.1406 7.64062 18C8.71875 17.5312 10.3125 17.25 12 17.25C13.6875 17.25 15.2344 17.5312 16.3125 18C16.6875 18.1406 17.1094 17.7188 17.0156 17.1562C16.6875 14.5781 14.1094 12.75 12 12.75Z',
6181
+ 2: 'M12 0.375C5.57812 0.375 0.375 5.57812 0.375 12C0.375 18.4219 5.57812 23.625 12 23.625C18.4219 23.625 23.625 18.4219 23.625 12C23.625 5.57812 18.4219 0.375 12 0.375ZM12 21.375C6.79688 21.375 2.625 17.2031 2.625 12C2.625 6.84375 6.79688 2.625 12 2.625C17.1562 2.625 21.375 6.84375 21.375 12C21.375 17.2031 17.1562 21.375 12 21.375ZM8.25 11.25C9.04688 11.25 9.75 10.5938 9.75 9.75C9.75 8.95312 9.04688 8.25 8.25 8.25C7.40625 8.25 6.75 8.95312 6.75 9.75C6.75 10.5938 7.40625 11.25 8.25 11.25ZM15.75 8.25C14.9062 8.25 14.25 8.95312 14.25 9.75C14.25 10.5938 14.9062 11.25 15.75 11.25C16.5469 11.25 17.25 10.5938 17.25 9.75C17.25 8.95312 16.5469 8.25 15.75 8.25ZM12 14.25C10.0781 14.25 8.34375 15.0938 7.125 16.5469C6.70312 17.0156 6.79688 17.7188 7.26562 18.1406C7.73438 18.5156 8.4375 18.4688 8.85938 18C9.60938 17.0625 10.7812 16.5 12 16.5C13.1719 16.5 14.3438 17.0625 15.0938 18C15.5156 18.4219 16.2188 18.5625 16.6875 18.1406C17.1562 17.7188 17.25 17.0156 16.8281 16.5469C15.6562 15.0938 13.875 14.25 12 14.25Z',
6182
+ 3: 'M12 0.375C5.57812 0.375 0.375 5.57812 0.375 12C0.375 18.4219 5.57812 23.625 12 23.625C18.4219 23.625 23.625 18.4219 23.625 12C23.625 5.57812 18.4219 0.375 12 0.375ZM12 21.375C6.79688 21.375 2.625 17.2031 2.625 12C2.625 6.84375 6.79688 2.625 12 2.625C17.1562 2.625 21.375 6.84375 21.375 12C21.375 17.2031 17.1562 21.375 12 21.375ZM8.25 11.25C9.04688 11.25 9.75 10.5938 9.75 9.75C9.75 8.95312 9.04688 8.25 8.25 8.25C7.40625 8.25 6.75 8.95312 6.75 9.75C6.75 10.5938 7.40625 11.25 8.25 11.25ZM15.75 8.25C14.9062 8.25 14.25 8.95312 14.25 9.75C14.25 10.5938 14.9062 11.25 15.75 11.25C16.5469 11.25 17.25 10.5938 17.25 9.75C17.25 8.95312 16.5469 8.25 15.75 8.25ZM16.125 15H7.875C7.21875 15 6.75 15.5156 6.75 16.125C6.75 16.7812 7.21875 17.25 7.875 17.25H16.125C16.7344 17.25 17.25 16.7812 17.25 16.125C17.25 15.5156 16.7344 15 16.125 15Z',
6183
+ 4: 'M15.75 8.4375C14.5312 8.4375 13.125 9.23438 12.9375 10.4531C12.8438 10.9688 13.4531 11.2969 13.8281 10.9219L14.2969 10.5469C15 9.9375 16.4531 9.9375 17.1562 10.5469L17.625 10.9219C18 11.2969 18.6094 10.9688 18.5156 10.4531C18.3281 9.23438 16.9219 8.4375 15.75 8.4375ZM8.25 11.25C9.04688 11.25 9.75 10.5938 9.75 9.75C9.75 8.95312 9.04688 8.25 8.25 8.25C7.40625 8.25 6.75 8.95312 6.75 9.75C6.75 10.5938 7.40625 11.25 8.25 11.25ZM16.9219 14.2969C15.7031 14.6719 13.9219 14.9062 12 14.9062C10.0312 14.9062 8.25 14.6719 7.03125 14.2969C6.5625 14.1562 6.14062 14.5781 6.1875 15C6.5625 17.25 9.5625 18.75 12 18.75C14.3906 18.75 17.3906 17.25 17.7656 15C17.8125 14.5781 17.3906 14.1562 16.9219 14.2969ZM12 0.375C5.57812 0.375 0.375 5.625 0.375 12C0.375 18.4219 5.57812 23.625 12 23.625C18.375 23.625 23.625 18.4219 23.625 12C23.625 5.625 18.375 0.375 12 0.375ZM12 21.375C6.79688 21.375 2.625 17.2031 2.625 12C2.625 6.84375 6.79688 2.625 12 2.625C17.1562 2.625 21.375 6.84375 21.375 12C21.375 17.2031 17.1562 21.375 12 21.375Z',
6184
+ 5: 'M12 0.375C5.57812 0.375 0.375 5.57812 0.375 12C0.375 18.4219 5.57812 23.625 12 23.625C18.4219 23.625 23.625 18.4219 23.625 12C23.625 5.57812 18.4219 0.375 12 0.375ZM12 21.375C6.79688 21.375 2.625 17.2031 2.625 12C2.625 6.84375 6.79688 2.625 12 2.625C17.1562 2.625 21.375 6.84375 21.375 12C21.375 17.2031 17.1562 21.375 12 21.375ZM16.9219 14.2969C15.7031 14.6719 13.9219 14.9062 12 14.9062C10.0312 14.9062 8.25 14.6719 7.03125 14.2969C6.5625 14.1562 6.14062 14.5312 6.1875 15C6.5625 17.2031 9.5625 18.75 12 18.75C14.4375 18.75 17.3906 17.2031 17.7656 15C17.8125 14.5781 17.3906 14.1562 16.9219 14.2969ZM5.90625 12.375C6.09375 12.5625 6.375 12.6562 6.65625 12.5156L10.4062 10.2656C10.5469 10.1719 10.6875 9.98438 10.6875 9.75C10.6875 9.5625 10.5469 9.375 10.4062 9.28125L6.65625 7.03125C6.42188 6.89062 6.09375 6.9375 5.90625 7.17188C5.76562 7.35938 5.76562 7.6875 5.90625 7.875L7.5 9.75L5.90625 11.6719C5.76562 11.8594 5.76562 12.1875 5.90625 12.375ZM17.2969 12.5156C17.5781 12.6562 17.8594 12.5625 18.0469 12.375C18.1875 12.1875 18.1875 11.8594 18.0469 11.6719L16.4531 9.75L18.0469 7.875C18.2344 7.6875 18.1875 7.35938 18.0469 7.17188C17.8594 6.9375 17.5312 6.89062 17.2969 7.03125L13.5469 9.28125C13.4062 9.375 13.3125 9.5625 13.3125 9.75C13.3125 9.98438 13.4062 10.1719 13.5469 10.2656L17.2969 12.5156Z'
6185
+ };
6186
+
6187
+ $$self.$$set = $$props => {
6188
+ if ('name' in $$props) $$invalidate(5, name = $$props.name);
6189
+ if ('type' in $$props) $$invalidate(0, type = $$props.type);
6190
+ };
6191
+
6192
+ $$self.$$.update = () => {
6193
+ if ($$self.$$.dirty & /*$value*/ 64) {
6194
+ $$invalidate(1, _value = Number($value[0] ?? -1));
6195
+ }
6196
+ };
6197
+
6198
+ return [type, _value, value, handleClick, LIKERT_FACE_SVG_DATA, name, $value];
6199
+ }
6200
+
6201
+ class FormRatingButtons extends SvelteComponent {
6202
+ constructor(options) {
6203
+ super();
6204
+ init(this, options, instance$5, create_fragment$5, safe_not_equal, { name: 5, type: 0 }, add_css$5);
5870
6205
  }
5871
6206
  }
5872
6207
 
@@ -7096,4 +7431,4 @@ class ImageBlock extends SvelteComponent {
7096
7431
  }
7097
7432
  }
7098
7433
 
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 };
7434
+ export { Alignments, AnimationStyles, BackgroundSizes, ClipPaths, Cursors, DefaultListBackground, DefaultListBackgroundNone, DefaultListBackgroundStripe, DefaultListSeparator, DefaultListSeparatorBorder, DefaultListSeparatorGap, DefaultListSeparatorNone, DefaultModalPlacement, DefaultSlideButton, DefaultSlideNavigationButton, Directions, Elasticities, ElasticityStyle, EmbedElement, Flex, FlexItem, FormCheckBoxes, FormRadioButtons, FormRatingButtons, 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 };