<commit_before>frappe.provide("erpnext.setup");

frappe.pages['setup-wizard'].on_page_load = function(wrapper) {
	if(frappe.sys_defaults.company) {
		frappe.set_route("desk");
		return;
	}
};

var erpnext_slides = [
	{
		// Domain
		name: 'domain',
		domains: ["all"],
		title: __('Select your Domain'),
		fields: [
			{
				fieldname: 'domain', label: __('Domain'), fieldtype: 'Select',
				options: [
					{ "label": __("Distribution"), "value": "Distribution" },
					{ "label": __("Education"), "value": "Education" },
					{ "label": __("Manufacturing"), "value": "Manufacturing" },
					{ "label": __("Retail"), "value": "Retail" },
					{ "label": __("Services"), "value": "Services" }
				], reqd: 1
			},
		],
		help: __('Select the nature of your business.'),
		onload: function (slide) {
			slide.get_input("domain").on("change", function () {
				frappe.setup.domain = $(this).val();
				frappe.wizard.refresh_slides();
			});
		},
	},

	{
		// Brand
		name: 'brand',
		domains: ["all"],
		icon: "fa fa-bookmark",
		title: __("The Brand"),
		help: __('Upload your letter head and logo. (you can edit them later).'),
		fields: [
			{
				fieldtype: "Attach Image", fieldname: "attach_logo",
				label: __("Attach Logo"),
				description: __("100px by 100px"),
				is_private: 0
			},
			{
				fieldname: 'company_name',
				label: frappe.setup.domain === 'Education' ?
					__('Institute Name') : __('Company Name'),
				fieldtype: 'Data', reqd: 1
			},
			{
				fieldname: 'company_abbr',
				label: frappe.setup.domain === 'Education' ?
					__('Institute Abbreviation') : __('Company Abbreviation'),
				fieldtype: 'Data'
			}
		],
		onload: function(slide) {
			this.bind_events(slide);
		},
		bind_events: function (slide) {
			slide.get_input("company_name").on("change", function () {
				var parts = slide.get_input("company_name").val().split(" ");
				var abbr = $.map(parts, function (p) { return p ? p.substr(0, 1) : null }).join("");
				slide.get_field("company_abbr").set_value(abbr.slice(0, 5).toUpperCase());
			}).val(frappe.boot.sysdefaults.company_name || "").trigger("change");

			slide.get_input("company_abbr").on("change", function () {
				if (slide.get_input("company_abbr").val().length > 5) {
					frappe.msgprint("Company Abbreviation cannot have more than 5 characters");
					slide.get_field("company_abbr").set_value("");
				}
			});
		}
	},
	{
		// Organisation
		name: 'organisation',
		domains: ["all"],<commit_msg>[minor][wiz] fix company image alignment (#10114)<commit_after>frappe.provide("erpnext.setup");

frappe.pages['setup-wizard'].on_page_load = function(wrapper) {
	if(frappe.sys_defaults.company) {
		frappe.set_route("desk");
		return;
	}
};

var erpnext_slides = [
	{
		// Domain
		name: 'domain',
		domains: ["all"],
		title: __('Select your Domain'),
		fields: [
			{
				fieldname: 'domain', label: __('Domain'), fieldtype: 'Select',
				options: [
					{ "label": __("Distribution"), "value": "Distribution" },
					{ "label": __("Education"), "value": "Education" },
					{ "label": __("Manufacturing"), "value": "Manufacturing" },
					{ "label": __("Retail"), "value": "Retail" },
					{ "label": __("Services"), "value": "Services" }
				], reqd: 1
			},
		],
		help: __('Select the nature of your business.'),
		onload: function (slide) {
			slide.get_input("domain").on("change", function () {
				frappe.setup.domain = $(this).val();
				frappe.wizard.refresh_slides();
			});
		},
	},

	{
		// Brand
		name: 'brand',
		domains: ["all"],
		icon: "fa fa-bookmark",
		title: __("The Brand"),
		help: __('Upload your letter head and logo. (you can edit them later).'),
		fields: [
			{
				fieldtype: "Attach Image", fieldname: "attach_logo",
				label: __("Attach Logo"),
				description: __("100px by 100px"),
				is_private: 0,
				align: 'center'
			},
			{
				fieldname: 'company_name',
				label: frappe.setup.domain === 'Education' ?
					__('Institute Name') : __('Company Name'),
				fieldtype: 'Data',
				reqd: 1
			},
			{
				fieldname: 'company_abbr',
				label: frappe.setup.domain === 'Education' ?
					__('Institute Abbreviation') : __('Company Abbreviation'),
				fieldtype: 'Data'
			}
		],
		onload: function(slide) {
			this.bind_events(slide);
		},
		bind_events: function (slide) {
			slide.get_input("company_name").on("change", function () {
				var parts = slide.get_input("company_name").val().split(" ");
				var abbr = $.map(parts, function (p) { return p ? p.substr(0, 1) : null }).join("");
				slide.get_field("company_abbr").set_value(abbr.slice(0, 5).toUpperCase());
			}).val(frappe.boot.sysdefaults.company_name || "").trigger("change");

			slide.get_input("company_abbr").on("change", function () {
				if (slide.get_input("company_abbr").val().length > 5) {
					frappe.msgprint("Company Abbreviation cannot have more than 5 characters");
					slide.get_field("company_abbr").set_value("");
				}
			});
		}
	},
	{
		// Organisation
		name: 'organisation',
		domains: ["all"],
{'fraction_non_alphanumeric': 0.19871666332464408, 'fraction_numerical': 0.007018247443352717, 'mean_word_length': 3.6704119850187267, 'pattern_counts': {'":': 20, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1059040', 'n_tokens_mistral': 2091, 'n_tokens_neox': 1727, 'n_words': 346}