import * as vue from "vue";
import { defineComponent, mergeProps, unref, useSSRContext } from "vue";
import { ssrRenderAttrs, ssrRenderList, ssrInterpolate } from "vue/server-renderer";
import { I as normalizeList } from "../mount.js";
import "js-cookie";
import "events";
import "http";
import "@medv/finder";
import "front-matter";
import "markdown-it";
import "markdown-it-anchor";
import "markdown-it-implicit-figures";
import "markdown-it-link-attributes";
import "markdown-it-video";
import "remove-markdown";
import "./index.2544f8a4.js";
import "body-parser";
import "path-browserify";
import "dotenv";
import "compression";
import "serve-favicon";
import "serve-static";
import "html-minifier";
import "vite";
import "@vue/server-renderer";
import "fs";
import "enquirer";
import "semver";
import "glob";
import "minimist";
import "handlebars";
import "execa";
import "multer";
import "sharp";
import "@vitejs/plugin-vue";
import "express";
import "axios";
import "knex";
import "dompurify";
import "dayjs";
import "chalk";
import "dayjs/plugin/relativeTime.js";
import "dayjs/plugin/utc.js";
import "dayjs/plugin/timezone.js";
import "dayjs/plugin/updateLocale.js";
import "dayjs/plugin/weekOfYear.js";
import "deepmerge";
import "fast-safe-stringify";
import "spark-md5";
import "nanoid";
import "is-plain-object";
import "prettyoutput";
import "consola";
import "validator";
import "@vueuse/head";
import "node-fetch";
import "vue-router";
import "jsonwebtoken";
import "fs-extra";
import "bcrypt";
import "knex-stringcase";
import "@sinclair/typebox";
import "nodemailer";
import "nodemailer-html-to-text";
import "@tailwindcss/forms";
import "unocss/vite";
import "@unocss/preset-icons";
import "nodemon";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "InputCheckboxMulti",
  __ssrInlineRender: true,
  props: {
    modelValue: {
      type: [Array, String],
      default: () => []
    },
    list: { type: Array, default: () => {
    } }
  },
  emits: ["update:modelValue"],
  setup(__props, { emit }) {
    const props = __props;
    const attrs = vue.useAttrs();
    const li = vue.computed(() => {
      var _a;
      return normalizeList((_a = props.list) != null ? _a : []);
    });
    const val = vue.computed(() => {
      return typeof props.modelValue == "string" ? props.modelValue.split(",").map((_) => _.trim()) : props.modelValue;
    });
    const selected = vue.computed({
      get: () => {
        var _a;
        return (_a = val.value) != null ? _a : [];
      },
      set: (v) => {
        emit("update:modelValue", v);
      }
    });
    const isSelected = (value) => {
      var _a;
      return value && ((_a = selected.value) == null ? void 0 : _a.includes(value)) ? true : false;
    };
    const classes = [
      "form-checkbox",
      "mr-4",
      "h-5",
      "w-5",
      "appearance-none",
      "rounded-md",
      "border",
      "focus:outline-none",
      "focus:ring-0",
      "border-theme-300",
      "hover:border-theme-400",
      "text-theme-500",
      "bg-theme-100"
    ];
    return (_ctx, _push, _parent, _attrs) => {
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "my-4" }, _attrs))}>`);
      if (unref(li).length == 0) {
        _push(`<div class="text-input-placeholder">No Items</div>`);
      } else {
        _push(`<!--[-->`);
        ssrRenderList(unref(li), (item, i) => {
          _push(`<div class="my-2"><label class="inline-flex cursor-pointer items-center"><input${ssrRenderAttrs(mergeProps(unref(attrs), {
            type: "checkbox",
            class: classes,
            checked: isSelected(item.value)
          }))}><span class="checkbox-label text-input-size text-theme-700 select-none">${ssrInterpolate(item.name)}</span></label></div>`);
        });
        _push(`<!--]-->`);
      }
      _push(`</div>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../ui/InputCheckboxMulti.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as default
};
